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 intTypecode for debugging messages.static final intTypecode for disabled log levels.static final intTypecode for error messages.static final intTypecode for fatal error messages.static final intTypecode for informational messages.static final intTypecode 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 TypeMethodDescriptionvoidLogs a debugging message.voidLogs a debugging message and an exception.voidLogs an error message.voidLogs an error message and an exception.voidfatalError(String message) Logs a fatal error message.voidfatalError(String message, Throwable throwable) Logs a fatal error message and an exception.getChildLogger(String name) Just returns this logger (ConsoleLoggeris not hierarchical).voidLogs an informational message.voidLogs an informational message and an exception.booleanReturnstrueif debug-level logging is enabled, false otherwise.booleanReturnstrueif error-level logging is enabled, false otherwise.booleanReturnstrueif fatal-level logging is enabled, false otherwise.booleanReturnstrueif info-level logging is enabled, false otherwise.booleanReturnstrueif warn-level logging is enabled, false otherwise.voidLogs a warning message.voidLogs 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()Returnstrueif debug-level logging is enabled, false otherwise.- Specified by:
isDebugEnabledin interfaceLogger- Returns:
trueif debug-level logging
-
info
Logs an informational message. -
info
Logs an informational message and an exception. -
isInfoEnabled
public boolean isInfoEnabled()Returnstrueif info-level logging is enabled, false otherwise.- Specified by:
isInfoEnabledin interfaceLogger- Returns:
trueif info-level logging is enabled
-
warn
Logs a warning message. -
warn
Logs a warning message and an exception. -
isWarnEnabled
public boolean isWarnEnabled()Returnstrueif warn-level logging is enabled, false otherwise.- Specified by:
isWarnEnabledin interfaceLogger- Returns:
trueif warn-level logging is enabled
-
error
Logs an error message. -
error
Logs an error message and an exception. -
isErrorEnabled
public boolean isErrorEnabled()Returnstrueif error-level logging is enabled, false otherwise.- Specified by:
isErrorEnabledin interfaceLogger- Returns:
trueif error-level logging is enabled
-
fatalError
Logs a fatal error message.- Specified by:
fatalErrorin interfaceLogger- Parameters:
message- aStringvalue
-
fatalError
Logs a fatal error message and an exception.- Specified by:
fatalErrorin interfaceLogger- Parameters:
message- aStringvaluethrowable- aThrowablevalue
-
isFatalErrorEnabled
public boolean isFatalErrorEnabled()Returnstrueif fatal-level logging is enabled, false otherwise.- Specified by:
isFatalErrorEnabledin interfaceLogger- Returns:
trueif fatal-level logging is enabled
-
getChildLogger
Just returns this logger (ConsoleLoggeris not hierarchical).- Specified by:
getChildLoggerin interfaceLogger- Parameters:
name- ignored- Returns:
- this logger
-