Top Description Fields Constructors Methods
org.apache.avalon.framework.logger

public final Class ConsoleLogger

extends Object
implements Logger
Class Inheritance
All Implemented Interfaces
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.
Author
Avalon Development Team
Version
$Id: ConsoleLogger.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
public static final int
LEVEL_DEBUG

Typecode for debugging messages.

public static final int
LEVEL_DISABLED

Typecode for disabled log levels.

public static final int
LEVEL_ERROR

Typecode for error messages.

public static final int
LEVEL_FATAL

Typecode for fatal error messages.

public static final int
LEVEL_INFO

Typecode for informational messages.

public static final int
LEVEL_WARN

Typecode for warning messages.

private final int

Constructor Summary

AccessConstructor and Description
public
ConsoleLogger()

Creates a new ConsoleLogger with the priority set to DEBUG.

public
ConsoleLogger(final int
log level typecode
logLevel
)

Creates a new ConsoleLogger.

Method Summary

Modifier and TypeMethod and Description
public void
debug(final String
a String value
message
)

Implements org.apache.avalon.framework.logger.Logger.debug.

Logs a debugging message.
public void
debug(final String
a String value
message
,
final Throwable
a Throwable value
throwable
)

Implements org.apache.avalon.framework.logger.Logger.debug.

Logs a debugging message and an exception.
public void
error(final String
a String value
message
)

Implements org.apache.avalon.framework.logger.Logger.error.

Logs an error message.
public void
error(final String
a String value
message
,
final Throwable
a Throwable value
throwable
)

Implements org.apache.avalon.framework.logger.Logger.error.

Logs an error message and an exception.
public void
fatalError(final String
a String value
message
)

Implements org.apache.avalon.framework.logger.Logger.fatalError.

Logs a fatal error message.
public void
fatalError(final String
a String value
message
,
final Throwable
a Throwable value
throwable
)

Implements org.apache.avalon.framework.logger.Logger.fatalError.

Logs a fatal error message and an exception.
public Logger

Returns:

this logger
getChildLogger
(final String
ignored
name
)

Implements org.apache.avalon.framework.logger.Logger.getChildLogger.

Just returns this logger (ConsoleLogger is not hierarchical).
public void
info(final String
a String value
message
)

Implements org.apache.avalon.framework.logger.Logger.info.

Logs an informational message.
public void
info(final String
a String value
message
,
final Throwable
a Throwable value
throwable
)

Implements org.apache.avalon.framework.logger.Logger.info.

Logs an informational message and an exception.
public boolean

Returns:

true if debug-level logging
isDebugEnabled
()

Implements org.apache.avalon.framework.logger.Logger.isDebugEnabled.

Returns true if debug-level logging is enabled, false otherwise.
public boolean

Returns:

true if error-level logging is enabled
isErrorEnabled
()

Implements org.apache.avalon.framework.logger.Logger.isErrorEnabled.

Returns true if error-level logging is enabled, false otherwise.
public boolean

Returns:

true if fatal-level logging is enabled
isFatalErrorEnabled
()

Implements org.apache.avalon.framework.logger.Logger.isFatalErrorEnabled.

Returns true if fatal-level logging is enabled, false otherwise.
public boolean

Returns:

true if info-level logging is enabled
isInfoEnabled
()

Implements org.apache.avalon.framework.logger.Logger.isInfoEnabled.

Returns true if info-level logging is enabled, false otherwise.
public boolean

Returns:

true if warn-level logging is enabled
isWarnEnabled
()

Implements org.apache.avalon.framework.logger.Logger.isWarnEnabled.

Returns true if warn-level logging is enabled, false otherwise.
public void
warn(final String
a String value
message
)

Implements org.apache.avalon.framework.logger.Logger.warn.

Logs a warning message.
public void
warn(final String
a String value
message
,
final Throwable
a Throwable value
throwable
)

Implements org.apache.avalon.framework.logger.Logger.warn.

Logs a warning message and an exception.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LEVEL_DEBUGback to summary
public static final int LEVEL_DEBUG

Typecode for debugging messages.

LEVEL_DISABLEDback to summary
public static final int LEVEL_DISABLED

Typecode for disabled log levels.

LEVEL_ERRORback to summary
public static final int LEVEL_ERROR

Typecode for error messages.

