|
|||||||||||
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
This a wrapper to the log4j logging system. We provide additional features to statically remove tracing.
Field Summary | |
private org.apache.log4j.Logger |
log4jLogger
Log4j logger instance. |
Constructor Summary | |
protected |
Trace(org.apache.log4j.Logger log4jLogger)
Creates a new Trace object from a given log4j Logger . |
Method Summary | |
void |
debug(java.lang.Object message)
Logs a message object with the DEBUG Level . |
void |
debug(java.lang.Object message,
java.lang.Throwable error)
Logs a message object with the DEBUG Level
including the stack trace of the Throwable error
passed as parameter. |
void |
error(java.lang.Object message)
Logs a message object with the ERROR Level . |
void |
error(java.lang.Object message,
java.lang.Throwable error)
Logs a message object with the ERROR Level
including the stack trace of the Throwable error
passed as parameter. |
void |
fatal(java.lang.Object message)
Logs a message object with the FATAL Level . |
void |
fatal(java.lang.Object message,
java.lang.Throwable error)
Logs a message object with the FATAL Level
including the stack trace of the Throwable error
passed as parameter. |
static Trace |
getLogger(java.lang.String name)
Retrieves a logger by its name. |
void |
info(java.lang.Object message)
Logs a message object with the INFO Level . |
void |
info(java.lang.Object message,
java.lang.Throwable error)
Logs a message object with the INFO Level
including the stack trace of the Throwable error
passed as parameter. |
boolean |
isDebugEnabled()
Checks whether this category is enabled for the DEBUG Level .
|
boolean |
isErrorEnabled()
Checks whether this category is enabled for the INFO
Level .
|
boolean |
isFatalEnabled()
Checks whether this category is enabled for the INFO
Level .
|
boolean |
isInfoEnabled()
Checks whether this category is enabled for the INFO
Level .
|
boolean |
isWarnEnabled()
Checks whether this category is enabled for the INFO
Level .
|
void |
warn(java.lang.Object message)
Logs a message object with the WARN Level . |
void |
warn(java.lang.Object message,
java.lang.Throwable error)
Logs a message object with the WARN Level
including the stack trace of the Throwable error
passed as parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.apache.log4j.Logger log4jLogger
Constructor Detail |
protected Trace(org.apache.log4j.Logger log4jLogger)
Trace
object from a given log4j Logger
.
log4jLogger
- the log4j Logger
Method Detail |
public static Trace getLogger(java.lang.String name)
name
- logger name
Trace
instancepublic void debug(java.lang.Object message)
DEBUG
Level
.
message
- the message object to logpublic void debug(java.lang.Object message, java.lang.Throwable error)
DEBUG
Level
including the stack trace of the Throwable
error
passed as parameter.
message
- the message object to logerror
- the exception to log, including its stack tracepublic void error(java.lang.Object message)
ERROR
Level
.
message
- the message object to logpublic void error(java.lang.Object message, java.lang.Throwable error)
ERROR
Level
including the stack trace of the Throwable
error
passed as parameter.
message
- the message object to log.error
- the exception to log, including its stack trace.public void fatal(java.lang.Object message)
FATAL
Level
.
message
- the message object to log.public void fatal(java.lang.Object message, java.lang.Throwable error)
FATAL
Level
including the stack trace of the Throwable
error
passed as parameter.
message
- the message object to log.error
- the exception to log, including its stack trace.public void info(java.lang.Object message)
INFO
Level
.
message
- the message object to log.public void info(java.lang.Object message, java.lang.Throwable error)
INFO
Level
including the stack trace of the Throwable
error
passed as parameter.
message
- the message object to log.error
- the exception to log, including its stack trace.public void warn(java.lang.Object message)
WARN
Level
.
message
- the message object to log.public void warn(java.lang.Object message, java.lang.Throwable error)
WARN
Level
including the stack trace of the Throwable
error
passed as parameter.
message
- the message object to log.error
- the exception to log, including its stack trace.public boolean isDebugEnabled()
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.public boolean isInfoEnabled()
INFO
Level
.
See also isDebugEnabled()
.
true
if this category is enabled for Level
INFO
,
false
otherwise.public boolean isWarnEnabled()
INFO
Level
.
See also isDebugEnabled()
.
true
if this category is enabled for INFO
Level
,
false
otherwise.public boolean isErrorEnabled()
INFO
Level
.
See also isDebugEnabled()
.
true
if this category is enabled for INFO
Level
,
false
otherwise.public boolean isFatalEnabled()
INFO
Level
.
See also isDebugEnabled()
.
true
if this category is enabled for INFO
Level
,
false
otherwise.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |