Package org.apache.commons.logging.impl
Class Jdk14Logger
java.lang.Object
org.apache.commons.logging.impl.Jdk14Logger
- All Implemented Interfaces:
Serializable,Log
public class Jdk14Logger extends Object implements Log, Serializable
Implementation of the org.apache.commons.logging.Log
interface that wraps the standard JDK logging mechanisms that were
introduced in the Merlin release (JDK 1.4).
- Version:
- $Revision: 370652 $ $Date: 2006-01-19 22:23:48 +0000 (Thu, 19 Jan 2006) $
- Author:
- Scott Sanders, Berin Loritsch, Peter Donald
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected static LeveldummyLevelThis member variable simply ensures that any attempt to initialise this class in a pre-1.4 JVM will result in an ExceptionInInitializerError.protected LoggerloggerThe underlying Logger implementation we are using.protected StringnameThe name of the logger we are wrapping. -
Constructor Summary
Constructors Constructor Description Jdk14Logger(String name)Construct a named instance of this Logger. -
Method Summary
Modifier and Type Method Description voiddebug(Object message)Logs a message withjava.util.logging.Level.FINE.voiddebug(Object message, Throwable exception)Logs a message withjava.util.logging.Level.FINE.voiderror(Object message)Logs a message withjava.util.logging.Level.SEVERE.voiderror(Object message, Throwable exception)Logs a message withjava.util.logging.Level.SEVERE.voidfatal(Object message)Logs a message withjava.util.logging.Level.SEVERE.voidfatal(Object message, Throwable exception)Logs a message withjava.util.logging.Level.SEVERE.LoggergetLogger()Return the native Logger instance we are using.voidinfo(Object message)Logs a message withjava.util.logging.Level.INFO.voidinfo(Object message, Throwable exception)Logs a message withjava.util.logging.Level.INFO.booleanisDebugEnabled()Is debug logging currently enabled?booleanisErrorEnabled()Is error logging currently enabled?booleanisFatalEnabled()Is fatal logging currently enabled?booleanisInfoEnabled()Is info logging currently enabled?booleanisTraceEnabled()Is trace logging currently enabled?booleanisWarnEnabled()Is warn logging currently enabled?voidtrace(Object message)Logs a message withjava.util.logging.Level.FINEST.voidtrace(Object message, Throwable exception)Logs a message withjava.util.logging.Level.FINEST.voidwarn(Object message)Logs a message withjava.util.logging.Level.WARNING.voidwarn(Object message, Throwable exception)Logs a message withjava.util.logging.Level.WARNING.
-
Field Details
-
dummyLevel
This member variable simply ensures that any attempt to initialise this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. It must not be private, as an optimising compiler could detect that it is not used and optimise it away. -
logger
The underlying Logger implementation we are using. -
name
The name of the logger we are wrapping.
-
-
Constructor Details
-
Jdk14Logger
Construct a named instance of this Logger.- Parameters:
name- Name of the logger to be constructed
-
-
Method Details
-
debug
Logs a message withjava.util.logging.Level.FINE.- Specified by:
debugin interfaceLog- Parameters:
message- to log- See Also:
Log.debug(Object)
-
debug
Logs a message withjava.util.logging.Level.FINE.- Specified by:
debugin interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.debug(Object, Throwable)
-
error
Logs a message withjava.util.logging.Level.SEVERE.- Specified by:
errorin interfaceLog- Parameters:
message- to log- See Also:
Log.error(Object)
-
error
Logs a message withjava.util.logging.Level.SEVERE.- Specified by:
errorin interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.error(Object, Throwable)
-
fatal
Logs a message withjava.util.logging.Level.SEVERE.- Specified by:
fatalin interfaceLog- Parameters:
message- to log- See Also:
Log.fatal(Object)
-
fatal
Logs a message withjava.util.logging.Level.SEVERE.- Specified by:
fatalin interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.fatal(Object, Throwable)
-
getLogger
Return the native Logger instance we are using. -
info
Logs a message withjava.util.logging.Level.INFO.- Specified by:
infoin interfaceLog- Parameters:
message- to log- See Also:
Log.info(Object)
-
info
Logs a message withjava.util.logging.Level.INFO.- Specified by:
infoin interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.info(Object, Throwable)
-
isDebugEnabled
public boolean isDebugEnabled()Is debug logging currently enabled?- Specified by:
isDebugEnabledin interfaceLog- Returns:
- true if debug is enabled in the underlying logger.
-
isErrorEnabled
public boolean isErrorEnabled()Is error logging currently enabled?- Specified by:
isErrorEnabledin interfaceLog- Returns:
- true if error is enabled in the underlying logger.
-
isFatalEnabled
public boolean isFatalEnabled()Is fatal logging currently enabled?- Specified by:
isFatalEnabledin interfaceLog- Returns:
- true if fatal is enabled in the underlying logger.
-
isInfoEnabled
public boolean isInfoEnabled()Is info logging currently enabled?- Specified by:
isInfoEnabledin interfaceLog- Returns:
- true if info is enabled in the underlying logger.
-
isTraceEnabled
public boolean isTraceEnabled()Is trace logging currently enabled?- Specified by:
isTraceEnabledin interfaceLog- Returns:
- true if trace is enabled in the underlying logger.
-
isWarnEnabled
public boolean isWarnEnabled()Is warn logging currently enabled?- Specified by:
isWarnEnabledin interfaceLog- Returns:
- true if warn is enabled in the underlying logger.
-
trace
Logs a message withjava.util.logging.Level.FINEST.- Specified by:
tracein interfaceLog- Parameters:
message- to log- See Also:
Log.trace(Object)
-
trace
Logs a message withjava.util.logging.Level.FINEST.- Specified by:
tracein interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.trace(Object, Throwable)
-
warn
Logs a message withjava.util.logging.Level.WARNING.- Specified by:
warnin interfaceLog- Parameters:
message- to log- See Also:
Log.warn(Object)
-
warn
Logs a message withjava.util.logging.Level.WARNING.- Specified by:
warnin interfaceLog- Parameters:
message- to logexception- log this cause- See Also:
Log.warn(Object, Throwable)
-