|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.common.log.Trace org.objectweb.cjdbc.common.log.StaticNoDebugLogger
This is a wrapper where debug logging has been statically disabled. It should improve the performance if one wants to completely disable debug traces.
Field Summary |
Fields inherited from class org.objectweb.cjdbc.common.log.Trace |
|
Constructor Summary | |
StaticNoDebugLogger(org.apache.log4j.Logger log4jLogger)
Creates a new StaticNoDebugLogger object from a given log4j
Logger . |
Method Summary | |
void |
debug(java.lang.Object message)
This method is overriden with an empty body. |
void |
debug(java.lang.Object message,
java.lang.Throwable t)
This method is overriden with an empty body. |
boolean |
isDebugEnabled()
Checks whether this category is enabled for the DEBUG Level .
|
Methods inherited from class org.objectweb.cjdbc.common.log.Trace |
error, error, fatal, fatal, getLogger, info, info, isErrorEnabled, isFatalEnabled, isInfoEnabled, isWarnEnabled, warn, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StaticNoDebugLogger(org.apache.log4j.Logger log4jLogger)
StaticNoDebugLogger
object from a given log4j
Logger
.
log4jLogger
- the log4j Logger
Method Detail |
public void debug(java.lang.Object message, java.lang.Throwable t)
debug
in class Trace
message
- the message object to logt
- the exception to log, including its stack traceTrace.debug(Object, Throwable)
public void debug(java.lang.Object message)
debug
in class Trace
message
- the message object to logTrace.debug(Object)
public boolean isDebugEnabled()
Trace
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.
isDebugEnabled
in class Trace
false
Trace.isDebugEnabled()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |