| Constructor and Description |
|---|
LoggerWrapper(Logger logger)
Creates an instance that delegates to the given
Logger. |
| Modifier and Type | Method and Description |
|---|---|
Logger |
getLogger()
Returns the wrapped
Logger. |
boolean |
isLoggable(Level level)
Returns the result of invoking
isLoggable on
the wrapped Logger. |
void |
log(Level level,
String message)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
void |
log(Level level,
String message,
Object... params)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
void |
log(Level level,
String message,
Object param)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
void |
log(Level level,
String message,
Throwable param)
Deprecated.
|
void |
log(Level level,
String message,
Throwable param,
Object... otherParams)
Deprecated.
|
void |
logThrow(Level level,
Throwable thrown,
String message)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
void |
logThrow(Level level,
Throwable thrown,
String message,
Object... params)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
void |
logThrow(Level level,
Throwable thrown,
String message,
Object param)
If calling
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. |
public LoggerWrapper(Logger logger)
Logger.logger - the Logger to wrappublic Logger getLogger()
Logger.Loggerpublic boolean isLoggable(Level level)
isLoggable on
the wrapped Logger.level - the level at which to check if logging is enabledisLoggable on the wrapped
Loggerpublic void log(Level level, String message)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The source class name
and source method name of the
LogRecord are set to the class and method names of the
caller of this method, if they can be determined. Any exceptions or
errors thrown by the underlying log call are swallowed.level - the level at which to logmessage - the log message, which can be nullpublic void log(Level level, String message, Object param)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The given param value is set as the sole
parameter of the
LogRecord. The source class name and source
method name of the LogRecord are set to the class and
method names of the caller of this method, if they can be determined.
Any exceptions or errors thrown by the underlying log call
are swallowed.level - the level at which to logmessage - the log message, which can be nullparam - the parameter value for the log message, which can be
nullpublic void log(Level level, String message, Object... params)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The given params values are set as the parameters of the LogRecord. The
source class name and
source method name of the
LogRecord are set to the class and method names of the
caller of this method, if they can be determined. Any exceptions or
errors thrown by the underlying log call are swallowed.level - the level at which to logmessage - the log message, which can be nullparams - the parameter values for the log message, which can be
nullpublic void logThrow(Level level, Throwable thrown, String message)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The thrown value is set as the
Throwable value associated
with the LogRecord. The source class name and source method name of the
LogRecord are set to the class and method names of the
caller of this method, if they can be determined. Any exceptions or
errors thrown by the underlying log call are swallowed.level - the level at which to logthrown - the Throwable associated with the log
messagemessage - the log message, which can be nullpublic void logThrow(Level level, Throwable thrown, String message, Object param)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The thrown value is set as the
Throwable value associated
with the LogRecord. The given param value is
set as the sole parameter of the
LogRecord. The source class name and source
method name of the LogRecord are set to the class and
method names of the caller of this method, if they can be determined.
Any exceptions or errors thrown by the underlying log call
are swallowed.level - the level at which to logthrown - the Throwable associated with the log
messagemessage - the log message, which can be nullparam - the parameter value for the log message, which can be
nullpublic void logThrow(Level level, Throwable thrown, String message, Object... params)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The thrown value is set as the
Throwable value associated
with the LogRecord. The given params values
are set as the parameters of the
LogRecord. The source class name and source
method name of the LogRecord are set to the class and
method names of the caller of this method, if they can be determined.
Any exceptions or errors thrown by the underlying log call
are swallowed.level - the level at which to logthrown - the Throwable associated with the log
messagemessage - the log message, which can be nullparams - the parameter values for the log message, which can be
null@Deprecated public void log(Level level, String message, Throwable param)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The given param value is set as the sole
parameter of the
LogRecord. The source class name and source
method name of the LogRecord are set to the class and
method names of the caller of this method, if they can be determined.
Any exceptions or errors thrown by the underlying log call
are swallowed.
This method is deprecated to flag any possible confusion of this method
with the logThrow method.
If the caller intends to include a Throwable as a parameter
value in the log method, rather than including its stack trace by
calling logThrow, it can cast the parameter to type
Object to avoid the deprecation warning.
level - the level at which to logmessage - the log message, which can be nullparam - the parameter value for the log message, which can be
null@Deprecated public void log(Level level, String message, Throwable param, Object... otherParams)
isLoggable with the given
level value on the wrapped Logger returns
true, invokes the log method
of the wrapped Logger, passing a LogRecord
constructed with the given level and message
values. The given param and otherParams
values are set as the parameters of
the LogRecord. The source class name and source method name of the
LogRecord are set to the class and method names of the
caller of this method, if they can be determined. Any exceptions or
errors thrown by the underlying log call are swallowed.
This method is deprecated to flag any possible confusion of this method
with the logThrow
method. If the caller intends to include a Throwable as a
parameter value in the log method, rather than including its stack trace
by calling logThrow, it can cast the first parameter to
type Object to avoid the deprecation warning.
level - the level at which to logmessage - the log message, which can be nullparam - the parameter value for the log message, which can be
nullotherParams - additional parameter values for the log message,
which can be nullCopyright © 2007-2013. All Rights Reserved.