public class Logger extends Object implements Logger
Logger that adds a set of methods called log that take an instance of Level as
the first argument and delegate to the appropriate method on the SLF4J Logger (info for INFO, etc).
All methods defined by the SLF4J Logger interface delegate directly to the decorated SLF4J
Logger.ROOT_LOGGER_NAME| Constructor and Description |
|---|
Logger(Logger decorated)
Returns a new Logger that decorates the provided SLF4J
Logger. |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(Marker marker,
String msg) |
void |
debug(Marker marker,
String format,
Object... arguments) |
void |
debug(Marker marker,
String format,
Object arg) |
void |
debug(Marker marker,
String format,
Object arg1,
Object arg2) |
void |
debug(Marker marker,
String msg,
Throwable throwable) |
void |
debug(String msg) |
void |
debug(String format,
Object... arguments) |
void |
debug(String format,
Object arg) |
void |
debug(String format,
Object arg1,
Object arg2) |
void |
debug(String msg,
Throwable throwable) |
void |
error(Marker marker,
String msg) |
void |
error(Marker marker,
String format,
Object... arguments) |
void |
error(Marker marker,
String format,
Object arg) |
void |
error(Marker marker,
String format,
Object arg1,
Object arg2) |
void |
error(Marker marker,
String msg,
Throwable throwable) |
void |
error(String msg) |
void |
error(String format,
Object... arguments) |
void |
error(String format,
Object arg) |
void |
error(String format,
Object arg1,
Object arg2) |
void |
error(String msg,
Throwable throwable) |
String |
getName() |
void |
info(Marker marker,
String msg) |
void |
info(Marker marker,
String format,
Object... arguments) |
void |
info(Marker marker,
String format,
Object arg) |
void |
info(Marker marker,
String format,
Object arg1,
Object arg2) |
void |
info(Marker marker,
String msg,
Throwable throwable) |
void |
info(String msg) |
void |
info(String format,
Object... arguments) |
void |
info(String format,
Object arg) |
void |
info(String format,
Object arg1,
Object arg2) |
void |
info(String msg,
Throwable throwable) |
boolean |
isDebugEnabled() |
boolean |
isDebugEnabled(Marker marker) |
boolean |
isEnabled(Level level)
Is the logger instance enabled for a given level?
Delegates to the appropriate method for the level - for instance, if the provided level is
Level.DEBUG, this
method will delegate to Logger.isDebugEnabled() on the decorated logger. |
boolean |
isEnabled(Level level,
Marker marker)
Similar to
isTraceEnabled() method except that the
marker data is also taken into account. |
boolean |
isErrorEnabled() |
boolean |
isErrorEnabled(Marker marker) |
boolean |
isInfoEnabled() |
boolean |
isInfoEnabled(Marker marker) |
boolean |
isTraceEnabled() |
boolean |
isTraceEnabled(Marker marker) |
boolean |
isWarnEnabled() |
boolean |
isWarnEnabled(Marker marker) |
void |
log(Level level,
Marker marker,
String msg)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
Marker marker,
String format,
Object... arguments)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
Marker marker,
String format,
Object arg)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
Marker marker,
String format,
Object arg1,
Object arg2)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
Marker marker,
String msg,
Throwable throwable)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
String msg)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
String format,
Object... arguments)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
String format,
Object arg)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
String format,
Object arg1,
Object arg2)
Delegates to the appropriate logging method for the level.
|
void |
log(Level level,
String msg,
Throwable throwable)
Delegates to the appropriate logging method for the level.
|
void |
trace(Marker marker,
String msg) |
void |
trace(Marker marker,
String format,
Object... arguments) |
void |
trace(Marker marker,
String format,
Object arg) |
void |
trace(Marker marker,
String format,
Object arg1,
Object arg2) |
void |
trace(Marker marker,
String msg,
Throwable throwable) |
void |
trace(String msg) |
void |
trace(String format,
Object... arguments) |
void |
trace(String format,
Object arg) |
void |
trace(String format,
Object arg1,
Object arg2) |
void |
trace(String msg,
Throwable throwable) |
void |
warn(Marker marker,
String msg) |
void |
warn(Marker marker,
String format,
Object... arguments) |
void |
warn(Marker marker,
String format,
Object arg) |
void |
warn(Marker marker,
String format,
Object arg1,
Object arg2) |
void |
warn(Marker marker,
String msg,
Throwable throwable) |
void |
warn(String msg) |
void |
warn(String format,
Object... arguments) |
void |
warn(String format,
Object arg) |
void |
warn(String format,
Object arg1,
Object arg2) |
void |
warn(String msg,
Throwable throwable) |
public Logger(Logger decorated)
Logger.
It is generally more convenient to call LoggerFactory.getLogger(Class) or LoggerFactory.getLogger(String).decorated - the SLF4J Logger to which all logging calls will be delegatedpublic boolean isEnabled(Level level)
Level.DEBUG, this
method will delegate to Logger.isDebugEnabled() on the decorated logger.level - the level that may or may not be enabledpublic void log(Level level, String msg)
Level.DEBUG, this method will delegate to
Logger.debug(String) on the decorated logger.level - the level at which to logmsg - the message string to be loggedpublic void log(Level level, String format, Object arg)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object) on the decorated logger.level - the level at which to logformat - the format stringarg - the argumentpublic void log(Level level, String format, Object arg1, Object arg2)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object, Object) on the decorated logger.level - the level at which to logformat - the format stringarg1 - the first argumentarg2 - the second argumentpublic void log(Level level, String format, Object... arguments)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object...) on the decorated logger.level - the level at which to logformat - the format stringarguments - a list of 3 or more argumentspublic void log(Level level, String msg, Throwable throwable)
Level.DEBUG, this method will delegate to
Logger.debug(String, Throwable) on the decorated logger.level - the level at which to logmsg - the message string to be loggedthrowable - the exception (throwable) to logpublic boolean isEnabled(Level level, Marker marker)
isTraceEnabled() method except that the
marker data is also taken into account.
Delegates to the appropriate method for the level - for instance, if the provided level is Level.DEBUG, this
method will delegate to Logger.isDebugEnabled(Marker) on the decorated logger.level - the level that may or may not be enabledmarker - The marker data to take into considerationpublic void log(Level level, Marker marker, String msg)
Level.DEBUG, this method will delegate to
Logger.debug(Marker, String) on the decorated logger.level - the level at which to logmarker - The marker data to take into considerationmsg - the message string to be loggedpublic void log(Level level, Marker marker, String format, Object arg)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object) on the decorated logger.level - the level at which to logmarker - The marker data to take into considerationformat - the format stringarg - the argumentpublic void log(Level level, Marker marker, String format, Object arg1, Object arg2)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object, Object) on the decorated logger.level - the level at which to logmarker - The marker data to take into considerationformat - the format stringarg1 - the first argumentarg2 - the second argumentpublic void log(Level level, Marker marker, String format, Object... arguments)
Level.DEBUG, this method will delegate to
Logger.debug(String, Object...) on the decorated logger.level - the level at which to logmarker - The marker data to take into considerationformat - the format stringarguments - a list of 3 or more argumentspublic void log(Level level, Marker marker, String msg, Throwable throwable)
Level.DEBUG, this method will delegate to
Logger.debug(String, Throwable) on the decorated logger.level - the level at which to logmarker - The marker data to take into considerationmsg - the message string to be loggedthrowable - the exception (throwable) to logpublic boolean isTraceEnabled()
isTraceEnabled in interface Loggerpublic boolean isTraceEnabled(Marker marker)
isTraceEnabled in interface Loggerpublic boolean isDebugEnabled()
isDebugEnabled in interface Loggerpublic boolean isDebugEnabled(Marker marker)
isDebugEnabled in interface Loggerpublic boolean isInfoEnabled()
isInfoEnabled in interface Loggerpublic boolean isInfoEnabled(Marker marker)
isInfoEnabled in interface Loggerpublic boolean isWarnEnabled()
isWarnEnabled in interface Loggerpublic boolean isWarnEnabled(Marker marker)
isWarnEnabled in interface Loggerpublic boolean isErrorEnabled()
isErrorEnabled in interface Loggerpublic boolean isErrorEnabled(Marker marker)
isErrorEnabled in interface LoggerCopyright © 2013. All Rights Reserved.