|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.logging.AbstractLogger
public abstract class AbstractLogger
This class provides a default implementation of the com.sun.jdo.spi.persistence.utility.logging.Logger interface which implements most methods and/or delegates them to a few abstract methods which subclasses must override.
| Field Summary |
|---|
| Fields inherited from interface com.sun.jdo.spi.persistence.utility.logging.Logger |
|---|
ALL, CONFIG, FINE, FINER, FINEST, INFO, OFF, SEVERE, WARNING |
| Constructor Summary | |
|---|---|
AbstractLogger(String loggerName,
String bundleName,
ClassLoader loader)
Creates a new AbstractLogger. |
|
| Method Summary | |
|---|---|
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. |
protected ResourceBundle |
getBundle()
Get the message bundle for the named instance of the logger. |
int |
getLevel()
|
protected String |
getMessage(String message)
This method returns a string from the bundle file if possible, treating the message argument as the key. |
protected static ResourceBundle |
getMessages()
Get the message bundle for the AbstractLogger itself. |
protected String |
getMessageWithPrefix(int level,
String message)
This method returns a string with a formatted prefix which depends on the level. |
String |
getName()
Get the name for this logger. |
void |
info(String msg)
Log an INFO message. |
boolean |
isLoggable()
Return whether logging is enabled at the FINE level. |
boolean |
isLoggable(int levelValue)
Check if a message of the given level would actually be logged by this logger. |
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. |
abstract void |
log(int level,
String msg,
Throwable thrown)
Log a message. |
protected abstract void |
logInternal(int level,
String message)
This method does the actual logging. |
void |
severe(String msg)
Log a SEVERE message. |
void |
throwing(String sourceClass,
String sourceMethod,
Throwable thrown)
Log throwing an exception. |
String |
toString()
Prepare a printable version of this instance. |
static String |
toString(int level)
Return the string name of a level given its int value. |
void |
warning(String msg)
Log a WARNING message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractLogger(String loggerName,
String bundleName,
ClassLoader loader)
loggerName - the full domain name of this loggerbundleName - the bundle name for message translationloader - the loader used for looking up the bundle file
and possibly the logging.properties or alternative file| Method Detail |
|---|
protected static ResourceBundle getMessages()
public static String toString(int level)
protected ResourceBundle getBundle()
public int getLevel()
public boolean isLoggable()
isLoggable in interface Loggerpublic boolean isLoggable(int levelValue)
isLoggable in interface LoggerlevelValue - the level to check
public void 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.
entering in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of method that is being entered
public void 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.
entering in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of method that is being enteredparam1 - parameter to the method being entered
public void 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.
entering in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of method that is being enteredparams - array of parameters to the method being entered
public void 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.
exiting in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of the method
public void 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.
exiting in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of the methodresult - Object that is being returned
public void 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.
throwing in interface LoggersourceClass - name of class that issued the logging requestsourceMethod - name of the method.thrown - The Throwable that is being thrown.public 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.
severe in interface Loggermsg - The string message (or a key in the message catalog)public 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.
warning in interface Loggermsg - The string message (or a key in the message catalog)public 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.
info in interface Loggermsg - The string message (or a key in the message catalog)public 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.
config in interface Loggermsg - The string message (or a key in the message catalog)
public 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.
log in interface Loggerlevel - The level for this messagemsg - The string message (or a key in the message catalog)
public 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.
log in interface Loggerlevel - The level for this messagemsg - The string message (or a key in the message catalog)o1 - A parameter to be inserted into the message
public void 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.
log in interface Loggerlevel - The level for this messagemsg - The string message (or a key in the message catalog)o - Objects to be inserted into the message
public void 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.
log in interface Loggerlevel - 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 message
public void 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.
log in interface Loggerlevel - 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 message
public abstract void 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.
log in interface Loggerlevel - The level for this messagemsg - The string message (or a key in the message catalog)thrown - The exception to logpublic void 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.
fine in interface Loggermsg - The string message (or a key in the message catalog)
public 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.
fine in interface Loggermsg - The string message (or a key in the message catalog)o1 - A parameter to be inserted into the message
public void 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.
fine in interface Loggermsg - The string message (or a key in the message catalog)o - Objects to be inserted into the message
public void 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.
fine in interface Loggermsg - 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 message
public void 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.
fine in interface Loggermsg - 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 messagepublic void 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.
finer in interface Loggermsg - The string message (or a key in the message catalog)
public 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.
finer in interface Loggermsg - The string message (or a key in the message catalog)o - Objects to be inserted into the message
public void 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.
finer in interface Loggermsg - The string message (or a key in the message catalog)o1 - A parameter to be inserted into the message
public void 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.
finer in interface Loggermsg - 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 message
public void 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.
finer in interface Loggermsg - 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 messagepublic void 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.
finest in interface Loggermsg - The string message (or a key in the message catalog)
public 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.
finest in interface Loggermsg - The string message (or a key in the message catalog)o - Objects to be inserted into the message
public void 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.
finest in interface Loggermsg - The string message (or a key in the message catalog)o1 - A parameter to be inserted into the message
public void 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.
finest in interface Loggermsg - 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 message
public void 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.
finest in interface Loggermsg - 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 messagepublic String getName()
getName in interface Loggerpublic String toString()
toString in class Objectprotected String getMessage(String message)
message - the message which is used as a key to search the bundle
protected String getMessageWithPrefix(int level,
String message)
level - the level to printmessage - the message to print
toString(int)
protected abstract void logInternal(int level,
String message)
level - the level to printmessage - the message to print
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||