|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is the main logging interface.
It defines a set of convenience methods for logging at a specific
LogLevel, for method entries and exits (either regular or by
throwing an exception), as well as for caught exceptions.
Furthermore, usage at a specific log level may be checked at runtime
by means of isEnabled(LogLevel).
Instances are available via LoggerFactory.getLogger() and
LoggerFactory.getLogger(String).
| Method Summary | |
void |
caught(LogLevel level,
String msg,
Throwable thrown)
This method implicitely calls log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
caught(Throwable). |
void |
caught(Throwable thrown)
This method is supposed to be used for logging the catching of a Throwable (and subclasses). |
void |
debug(String msg)
Creates a log entry on LogLevel.DEBUG. |
void |
entering()
This method is supposed to be used for logging the entry of a parameterless method. |
void |
entering(Object[] params)
This method is supposed to be used for logging the entry of a method with a set of parameters. |
void |
error(String msg)
Creates a log entry on LogLevel.ERROR. |
void |
exiting()
This method is supposed to be used for logging the exit of a method without return value. |
void |
exiting(Object result)
This method is supposed to be used for logging the exit of a method with a return value. |
void |
fatal(String msg)
Creates a log entry on LogLevel.FATAL. |
void |
info(String msg)
Creates a log entry on LogLevel.INFO. |
boolean |
isEnabled(LogLevel level)
Find out if logging would be performed at the given log level. |
void |
log(LogLevel level,
String msg)
This is the generic log method to be used for creating a log entry on the specified log level. |
void |
severe(String msg)
Creates a log entry on LogLevel.SEVERE. |
void |
throwing(LogLevel level,
String msg,
Throwable thrown)
This method implicitely calls log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
throwing(Throwable). |
void |
throwing(Throwable thrown)
This method is supposed to be used for logging the creation and method exit by a Throwable (and subclasses). |
void |
trace(String msg)
Creates a log entry on LogLevel.TRACE. |
void |
warning(String msg)
Creates a log entry on LogLevel.WARNING. |
| Method Detail |
public void log(LogLevel level,
String msg)
level - The log level to be used for creating the log entrymsg - The message to be written into the log entrypublic void trace(String msg)
LogLevel.TRACE.
msg - The message to be written into the log entrypublic void debug(String msg)
LogLevel.DEBUG.
msg - The message to be written into the log entrypublic void info(String msg)
LogLevel.INFO.
msg - The message to be written into the log entrypublic void warning(String msg)
LogLevel.WARNING.
msg - The message to be written into the log entrypublic void error(String msg)
LogLevel.ERROR.
msg - The message to be written into the log entrypublic void severe(String msg)
LogLevel.SEVERE.
msg - The message to be written into the log entrypublic void fatal(String msg)
LogLevel.FATAL.
msg - The message to be written into the log entrypublic void entering()
LogLevel.TRACE.
public void entering(Object[] params)
LogLevel.TRACE.
params - The method parameters, for printing the
toString() method will be called on each objectpublic void exiting()
LogLevel.TRACE.
public void exiting(Object result)
LogLevel.TRACE.
result - The return value, for printing the
toString() method will be calledpublic void throwing(Throwable thrown)
Throwable (and subclasses). Hereby, the used
log level will be LogLevel.TRACE.
thrown - The exception that will be thrown
public void throwing(LogLevel level,
String msg,
Throwable thrown)
log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
throwing(Throwable).
level - The log level to be used for creating the log entrymsg - The message to be written into the log entrythrown - The exception that will be thrownpublic void caught(Throwable thrown)
Throwable (and subclasses). Hereby, the used
log level will be LogLevel.TRACE.
thrown - The exception that has been caught
public void caught(LogLevel level,
String msg,
Throwable thrown)
log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
caught(Throwable).
level - The log level to be used for creating the log entrymsg - The message to be written into the log entrythrown - The exception that has been caughtpublic boolean isEnabled(LogLevel level)
This method might be useful in cases of costly log message creation which should be performed only if really needed.
level - The log level to check for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||