Class ConsoleLogger
- java.lang.Object
-
- org.apache.avalon.framework.logger.ConsoleLogger
-
- All Implemented Interfaces:
Logger
public final class ConsoleLogger extends java.lang.Object implements 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.12 $ $Date: 2003/02/11 15:58:40 $
- Author:
- Avalon Development Team
-
-
Field Summary
Fields Modifier and Type Field Description static int
LEVEL_DEBUG
Typecode for debugging messages.static int
LEVEL_DISABLED
Typecode for disabled log levels.static int
LEVEL_ERROR
Typecode for error messages.static int
LEVEL_FATAL
Typecode for fatal error messages.static int
LEVEL_INFO
Typecode for informational messages.static int
LEVEL_WARN
Typecode for warning messages.
-
Constructor Summary
Constructors Constructor Description ConsoleLogger()
Creates a new ConsoleLogger with the priority set to DEBUG.ConsoleLogger(int logLevel)
Creates a new ConsoleLogger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(java.lang.String message)
Logs a debugging message.void
debug(java.lang.String message, java.lang.Throwable throwable)
Logs a debugging message and an exception.void
error(java.lang.String message)
Logs an error message.void
error(java.lang.String message, java.lang.Throwable throwable)
Logs an error message and an exception.void
fatalError(java.lang.String message)
Logs a fatal error message.void
fatalError(java.lang.String message, java.lang.Throwable throwable)
Logs a fatal error message and an exception.Logger
getChildLogger(java.lang.String name)
Just returns this logger (ConsoleLogger
is not hierarchical).void
info(java.lang.String message)
Logs an informational message.void
info(java.lang.String message, java.lang.Throwable throwable)
Logs an informational message and an exception.boolean
isDebugEnabled()
Returnstrue
if debug-level logging is enabled, false otherwise.boolean
isErrorEnabled()
Returnstrue
if error-level logging is enabled, false otherwise.boolean
isFatalErrorEnabled()
Returnstrue
if fatal-level logging is enabled, false otherwise.boolean
isInfoEnabled()
Returnstrue
if info-level logging is enabled, false otherwise.boolean
isWarnEnabled()
Returnstrue
if warn-level logging is enabled, false otherwise.void
warn(java.lang.String message)
Logs a warning message.void
warn(java.lang.String message, java.lang.Throwable throwable)
Logs a warning message and an exception.
-
-
-
Field Detail
-
LEVEL_DEBUG
public static final int LEVEL_DEBUG
Typecode for debugging messages.- See Also:
- Constant Field Values
-
LEVEL_INFO
public static final int LEVEL_INFO
Typecode for informational messages.- See Also:
- Constant Field Values
-
LEVEL_WARN
public static final int LEVEL_WARN
Typecode for warning messages.- See Also:
- Constant Field Values
-
LEVEL_ERROR
public static final int LEVEL_ERROR
Typecode for error messages.- See Also:
- Constant Field Values
-
LEVEL_FATAL
public static final int LEVEL_FATAL
Typecode for fatal error messages.- See Also:
- Constant Field Values
-
LEVEL_DISABLED
public static final int LEVEL_DISABLED
Typecode for disabled log levels.- See Also:
- Constant Field Values
-
-
Method Detail
-
debug
public void debug(java.lang.String message)
Logs a debugging message.
-
debug
public void debug(java.lang.String message, java.lang.Throwable throwable)
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
public void info(java.lang.String message)
Logs an informational message.
-
info
public void info(java.lang.String message, java.lang.Throwable throwable)
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
public void warn(java.lang.String message)
Logs a warning message.
-
warn
public void warn(java.lang.String message, java.lang.Throwable throwable)
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
public void error(java.lang.String message)
Logs an error message.
-
error
public void error(java.lang.String message, java.lang.Throwable throwable)
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
public void fatalError(java.lang.String message)
Logs a fatal error message.- Specified by:
fatalError
in interfaceLogger
- Parameters:
message
- aString
value
-
fatalError
public void fatalError(java.lang.String message, java.lang.Throwable throwable)
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
public Logger getChildLogger(java.lang.String name)
Just returns this logger (ConsoleLogger
is not hierarchical).- Specified by:
getChildLogger
in interfaceLogger
- Parameters:
name
- ignored- Returns:
- this logger
-
-