|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Abstract logging system interface. Hides actual implementation of hierachal logging system.
Method Summary | |
void |
debug(java.lang.Object msg)
Logs a message at debug priority. |
void |
error(java.lang.Object msg)
Logs a message at error priority. |
void |
error(java.lang.Object msg,
java.lang.Exception exc)
Logs a message at error priority and passes an exception for logging. |
void |
fatal(java.lang.Object msg)
Logs a message at fatal priority. |
void |
info(java.lang.Object msg)
Logs a mesasge at info priority. |
boolean |
isDebugEnabled()
Check whether this category is enabled for the DEBUG
priority. |
void |
warn(java.lang.Object msg)
Logs a message at warn priority. |
Method Detail |
public void fatal(java.lang.Object msg)
msg
- Message to be logged.public void error(java.lang.Object msg)
msg
- Message to be logged.public void error(java.lang.Object msg, java.lang.Exception exc)
msg
- Message to be logged.exc
- Description of Parameterpublic void warn(java.lang.Object msg)
msg
- Message to be logged.public void info(java.lang.Object msg)
msg
- Message to be logged.public void debug(java.lang.Object msg)
msg
- Message to be logged.public boolean isDebugEnabled()
DEBUG
priority.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |