org.apache.commons.logging.impl

Class AvalonLogger

public class AvalonLogger extends Object implements Log, Serializable

Implementation of commons-logging Log interface that delegates all logging calls to the Avalon logging abstraction: the Logger interface.

There are two ways in which this class can be used:

Version: $Revision: 1.9 $ $Date: 2004/06/01 19:56:20 $

Author: Neeme Praks

Field Summary
static LoggerdefaultLogger
Ancesteral avalon logger
Loggerlogger
Avalon logger used to perform log
Stringname
The name of this logger
Constructor Summary
AvalonLogger(Logger logger)
Constructs an AvalonLogger that outputs to the given Logger instance.
AvalonLogger(String name)
Constructs an AvalonLogger that will log to a child of the Logger set by calling {@link #setDefaultLogger}.
Method Summary
voiddebug(Object o, Throwable t)
voiddebug(Object o)
voiderror(Object o, Throwable t)
voiderror(Object o)
voidfatal(Object o, Throwable t)
voidfatal(Object o)
LoggergetLogger()
Gets the Avalon logger implementation used to perform logging.
voidinfo(Object o, Throwable t)
voidinfo(Object o)
booleanisDebugEnabled()
booleanisErrorEnabled()
booleanisFatalEnabled()
booleanisInfoEnabled()
booleanisTraceEnabled()
booleanisWarnEnabled()
static voidsetDefaultLogger(Logger logger)
Sets the ancesteral Avalon logger from which the delegating loggers will descend.
voidtrace(Object o, Throwable t)
voidtrace(Object o)
voidwarn(Object o, Throwable t)
voidwarn(Object o)

Field Detail

defaultLogger

private static Logger defaultLogger
Ancesteral avalon logger

logger

private transient Logger logger
Avalon logger used to perform log

name

private String name
The name of this logger

Constructor Detail

AvalonLogger

public AvalonLogger(Logger logger)
Constructs an AvalonLogger that outputs to the given Logger instance.

Parameters: logger the avalon logger implementation to delegate to

AvalonLogger

public AvalonLogger(String name)
Constructs an AvalonLogger that will log to a child of the Logger set by calling {@link #setDefaultLogger}.

Parameters: name the name of the avalon logger implementation to delegate to

Method Detail

debug

public void debug(Object o, Throwable t)

See Also: Log

debug

public void debug(Object o)

See Also: Log

error

public void error(Object o, Throwable t)

See Also: Log

error

public void error(Object o)

See Also: Log

fatal

public void fatal(Object o, Throwable t)

See Also: Log

fatal

public void fatal(Object o)

See Also: Log

getLogger

public Logger getLogger()
Gets the Avalon logger implementation used to perform logging.

Returns: avalon logger implementation

info

public void info(Object o, Throwable t)

See Also: Log

info

public void info(Object o)

See Also: Log

isDebugEnabled

public boolean isDebugEnabled()

See Also: isDebugEnabled

isErrorEnabled

public boolean isErrorEnabled()

See Also: isErrorEnabled

isFatalEnabled

public boolean isFatalEnabled()

See Also: isFatalEnabled

isInfoEnabled

public boolean isInfoEnabled()

See Also: isInfoEnabled

isTraceEnabled

public boolean isTraceEnabled()

See Also: isTraceEnabled

isWarnEnabled

public boolean isWarnEnabled()

See Also: isWarnEnabled

setDefaultLogger

public static void setDefaultLogger(Logger logger)
Sets the ancesteral Avalon logger from which the delegating loggers will descend.

Parameters: logger the default avalon logger, in case there is no logger instance supplied in constructor

trace

public void trace(Object o, Throwable t)

See Also: Log

trace

public void trace(Object o)

See Also: Log

warn

public void warn(Object o, Throwable t)

See Also: Log

warn

public void warn(Object o)

See Also: Log

Copyright 2002-2004 The Apache Software Foundation.