Class ConsoleLogger
java.lang.Object
org.apache.avalon.framework.logger.ConsoleLogger
- All Implemented Interfaces:
org.apache.avalon.framework.logger.Logger
public final class ConsoleLogger
extends Object
implements org.apache.avalon.framework.logger.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:
- $Id: ConsoleLogger.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- 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.private final int -
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.org.apache.avalon.framework.logger.LoggergetChildLogger(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:
-
m_logLevel
private final int m_logLevel
-
-
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.- Specified by:
debugin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
message- aStringvalue
-
debug
-
isDebugEnabled
public boolean isDebugEnabled()Returnstrueif debug-level logging is enabled, false otherwise.- Specified by:
isDebugEnabledin interfaceorg.apache.avalon.framework.logger.Logger- Returns:
trueif debug-level logging
-
info
Logs an informational message.- Specified by:
infoin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
message- aStringvalue
-
info
-
isInfoEnabled
public boolean isInfoEnabled()Returnstrueif info-level logging is enabled, false otherwise.- Specified by:
isInfoEnabledin interfaceorg.apache.avalon.framework.logger.Logger- Returns:
trueif info-level logging is enabled
-
warn
Logs a warning message.- Specified by:
warnin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
message- aStringvalue
-
warn
-
isWarnEnabled
public boolean isWarnEnabled()Returnstrueif warn-level logging is enabled, false otherwise.- Specified by:
isWarnEnabledin interfaceorg.apache.avalon.framework.logger.Logger- Returns:
trueif warn-level logging is enabled
-
error
Logs an error message.- Specified by:
errorin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
message- aStringvalue
-
error
-
isErrorEnabled
public boolean isErrorEnabled()Returnstrueif error-level logging is enabled, false otherwise.- Specified by:
isErrorEnabledin interfaceorg.apache.avalon.framework.logger.Logger- Returns:
trueif error-level logging is enabled
-
fatalError
Logs a fatal error message.- Specified by:
fatalErrorin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
message- aStringvalue
-
fatalError
-
isFatalErrorEnabled
public boolean isFatalErrorEnabled()Returnstrueif fatal-level logging is enabled, false otherwise.- Specified by:
isFatalErrorEnabledin interfaceorg.apache.avalon.framework.logger.Logger- Returns:
trueif fatal-level logging is enabled
-
getChildLogger
Just returns this logger (ConsoleLoggeris not hierarchical).- Specified by:
getChildLoggerin interfaceorg.apache.avalon.framework.logger.Logger- Parameters:
name- ignored- Returns:
- this logger
-