org.apache.avalon.framework.logger
Class CommonsLogger

java.lang.Object
  extended byorg.apache.avalon.framework.logger.CommonsLogger
All Implemented Interfaces:
Logger

public class CommonsLogger
extends java.lang.Object
implements Logger

An Avalon Logger implementation backed by a of commons lLogging.

Since:
4.3
Version:
$Id: CommonsLogger.java 233132 2005-08-17 07:32:45Z cziegeler $
Author:
Avalon Development Team

Constructor Summary
CommonsLogger(org.apache.commons.logging.Log log, java.lang.String name)
          Construct a CommonsLogger.
 
Method Summary
 void debug(java.lang.String message)
          Log a debug message.
 void debug(java.lang.String message, java.lang.Throwable throwable)
          Log a debug message.
 void error(java.lang.String message)
          Log a error message.
 void error(java.lang.String message, java.lang.Throwable throwable)
          Log a error message.
 void fatalError(java.lang.String message)
          Log a fatalError message.
 void fatalError(java.lang.String message, java.lang.Throwable throwable)
          Log a fatalError message.
 Logger getChildLogger(java.lang.String name)
          Create a new child logger.
 void info(java.lang.String message)
          Log a info message.
 void info(java.lang.String message, java.lang.Throwable throwable)
          Log a info message.
 boolean isDebugEnabled()
          Determine if messages of priority "debug" will be logged.
 boolean isErrorEnabled()
          Determine if messages of priority "error" will be logged.
 boolean isFatalErrorEnabled()
          Determine if messages of priority "fatalError" will be logged.
 boolean isInfoEnabled()
          Determine if messages of priority "info" will be logged.
 boolean isWarnEnabled()
          Determine if messages of priority "warn" will be logged.
 void warn(java.lang.String message)
          Log a warn message.
 void warn(java.lang.String message, java.lang.Throwable throwable)
          Log a warn message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsLogger

public CommonsLogger(org.apache.commons.logging.Log log,
                     java.lang.String name)
Construct a CommonsLogger. The constructor needs explicitly the name of the commons-logger, since the commons-logging API misses the functionality to retrieve it from the logger instance.

Parameters:
log - The logger of commons-logging.
name - The name of the logger.
Since:
2.0
Method Detail

debug

public void debug(java.lang.String message)
Description copied from interface: Logger
Log a debug message.

Specified by:
debug in interface Logger
Parameters:
message - the message
See Also:
Logger.debug(java.lang.String)

debug

public void debug(java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: Logger
Log a debug message.

Specified by:
debug in interface Logger
Parameters:
message - the message
throwable - the throwable
See Also:
Logger.debug(java.lang.String, java.lang.Throwable)

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: Logger
Determine if messages of priority "debug" will be logged.

Specified by:
isDebugEnabled in interface Logger
Returns:
true if "debug" messages will be logged
See Also:
Logger.isDebugEnabled()

info

public void info(java.lang.String message)
Description copied from interface: Logger
Log a info message.

Specified by:
info in interface Logger
Parameters:
message - the message
See Also:
Logger.info(java.lang.String)

info

public void info(java.lang.String message,
                 java.lang.Throwable throwable)
Description copied from interface: Logger
Log a info message.

Specified by:
info in interface Logger
Parameters:
message - the message
throwable - the throwable
See Also:
Logger.info(java.lang.String, java.lang.Throwable)

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: Logger
Determine if messages of priority "info" will be logged.

Specified by:
isInfoEnabled in interface Logger
Returns:
true if "info" messages will be logged
See Also:
Logger.isInfoEnabled()

warn

public void warn(java.lang.String message)
Description copied from interface: Logger
Log a warn message.

Specified by:
warn in interface Logger
Parameters:
message - the message
See Also:
Logger.warn(java.lang.String)

warn

public void warn(java.lang.String message,
                 java.lang.Throwable throwable)
Description copied from interface: Logger
Log a warn message.

Specified by:
warn in interface Logger
Parameters:
message - the message
throwable - the throwable
See Also:
Logger.warn(java.lang.String, java.lang.Throwable)

isWarnEnabled

public boolean isWarnEnabled()
Description copied from interface: Logger
Determine if messages of priority "warn" will be logged.

Specified by:
isWarnEnabled in interface Logger
Returns:
true if "warn" messages will be logged
See Also:
Logger.isWarnEnabled()

error

public void error(java.lang.String message)
Description copied from interface: Logger
Log a error message.

Specified by:
error in interface Logger
Parameters:
message - the message
See Also:
Logger.error(java.lang.String)

error

public void error(java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: Logger
Log a error message.

Specified by:
error in interface Logger
Parameters:
message - the message
throwable - the throwable
See Also:
Logger.error(java.lang.String, java.lang.Throwable)

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: Logger
Determine if messages of priority "error" will be logged.

Specified by:
isErrorEnabled in interface Logger
Returns:
true if "error" messages will be logged
See Also:
Logger.isErrorEnabled()

fatalError

public void fatalError(java.lang.String message)
Description copied from interface: Logger
Log a fatalError message.

Specified by:
fatalError in interface Logger
Parameters:
message - the message
See Also:
Logger.fatalError(java.lang.String)

fatalError

public void fatalError(java.lang.String message,
                       java.lang.Throwable throwable)
Description copied from interface: Logger
Log a fatalError message.

Specified by:
fatalError in interface Logger
Parameters:
message - the message
throwable - the throwable
See Also:
Logger.fatalError(java.lang.String, java.lang.Throwable)

isFatalErrorEnabled

public boolean isFatalErrorEnabled()
Description copied from interface: Logger
Determine if messages of priority "fatalError" will be logged.

Specified by:
isFatalErrorEnabled in interface Logger
Returns:
true if "fatalError" messages will be logged
See Also:
Logger.isFatalErrorEnabled()

getChildLogger

public Logger getChildLogger(java.lang.String name)
Description copied from interface: Logger
Create a new child logger. The name of the child logger is [current-loggers-name].[passed-in-name] Throws IllegalArgumentException if name has an empty element name

Specified by:
getChildLogger in interface Logger
Parameters:
name - the subname of this logger
Returns:
the new logger
See Also:
Logger.getChildLogger(java.lang.String)


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.