org.apache.avalon.framework.logger

Class AbstractLoggable

public abstract class AbstractLoggable extends Object implements Loggable

Deprecated: Use AbstractLogEnabled instead.

Utility class to allow construction of easy components that will perform logging.

Version: $Id: AbstractLoggable.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $

Author: Avalon Development Team

Field Summary
Loggerm_logger
Method Summary
protected LoggergetLogger()
Helper method to allow sub-classes to aquire logger.
voidsetLogger(Logger logger)
Set the components logger.
protected voidsetupLogger(Object component)
Helper method to setup other components with same logger.
protected voidsetupLogger(Object component, String subCategory)
Helper method to setup other components with logger.
protected voidsetupLogger(Object component, Logger logger)
Helper method to setup other components with logger.

Field Detail

m_logger

private Logger m_logger

Method Detail

getLogger

protected final Logger getLogger()
Helper method to allow sub-classes to aquire logger. This method exists rather than exposing a member variable because it protects other users against future changes. It also means they do not have to use our naming convention.

There is no performance penalty as this is a final method and will be inlined by the JVM.

Returns: the Logger

setLogger

public void setLogger(Logger logger)
Set the components logger.

Parameters: logger the logger

setupLogger

protected void setupLogger(Object component)
Helper method to setup other components with same logger.

Parameters: component the component to pass logger object to

setupLogger

protected void setupLogger(Object component, String subCategory)
Helper method to setup other components with logger. The logger has the subcategory of this components logger.

Parameters: component the component to pass logger object to subCategory the subcategory to use (may be null)

setupLogger

protected void setupLogger(Object component, Logger logger)
Helper method to setup other components with logger.

Parameters: component the component to pass logger object to logger the Logger