LEVEL_FATALback to summary
public static final int LEVEL_FATAL

Typecode for fatal error messages.

LEVEL_INFOback to summary
public static final int LEVEL_INFO

Typecode for informational messages.

LEVEL_WARNback to summary
public static final int LEVEL_WARN

Typecode for warning messages.

m_logLevelback to summary
private final int m_logLevel

Constructor Detail

ConsoleLoggerback to summary
public ConsoleLogger()

Creates a new ConsoleLogger with the priority set to DEBUG.

ConsoleLoggerback to summary
public ConsoleLogger(final int logLevel)

Creates a new ConsoleLogger.

Parameters
logLevel:int

log level typecode

Method Detail

debugback to summary
public void debug(final String message)

Implements org.apache.avalon.framework.logger.Logger.debug.

Logs a debugging message.

Parameters
message:String

a String value

debugback to summary
public void debug(final String message, final Throwable throwable)

Implements org.apache.avalon.framework.logger.Logger.debug.

Logs a debugging message and an exception.

Parameters
message:String

a String value

throwable:Throwable

a Throwable value

errorback to summary
public void error(final String message)

Implements org.apache.avalon.framework.logger.Logger.error.

Logs an error message.

Parameters
message:String

a String value

errorback to summary
public void error(final String message, final Throwable throwable)

Implements org.apache.avalon.framework.logger.Logger.error.

Logs an error message and an exception.

Parameters
message:String

a String value

throwable:Throwable

a Throwable value

fatalErrorback to summary
public void fatalError(final String message)

Implements org.apache.avalon.framework.logger.Logger.fatalError.

Logs a fatal error message.

Parameters
message:String

a String value

fatalErrorback to summary
public void fatalError(final String message, final Throwable throwable)

Implements org.apache.avalon.framework.logger.Logger.fatalError.

Logs a fatal error message and an exception.

Parameters
message:String

a String value

throwable:Throwable

a Throwable value

getChildLoggerback to summary
public Logger getChildLogger(final String name)

Implements org.apache.avalon.framework.logger.Logger.getChildLogger.

Just returns this logger (ConsoleLogger is not hierarchical).

Parameters
name:String

ignored

Returns:Logger

this logger

infoback to summary
public void info(final String message)

Implements org.apache.avalon.framework.logger.Logger.info.

Logs an informational message.

Parameters
message:String

a String value

infoback to summary
public void info(final String message, final Throwable throwable)

Implements org.apache.avalon.framework.logger.Logger.info.

Logs an informational message and an exception.

Parameters
message:String

a String value

throwable:Throwable

a Throwable value

isDebugEnabledback to summary
public boolean isDebugEnabled()

Implements org.apache.avalon.framework.logger.Logger.isDebugEnabled.

Returns true if debug-level logging is enabled, false otherwise.

Returns:boolean

true if debug-level logging

isErrorEnabledback to summary
public boolean isErrorEnabled()

Implements org.apache.avalon.framework.logger.Logger.isErrorEnabled.

Returns true if error-level logging is enabled, false otherwise.

Returns:boolean

true if error-level logging is enabled

isFatalErrorEnabledback to summary
public boolean isFatalErrorEnabled()

Implements org.apache.avalon.framework.logger.Logger.isFatalErrorEnabled.

Returns true if fatal-level logging is enabled, false otherwise.

Returns:boolean

true if fatal-level logging is enabled

isInfoEnabledback to summary
public boolean isInfoEnabled()

Implements org.apache.avalon.framework.logger.Logger.isInfoEnabled.

Returns true if info-level logging is enabled, false otherwise.

Returns:boolean

true if info-level logging is enabled

isWarnEnabledback to summary
public boolean isWarnEnabled()

Implements org.apache.avalon.framework.logger.Logger.isWarnEnabled.

Returns true if warn-level logging is enabled, false otherwise.

Returns:boolean

true if warn-level logging is enabled

warnback to summary
public void warn(final String message)

Implements org.apache.avalon.framework.logger.Logger.warn.

Logs a warning message.

Parameters
message:String

a String value

warnback to summary
public void warn(final String message, final Throwable throwable)

Implements org.apache.avalon.framework.logger.Logger.warn.

Logs a warning message and an exception.

Parameters
message:String

a String value

throwable:Throwable

a Throwable value