public interface Logger
The JDO Logger interface contains a small number of convenience methods in addition to a subset of the methods in the java.util.logging.Logger class, and can therefore be implemented in a very straightforward way by a subclass of the java.util.logging.Logger class. There is one instance of the implementing class for each subsystem in JDO.
This interface has no JDK 1.4 dependencies.
Modifier and Type | Field and Description |
---|---|
static int |
ALL
ALL indicates that all messages should be logged.
|
static int |
CONFIG
CONFIG is a message level for static configuration messages.
|
static int |
FINE
FINE is a message level providing tracing information.
|
static int |
FINER
FINER indicates a fairly detailed tracing message.
|
static int |
FINEST
FINEST indicates a highly detailed tracing message
|
static int |
INFO
INFO is a message level for informational messages.
|
static int |
OFF
OFF is a special level that can be used to turn off logging.
|
static int |
SEVERE
SEVERE is a message level indicating a serious failure.
|
static int |
WARNING
WARNING is a message level indicating a potential problem.
|
Modifier and Type | Method and Description |
---|---|
void |
config(String msg)
Log a CONFIG message.
|
void |
entering(String sourceClass,
String sourceMethod)
Log a method entry.
|
void |
entering(String sourceClass,
String sourceMethod,
Object param1)
Log a method entry, with one parameter.
|
void |
entering(String sourceClass,
String sourceMethod,
Object[] params)
Log a method entry, with an array of parameters.
|
void |
exiting(String sourceClass,
String sourceMethod)
Log a method return.
|
void |
exiting(String sourceClass,
String sourceMethod,
Object result)
Log a method return, with result object.
|
void |
fine(String msg)
Log a message.
|
void |
fine(String msg,
Object o1)
Log a FINE message.
|
void |
fine(String msg,
Object[] o)
Log a FINE message.
|
void |
fine(String msg,
Object o1,
Object o2)
Log a FINE message.
|
void |
fine(String msg,
Object o1,
Object o2,
Object o3)
Log a FINE message.
|
void |
finer(String msg)
Log a FINER message.
|
void |
finer(String msg,
Object o1)
Log a FINER message.
|
void |
finer(String msg,
Object[] o)
Log a FINER message.
|
void |
finer(String msg,
Object o1,
Object o2)
Log a FINER message.
|
void |
finer(String msg,
Object o1,
Object o2,
Object o3)
Log a FINER message.
|
void |
finest(String msg)
Log a FINEST message.
|
void |
finest(String msg,
Object o1)
Log a FINEST message.
|
void |
finest(String msg,
Object[] o)
Log a FINEST message.
|
void |
finest(String msg,
Object o1,
Object o2)
Log a FINEST message.
|
void |
finest(String msg,
Object o1,
Object o2,
Object o3)
Log a FINEST message.
|
String |
getName()
Get the name for this logger.
|
void |
info(String msg)
Log an INFO message.
|
boolean |
isLoggable()
Test if this logger is logging messages.
|
boolean |
isLoggable(int level)
Test if this logger is logging messages at the specific level.
|
void |
log(int level,
String msg)
Log a message.
|
void |
log(int level,
String msg,
Object o1)
Log a message.
|
void |
log(int level,
String msg,
Object[] o)
Log a message.
|
void |
log(int level,
String msg,
Object o1,
Object o2)
Log a message.
|
void |
log(int level,
String msg,
Object o1,
Object o2,
Object o3)
Log a message.
|
void |
log(int level,
String msg,
Throwable thrown)
Log a message.
|
void |
severe(String msg)
Log a SEVERE message.
|
void |
throwing(String sourceClass,
String sourceMethod,
Throwable thrown)
Log throwing an exception.
|
void |
warning(String msg)
Log a WARNING message.
|
static final int OFF
static final int SEVERE
In general SEVERE messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
static final int WARNING
In general WARNING messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
static final int INFO
Typically INFO messages will be written to the console or its equivalent. So the INFO level should only be used for reasonably significant messages that will make sense to end users and system admins.
static final int CONFIG
CONFIG messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations. For example, CONFIG message might include the CPU type, the graphics depth, the GUI look-and-feel, etc.
static final int FINE
All of FINE, FINER, and FINEST are intended for relatively detailed tracing. The exact meaning of the three levels will vary between subsystems, but in general, FINEST should be used for the most voluminous detailed output, FINER for somewhat less detailed output, and FINE for the lowest volume (and most important) messages.
In general the FINE level should be used for information that will be broadly interesting to developers who do not have a specialized interest in the specific subsystem.
FINE messages might include things like minor (recoverable) failures. Issues indicating potential performance problems are also worth logging as FINE.
static final int FINER
static final int FINEST
static final int ALL
boolean isLoggable()
boolean isLoggable(int level)
level
- The level to be testedvoid entering(String sourceClass, String sourceMethod)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY", log level FINER, and the given sourceMethod and sourceClass is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredvoid entering(String sourceClass, String sourceMethod, Object param1)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY {0}", log level FINER, and the given sourceMethod, sourceClass, and parameter is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredparam1
- parameter to the method being enteredvoid entering(String sourceClass, String sourceMethod, Object[] params)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY" (followed by a format {N} indicator for each entry in the parameter array), log level FINER, and the given sourceMethod, sourceClass, and parameters is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredparams
- array of parameters to the method being enteredvoid exiting(String sourceClass, String sourceMethod)
This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN", log level FINER, and the given sourceMethod and sourceClass is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the methodvoid exiting(String sourceClass, String sourceMethod, Object result)
This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN {0}", log level FINER, and the gives sourceMethod, sourceClass, and result object is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the methodresult
- Object that is being returnedvoid throwing(String sourceClass, String sourceMethod, Throwable thrown)
This is a convenience method to log that a method is terminating by throwing an exception. The logging is done using the FINER level.
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. The LogRecord's message is set to "THROW".
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the method.thrown
- The Throwable that is being thrown.void severe(String msg)
If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void warning(String msg)
If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void info(String msg)
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void config(String msg)
If the logger is currently enabled for the CONFIG message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void log(int level, String msg)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)void log(int level, String msg, Object o1)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messagevoid log(int level, String msg, Object[] o)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)o
- Objects to be inserted into the messagevoid log(int level, String msg, Object o1, Object o2)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messagevoid log(int level, String msg, Object o1, Object o2, Object o3)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messageo3
- A parameter to be inserted into the messagevoid log(int level, String msg, Throwable thrown)
If the logger is currently enabled for the message level then the given message, and the exception dump, is forwarded to all the registered output Handler objects.
level
- The level for this messagemsg
- The string message (or a key in the message catalog)thrown
- The exception to logvoid fine(String msg)
If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void fine(String msg, Object o1)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messagevoid fine(String msg, Object[] o)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o
- Objects to be inserted into the messagevoid fine(String msg, Object o1, Object o2)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messagevoid fine(String msg, Object o1, Object o2, Object o3)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messageo3
- A parameter to be inserted into the messagevoid finer(String msg)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void finer(String msg, Object[] o)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o
- Objects to be inserted into the messagevoid finer(String msg, Object o1)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messagevoid finer(String msg, Object o1, Object o2)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messagevoid finer(String msg, Object o1, Object o2, Object o3)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messageo3
- A parameter to be inserted into the messagevoid finest(String msg)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)void finest(String msg, Object[] o)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o
- Objects to be inserted into the messagevoid finest(String msg, Object o1)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messagevoid finest(String msg, Object o1, Object o2)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messagevoid finest(String msg, Object o1, Object o2, Object o3)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)o1
- A parameter to be inserted into the messageo2
- A parameter to be inserted into the messageo3
- A parameter to be inserted into the messageString getName()
Copyright © 2019. All rights reserved.