Class AbstractLogEnabled
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
- All Implemented Interfaces:
LogEnabled
Utility class to allow easy construction of components that will perform
logging.
- Version:
- $Id: AbstractLogEnabled.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenableLogging(Logger logger) Set the components logger.protected final LoggerHelper method to allow sub-classes to aquire 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 Details
-
m_logger
Base Logger instance
-
-
Constructor Details
-
AbstractLogEnabled
public AbstractLogEnabled()
-
-
Method Details
-
enableLogging
Set the components logger.- Specified by:
enableLoggingin interfaceLogEnabled- Parameters:
logger- the 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
-
setupLogger
Helper method to setup other components with same logger.- Parameters:
component- the component to pass logger object to
-
setupLogger
-
setupLogger
-