|
|||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Redwood Logging Interface.
Method Summary | |
void |
debug(String message)
Log a message object with the DEBUG level to the server
logs. |
void |
debug(String message,
Throwable t)
Log a message object, along with the associated exception, with the DEBUG level to the server logs. |
void |
error(String message)
Log a message object with the ERROR level to the server
logs. |
void |
error(String message,
Throwable t)
Log a message object, along with the associated exception, with the ERROR level to the server logs. |
void |
fatal(String message)
Log a message object with the FATAL level to the server
logs. |
void |
fatal(String message,
Throwable t)
Log a message object, along with the associated exception, with the FATAL level to the server logs. |
void |
info(String message)
Log a message object with the INFO level to the server
logs. |
void |
info(String message,
Throwable t)
Log a message object, along with the associated exception, with the INFO level to the server logs. |
boolean |
isDebugEnabled()
Check whether this logger is enabled for the DEBUG
Level. |
boolean |
isEnabledFor(Level level)
Check whether this logger is enabled for a given Level passed as
parameter. |
boolean |
isInfoEnabled()
Check whether this logger is enabled for the INFO Level. |
void |
log(Level level,
String message)
Log a message at a particular level. |
void |
log(Level level,
String message,
Throwable t)
Log a message at a particular level. |
void |
warn(String message)
Log a message object with the WARN level to the server
logs. |
void |
warn(String message,
Throwable t)
Log a message object, along with the associated exception, with the WARN level to the server logs. |
Field Detail |
public static final String COPYRIGHT_MESSAGE_LOGGER
public static final String ID_LOGGER
Method Detail |
public void debug(String message)
DEBUG
level to the server
logs.
This method first checks if this Logger is DEBUG
enabled by comparing the level of this Logger with the
DEBUG
level. If this Logger is
DEBUG
enabled, then it logs the message.
message
- the message to log.public void debug(String message, Throwable t)
DEBUG
level to the server logs.
message
- the message to log.t
- an optional exception to log with the message.debug(String)
public void info(String message)
INFO
level to the server
logs.
This method first checks if this Logger is INFO
enabled
by comparing the level of this Logger with the INFO
level. If this Logger is INFO
enabled, then it logs the
message.
message
- the message to log.public void info(String message, Throwable t)
INFO
level to the server logs.
message
- the message to log.t
- an optional exception to log with the message.info(String)
public void warn(String message)
WARN
level to the server
logs.
This method first checks if this Logger is WARN
enabled
by comparing the level of this Logger with the WARN
level. If this Logger is WARN
enabled, then it logs the
message.
message
- the message to log.public void warn(String message, Throwable t)
WARN
level to the server logs.
message
- the message to log.t
- an optional exception to log with the message.warn(String)
public void error(String message)
ERROR
level to the server
logs.
This method first checks if this Logger is ERROR
enabled by comparing the level of this Logger with the
ERROR
level. If this Logger is
ERROR
enabled, then it logs the message.
message
- the message to log.public void error(String message, Throwable t)
ERROR
level to the server logs.
message
- the message to log.t
- an optional exception to log with the message.error(String)
public void fatal(String message)
FATAL
level to the server
logs.
This method first checks if this Logger is FATAL
enabled by comparing the level of this Logger with the
FATAL
level. If this Logger is
FATAL
enabled, then it logs the message.
message
- the message to log.public void fatal(String message, Throwable t)
FATAL
level to the server logs.
message
- the message to log.t
- an optional exception to log with the message.fatal(String)
public boolean isDebugEnabled()
DEBUG
Level.
This function is intended to lessen the computational cost of disabled log debug statements.
For some log
LoggeLogger object, when you write,
log.debug("This is entry number: " + i);
You incur the cost constructing the message, concatenatiion in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should write
if (log.isDebugEnabled()) { log.debug("This is entry number: " + i); }
This way you will not incur the cost of parameter construction if debugging
is disabled for log
. On the other hand, if the
log
is debug enabled, you will incur the cost of evaluating
whether the Logger is debug enabled twice. Once in
isDebugEnabled
and once in the debug
. This
is an insignificant overhead since evaluating a Logger takes about 1%% of
the time it takes to actually log.
true
if this Logger is debug enabled,
false
otherwise.public boolean isInfoEnabled()
INFO
Level.
This function is intended to lessen the computational cost of disabled log debug statements.
For some log
LoggeLogger object, when you write,
log.debug("This is entry number: " + i);
You incur the cost constructing the message, concatenatiion in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should write
if (log.isInfoEnabled()) { log.debug("This is entry number: " + i); }
This way you will not incur the cost of parameter construction if debugging
is disabled for log
. On the other hand, if the
log
is debug enabled, you will incur the cost of evaluating
whether the Logger is debug enabled twice. Once in
isInfoEnabled
and once in the debug
. This is
an insignificant overhead since evaluating a Logger takes about 1%% of the
time it takes to actually log.
true
if this Logger is debug enabled,
false
otherwise.public boolean isEnabledFor(Level level)
Level
passed as
parameter.
See also isDebugEnabled()
.
level
- the log level to check for.
level
.public void log(Level level, String message)
level
- the level to log at.message
- the message to log.public void log(Level level, String message, Throwable t)
level
- the level to log at.message
- the message to log.t
- an optional exception to log with the message.
|