|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.sharedutil.LoggerWrapper
public class LoggerWrapper
Wrapper around a Logger that provides convenience methods for
logging exceptions and messages with multiple arguments, and that insulates
the caller from unchecked exceptions thrown during the act of logging.
| Constructor Summary | |
|---|---|
LoggerWrapper(Logger logger)
Creates an instance that delegates to the given Logger. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoggerWrapper(Logger logger)
Logger.
logger - the Logger to wrap| Method Detail |
|---|
public Logger getLogger()
Logger.
Loggerpublic boolean isLoggable(Level level)
isLoggable on
the wrapped Logger.
level - the level at which to check if logging is enabled
isLoggable on the wrapped
Logger
public 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 null
public 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
null
public 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
null
public 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 null
public 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
null
public 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 null
|
Project Darkstar, Version 0.9.9.5 2013-07-29 20:53:43 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||