|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A simple logging interface abstracting logging APIs. In order to be
instantiated successfully by LogFactory
, classes that implement
this interface must have a constructor that takes a single String
parameter representing the "name" of this Log.
The six logging levels used by Log
are (in order):
Performance is often a logging concern. By examining the appropriate property, a component can avoid expensive operations (producing information to be logged).
For example,
if (log.isDebugEnabled()) {
... do something expensive ...
log.debug(theResult);
}
Configuration of the underlying logging system will generally be done external to the Logging APIs, through whatever mechanism is supported by that system.
Method Summary | |
void |
debug(java.lang.Object message)
Log a message with debug log level. |
void |
debug(java.lang.Object message,
java.lang.Throwable t)
Log an error with debug log level. |
void |
error(java.lang.Object message)
Log a message with error log level. |
void |
error(java.lang.Object message,
java.lang.Throwable t)
Log an error with error log level. |
void |
fatal(java.lang.Object message)
Log a message with fatal log level. |
void |
fatal(java.lang.Object message,
java.lang.Throwable t)
Log an error with fatal log level. |
void |
info(java.lang.Object message)
Log a message with info log level. |
void |
info(java.lang.Object message,
java.lang.Throwable t)
Log an error with info log level. |
boolean |
isDebugEnabled()
Is debug logging currently enabled? |
boolean |
isErrorEnabled()
Is error logging currently enabled? |
boolean |
isFatalEnabled()
Is fatal logging currently enabled? |
boolean |
isInfoEnabled()
Is info logging currently enabled? |
boolean |
isTraceEnabled()
Is trace logging currently enabled? |
boolean |
isWarnEnabled()
Is warn logging currently enabled? |
void |
trace(java.lang.Object message)
Log a message with trace log level. |
void |
trace(java.lang.Object message,
java.lang.Throwable t)
Log an error with trace log level. |
void |
warn(java.lang.Object message)
Log a message with warn log level. |
void |
warn(java.lang.Object message,
java.lang.Throwable t)
Log an error with warn log level. |
Method Detail |
public boolean isDebugEnabled()
Is debug logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than debug.
public boolean isErrorEnabled()
Is error logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than error.
public boolean isFatalEnabled()
Is fatal logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than fatal.
public boolean isInfoEnabled()
Is info logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than info.
public boolean isTraceEnabled()
Is trace logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than trace.
public boolean isWarnEnabled()
Is warn logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String
concatenation)
when the log level is more than warn.
public void trace(java.lang.Object message)
Log a message with trace log level.
message
- log this messagepublic void trace(java.lang.Object message, java.lang.Throwable t)
Log an error with trace log level.
message
- log this messaget
- log this causepublic void debug(java.lang.Object message)
Log a message with debug log level.
message
- log this messagepublic void debug(java.lang.Object message, java.lang.Throwable t)
Log an error with debug log level.
message
- log this messaget
- log this causepublic void info(java.lang.Object message)
Log a message with info log level.
message
- log this messagepublic void info(java.lang.Object message, java.lang.Throwable t)
Log an error with info log level.
message
- log this messaget
- log this causepublic void warn(java.lang.Object message)
Log a message with warn log level.
message
- log this messagepublic void warn(java.lang.Object message, java.lang.Throwable t)
Log an error with warn log level.
message
- log this messaget
- log this causepublic void error(java.lang.Object message)
Log a message with error log level.
message
- log this messagepublic void error(java.lang.Object message, java.lang.Throwable t)
Log an error with error log level.
message
- log this messaget
- log this causepublic void fatal(java.lang.Object message)
Log a message with fatal log level.
message
- log this messagepublic void fatal(java.lang.Object message, java.lang.Throwable t)
Log an error with fatal log level.
message
- log this messaget
- log this cause
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |