|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.log.JDKLogger
public class JDKLogger
Logger with I18n and infinite arguments.
Field Summary | |
---|---|
private static boolean |
handlerSet
Handler already set. |
private I18n |
i18n
I18n object. |
private java.util.logging.Logger |
logger
Logger object (transient). |
private java.lang.String |
name
Name of this logger. |
private static long |
serialVersionUID
Id for serializable class. |
static java.lang.String |
SET_HANDLER
Property to disable the set of our own handler. |
Constructor Summary | |
---|---|
JDKLogger(java.lang.Class clazz,
I18n i18n)
Creates a new 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. |
java.util.logging.Logger |
getLogger()
|
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? |
private void |
log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable t)
Log the given message with the given throwable (if any). |
private void |
replaceConsoleHandlerInParentHandlers(java.util.logging.Logger logger)
Replace the console handler by our handler. |
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 java.lang.String name
private transient java.util.logging.Logger logger
private I18n i18n
private static boolean handlerSet
public static final java.lang.String SET_HANDLER
Constructor Detail |
---|
public JDKLogger(java.lang.Class clazz, I18n i18n)
clazz
- the class that requires a logger.i18n
- the internationalization object to use, if any.Method Detail |
---|
private void log(java.util.logging.Level level, java.lang.String msg, java.lang.Throwable t)
level
- the level of the message (to log)msg
- the content of the messaget
- the throwable (if any)private void replaceConsoleHandlerInParentHandlers(java.util.logging.Logger logger)
logger
- the given logger to analyze.public java.util.logging.Logger getLogger()
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 I18n getI18n()
getI18n
in interface JLog
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 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 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 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 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.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 |