Class Jdk14Logger
java.lang.Object
org.apache.avalon.framework.logger.Jdk14Logger
- All Implemented Interfaces:
org.apache.avalon.framework.logger.Logger
The default JDK 1.4 wrapper class for Logger. Please note that there is
not an exact match to the priority levels that JDK 1.4 logging has and
what LogKit or Log4J has. For that reason, the following priority level
matching was used:
- SEVERE = error, fatalError
- WARNING = warn
- INFO = info
- FINE = debug
JDK 1.4 does allow you to have other levels like: CONFIG, FINER, and FINEST. Most projects don't separate out configuration logging from debugging information. Also, we wanted to maintain backwards compatibility as much as possible. Unfortunately, with all the "fineness" details, there is no equivalent to the "error" log level.
- Version:
- $Id: Jdk14Logger.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJdk14Logger
(Logger logImpl) Construct a Logger with specified jdk1.4 logger instance as implementation. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Log a debug message.final void
Log a debug message.final void
Log a error message.final void
Log a error message.final void
fatalError
(String message) Log a fatalError message.final void
fatalError
(String message, Throwable throwable) Log a fatalError message.final org.apache.avalon.framework.logger.Logger
getChildLogger
(String name) Create a new child logger.final void
Log a info message.final void
Log a info message.final boolean
Determine if messages of priority "debug" will be logged.final boolean
Determine if messages of priority "error" will be logged.final boolean
Determine if messages of priority "fatalError" will be logged.final boolean
Determine if messages of priority "info" will be logged.final boolean
Determine if messages of priority "warn" will be logged.final void
Log a warn message.final void
Log a warn message.
-
Field Details
-
m_logger
-
-
Constructor Details
-
Jdk14Logger
Construct a Logger with specified jdk1.4 logger instance as implementation.- Parameters:
logImpl
- the jdk1.4 logger instance to delegate to
-
-
Method Details
-
debug
Log a debug message.- Specified by:
debug
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the message
-
debug
Log a debug message.- Specified by:
debug
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the messagethrowable
- the throwable
-
isDebugEnabled
public final boolean isDebugEnabled()Determine if messages of priority "debug" will be logged.- Specified by:
isDebugEnabled
in interfaceorg.apache.avalon.framework.logger.Logger
- Returns:
- true if "debug" messages will be logged
-
info
Log a info message.- Specified by:
info
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the message
-
info
Log a info message.- Specified by:
info
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the messagethrowable
- the throwable
-
isInfoEnabled
public final boolean isInfoEnabled()Determine if messages of priority "info" will be logged.- Specified by:
isInfoEnabled
in interfaceorg.apache.avalon.framework.logger.Logger
- Returns:
- true if "info" messages will be logged
-
warn
Log a warn message.- Specified by:
warn
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the message
-
warn
Log a warn message.- Specified by:
warn
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the messagethrowable
- the throwable
-
isWarnEnabled
public final boolean isWarnEnabled()Determine if messages of priority "warn" will be logged.- Specified by:
isWarnEnabled
in interfaceorg.apache.avalon.framework.logger.Logger
- Returns:
- true if "warn" messages will be logged
-
error
Log a error message.- Specified by:
error
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the message
-
error
Log a error message.- Specified by:
error
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the messagethrowable
- the throwable
-
isErrorEnabled
public final boolean isErrorEnabled()Determine if messages of priority "error" will be logged.- Specified by:
isErrorEnabled
in interfaceorg.apache.avalon.framework.logger.Logger
- Returns:
- true if "error" messages will be logged
-
fatalError
Log a fatalError message.- Specified by:
fatalError
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the message
-
fatalError
Log a fatalError message.- Specified by:
fatalError
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
message
- the messagethrowable
- the throwable
-
isFatalErrorEnabled
public final boolean isFatalErrorEnabled()Determine if messages of priority "fatalError" will be logged.- Specified by:
isFatalErrorEnabled
in interfaceorg.apache.avalon.framework.logger.Logger
- Returns:
- true if "fatalError" messages will be logged
-
getChildLogger
Create a new child logger. The name of the child logger is [current-loggers-name].[passed-in-name] ThrowsIllegalArgumentException
if name has an empty element name- Specified by:
getChildLogger
in interfaceorg.apache.avalon.framework.logger.Logger
- Parameters:
name
- the subname of this logger- Returns:
- the new logger
-