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

public abstract Class AbstractLogEnabled

extends Object
implements LogEnabled
Class Inheritance
All Implemented Interfaces
org.apache.avalon.framework.logger.LogEnabled

Utility class to allow easy construction of components that will perform logging.
Author
Avalon Development Team
Version
$Id: AbstractLogEnabled.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
private Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
enableLogging(final Logger
the logger
logger
)

Implements org.apache.avalon.framework.logger.LogEnabled.enableLogging.

Set the components logger.
protected final Logger

Returns:

the Logger
getLogger
()

Helper method to allow sub-classes to aquire logger.

protected void
setupLogger(final Object
the component to pass logger object to
component
)

Helper method to setup other components with same logger.

protected void
setupLogger(final Object
the component to pass logger object to
component
,
final String
the subcategory to use (may be null)
subCategory
)

Helper method to setup other components with logger.

protected void
setupLogger(final Object
the component to pass logger object to
component
,
final Logger
the Logger
logger
)

Helper method to setup other components with logger.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_loggerback to summary
private Logger m_logger

Constructor Detail

AbstractLogEnabledback to summary
public AbstractLogEnabled()

Method Detail

enableLoggingback to summary
public void enableLogging(final Logger logger)

Implements org.apache.avalon.framework.logger.LogEnabled.enableLogging.

Set the components logger.

Parameters
logger:Logger

the logger

getLoggerback to summary
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:Logger

the Logger

setupLoggerback to summary
protected void setupLogger(final Object component)

Helper method to setup other components with same logger.

Parameters
component:Object

the component to pass logger object to

setupLoggerback to summary
protected void setupLogger(final Object component, final String subCategory)

Helper method to setup other components with logger. The logger has the subcategory of this components logger.

Parameters
component:Object

the component to pass logger object to

subCategory:String

the subcategory to use (may be null)

setupLoggerback to summary
protected void setupLogger(final Object component, final Logger logger)

Helper method to setup other components with logger.

Parameters
component:Object

the component to pass logger object to

logger:Logger

the Logger