Class ConsoleLogger
java.lang.Object
org.apache.avalon.framework.logger.ConsoleLogger
- All Implemented Interfaces:
Logger
Logger sending everything to the standard output streams.
This is mainly for the cases when you have a utility that
does not have a logger to supply.
- Version:
- CVS $Revision: 1.14 $ $Date: 2004/02/11 14:34:26 $
- Author:
- Avalon Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Typecode for debugging messages.static final int
Typecode for disabled log levels.static final int
Typecode for error messages.static final int
Typecode for fatal error messages.static final int
Typecode for informational messages.static final int
Typecode for warning messages. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ConsoleLogger with the priority set to DEBUG.ConsoleLogger
(int logLevel) Creates a new ConsoleLogger. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Logs a debugging message.void
Logs a debugging message and an exception.void
Logs an error message.void
Logs an error message and an exception.void
fatalError
(String message) Logs a fatal error message.void
fatalError
(String message, Throwable throwable) Logs a fatal error message and an exception.getChildLogger
(String name) Just returns this logger (ConsoleLogger
is not hierarchical).void
Logs an informational message.void
Logs an informational message and an exception.boolean
Returnstrue
if debug-level logging is enabled, false otherwise.boolean
Returnstrue
if error-level logging is enabled, false otherwise.boolean
Returnstrue
if fatal-level logging is enabled, false otherwise.boolean
Returnstrue
if info-level logging is enabled, false otherwise.boolean
Returnstrue
if warn-level logging is enabled, false otherwise.void
Logs a warning message.void
Logs a warning message and an exception.
-
Field Details
-
LEVEL_DEBUG
public static final int LEVEL_DEBUGTypecode for debugging messages.- See Also:
-
LEVEL_INFO
public static final int LEVEL_INFOTypecode for informational messages.- See Also:
-
LEVEL_WARN
public static final int LEVEL_WARNTypecode for warning messages.- See Also:
-
LEVEL_ERROR
public static final int LEVEL_ERRORTypecode for error messages.- See Also:
-
LEVEL_FATAL
public static final int LEVEL_FATALTypecode for fatal error messages.- See Also:
-
LEVEL_DISABLED
public static final int LEVEL_DISABLEDTypecode for disabled log levels.- See Also:
-
-
Constructor Details
-
ConsoleLogger
public ConsoleLogger()Creates a new ConsoleLogger with the priority set to DEBUG. -
ConsoleLogger
public ConsoleLogger(int logLevel) Creates a new ConsoleLogger.- Parameters:
logLevel
- log level typecode
-
-
Method Details
-
debug
Logs a debugging message. -
debug
Logs a debugging message and an exception. -
isDebugEnabled
public boolean isDebugEnabled()Returnstrue
if debug-level logging is enabled, false otherwise.- Specified by:
isDebugEnabled
in interfaceLogger
- Returns:
true
if debug-level logging
-
info
Logs an informational message. -
info
Logs an informational message and an exception. -
isInfoEnabled
public boolean isInfoEnabled()Returnstrue
if info-level logging is enabled, false otherwise.- Specified by:
isInfoEnabled
in interfaceLogger
- Returns:
true
if info-level logging is enabled
-
warn
Logs a warning message. -
warn
Logs a warning message and an exception. -
isWarnEnabled
public boolean isWarnEnabled()Returnstrue
if warn-level logging is enabled, false otherwise.- Specified by:
isWarnEnabled
in interfaceLogger
- Returns:
true
if warn-level logging is enabled
-
error
Logs an error message. -
error
Logs an error message and an exception. -
isErrorEnabled
public boolean isErrorEnabled()Returnstrue
if error-level logging is enabled, false otherwise.- Specified by:
isErrorEnabled
in interfaceLogger
- Returns:
true
if error-level logging is enabled
-
fatalError
Logs a fatal error message.- Specified by:
fatalError
in interfaceLogger
- Parameters:
message
- aString
value
-
fatalError
Logs a fatal error message and an exception.- Specified by:
fatalError
in interfaceLogger
- Parameters:
message
- aString
valuethrowable
- aThrowable
value
-
isFatalErrorEnabled
public boolean isFatalErrorEnabled()Returnstrue
if fatal-level logging is enabled, false otherwise.- Specified by:
isFatalErrorEnabled
in interfaceLogger
- Returns:
true
if fatal-level logging is enabled
-
getChildLogger
Just returns this logger (ConsoleLogger
is not hierarchical).- Specified by:
getChildLogger
in interfaceLogger
- Parameters:
name
- ignored- Returns:
- this logger
-