|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.log.CommonsLoggerImpl
public class CommonsLoggerImpl
Wrapping around a commons logger allowing to use internationalization and MessageFormat API.
Field Summary | |
---|---|
private I18n |
i18n
Instance of I18n. |
private static long |
serialVersionUID
Id for serializable class. |
private org.apache.commons.logging.Log |
wrapped
Wrapped commons logging logger. |
Constructor Summary | |
---|---|
CommonsLoggerImpl(org.apache.commons.logging.Log wrapped,
I18n i18n)
Build a new logger with the wrapped logger. |
Method Summary | |
---|---|
void |
debug(java.lang.Object message,
java.lang.Object... args)
Log a message with debug log level. |
void |
error(java.lang.Object message,
java.lang.Object... args)
Log a message with error log level. |
void |
fatal(java.lang.Object message,
java.lang.Object... args)
Log a message with fatal log level. |
I18n |
getI18n()
Gets the i18n object associated to this logger. |
private java.lang.String |
getMessage(java.lang.Object message,
java.lang.Object... args)
Gets a string message build with the given args. * |
private java.lang.Throwable |
getThrowable(java.lang.Object... args)
Try to find a Throwable object in the array of object args. |
void |
info(java.lang.Object message,
java.lang.Object... args)
Log a message 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.Object... args)
Log a message with trace log level. |
void |
warn(java.lang.Object message,
java.lang.Object... args)
Log a message with warn log level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private org.apache.commons.logging.Log wrapped
private I18n i18n
Constructor Detail |
---|
public CommonsLoggerImpl(org.apache.commons.logging.Log wrapped, I18n i18n)
wrapped
- the delegate logger.i18n
- the internationalization object to use, if any.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.
isDebugEnabled
in interface JLog
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.
isErrorEnabled
in interface JLog
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.
isFatalEnabled
in interface JLog
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.
isInfoEnabled
in interface JLog
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.
isTraceEnabled
in interface JLog
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.
isWarnEnabled
in interface JLog
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.Object... args)
Log a message with trace log level.
trace
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public void debug(java.lang.Object message, java.lang.Object... args)
Log a message with debug log level.
debug
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public void info(java.lang.Object message, java.lang.Object... args)
Log a message with info log level.
info
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public void warn(java.lang.Object message, java.lang.Object... args)
Log a message with warn log level.
warn
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public void error(java.lang.Object message, java.lang.Object... args)
Log a message with error log level.
error
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public void fatal(java.lang.Object message, java.lang.Object... args)
Log a message with fatal log level.
fatal
in interface JLog
message
- - This could be
args
- could be empty or contains the object for the formatter (I18n
case). To log an exception, the exception must be the last
argument.public I18n getI18n()
getI18n
in interface JLog
private java.lang.String getMessage(java.lang.Object message, java.lang.Object... args)
message
- If the message is an i18n entry, this entry will be used
to format the message.args
- given args use by the formatter
private java.lang.Throwable getThrowable(java.lang.Object... args)
args
- array of objects on which we need to find the Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |