| java.lang.Object org.continuent.sequoia.common.log.Trace
All known Subclasses: org.continuent.sequoia.common.log.StaticDisabledLogger, org.continuent.sequoia.common.log.StaticNoDebugLogger,
Trace | public class Trace (Code) | | This a wrapper to the log4j logging system. We provide additional features to
statically remove tracing.
author: Emmanuel Cecchet version: 1.0 |
Constructor Summary | |
protected | Trace(Logger log4jLogger) Creates a new Trace object from a given log4j
Logger . |
Method Summary | |
public void | debug(Object message) Logs a message object with the DEBUG Level . | public void | debug(Object message, Throwable error) Logs a message object with the DEBUG Level
including the stack trace of the
Throwable error
passed as parameter. | public void | error(Object message) Logs a message object with the ERROR Level . | public void | error(Object message, Throwable error) Logs a message object with the ERROR Level
including the stack trace of the
Throwable error
passed as parameter. | public void | fatal(Object message) Logs a message object with the FATAL Level . | public void | fatal(Object message, Throwable error) Logs a message object with the FATAL Level
including the stack trace of the
Throwable error
passed as parameter. | public static Trace | getLogger(String name) Retrieves a logger by its name. | public void | info(Object message) Logs a message object with the INFO Level . | public void | info(Object message, Throwable error) Logs a message object with the INFO Level
including the stack trace of the
Throwable error
passed as parameter. | public boolean | isDebugEnabled() Checks whether this category is enabled for the
DEBUG Level .
This function is intended to lessen the computational cost of disabled log
debug statements.
For some cat Category object, when you write,
cat.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(cat.isDebugEnabled()) { cat.debug("This is entry number: " + i ); }
This way you will not incur the cost of parameter construction if debugging
is disabled for cat . | public boolean | isErrorEnabled() Checks whether this category is enabled for the ERROR
Level . | public boolean | isFatalEnabled() Checks whether this category is enabled for the FATAL
Level . | public boolean | isInfoEnabled() Checks whether this category is enabled for the INFO
Level . | public boolean | isWarnEnabled() Checks whether this category is enabled for the WARN
Level . | public void | warn(Object message) Logs a message object with the WARN Level . | public void | warn(Object message, Throwable error) Logs a message object with the WARN Level
including the stack trace of the
Throwable error
passed as parameter. |
Trace | protected Trace(Logger log4jLogger)(Code) | | Creates a new Trace object from a given log4j
Logger .
Parameters: log4jLogger - the log4j Logger |
debug | public void debug(Object message)(Code) | | Logs a message object with the DEBUG Level .
Parameters: message - the message object to log |
debug | public void debug(Object message, Throwable error)(Code) | | Logs a message object with the DEBUG Level
including the stack trace of the
Throwable error
passed as parameter.
Parameters: message - the message object to log Parameters: error - the exception to log, including its stack trace |
error | public void error(Object message)(Code) | | Logs a message object with the ERROR Level .
Parameters: message - the message object to log |
error | public void error(Object message, Throwable error)(Code) | | Logs a message object with the ERROR Level
including the stack trace of the
Throwable error
passed as parameter.
Parameters: message - the message object to log. Parameters: error - the exception to log, including its stack trace. |
fatal | public void fatal(Object message)(Code) | | Logs a message object with the FATAL Level .
Parameters: message - the message object to log. |
fatal | public void fatal(Object message, Throwable error)(Code) | | Logs a message object with the FATAL Level
including the stack trace of the
Throwable error
passed as parameter.
Parameters: message - the message object to log. Parameters: error - the exception to log, including its stack trace. |
getLogger | public static Trace getLogger(String name)(Code) | | Retrieves a logger by its name.
Parameters: name - logger name trace a Trace instance |
info | public void info(Object message)(Code) | | Logs a message object with the INFO Level .
Parameters: message - the message object to log. |
info | public void info(Object message, Throwable error)(Code) | | Logs a message object with the INFO Level
including the stack trace of the
Throwable error
passed as parameter.
Parameters: message - the message object to log. Parameters: error - the exception to log, including its stack trace. |
isDebugEnabled | public boolean isDebugEnabled()(Code) | | Checks whether this category is enabled for the
DEBUG Level .
This function is intended to lessen the computational cost of disabled log
debug statements.
For some cat Category object, when you write,
cat.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(cat.isDebugEnabled()) { cat.debug("This is entry number: " + i ); }
This way you will not incur the cost of parameter construction if debugging
is disabled for cat . On the other hand, if the
cat is debug enabled, you will incur the cost of evaluating
whether the category is debug enabled twice. Once in
isDebugEnabled and once in the debug . This
is an insignificant overhead since evaluating a category takes about 1%% of
the time it takes to actually log.
true if this category is debug enabled,false otherwise. |
isErrorEnabled | public boolean isErrorEnabled()(Code) | | Checks whether this category is enabled for the ERROR
Level .
true if this category is enabled forERROR Level , false otherwise. See Also: Trace.isDebugEnabled() |
isFatalEnabled | public boolean isFatalEnabled()(Code) | | Checks whether this category is enabled for the FATAL
Level .
true if this category is enabled forFATAL Level , false otherwise. See Also: Trace.isDebugEnabled() |
isInfoEnabled | public boolean isInfoEnabled()(Code) | | Checks whether this category is enabled for the INFO
Level .
true if this category is enabled forLevel INFO , false otherwise. See Also: Trace.isDebugEnabled() |
isWarnEnabled | public boolean isWarnEnabled()(Code) | | Checks whether this category is enabled for the WARN
Level .
true if this category is enabled forWARN Level , false otherwise. See Also: Trace.isDebugEnabled() |
warn | public void warn(Object message)(Code) | | Logs a message object with the WARN Level .
Parameters: message - the message object to log. |
warn | public void warn(Object message, Throwable error)(Code) | | Logs a message object with the WARN Level
including the stack trace of the
Throwable error
passed as parameter.
Parameters: message - the message object to log. Parameters: error - the exception to log, including its stack trace. |
|
|