Class AbstractLogEnabled

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
All Implemented Interfaces:
LogEnabled

public abstract class AbstractLogEnabled extends Object implements LogEnabled
Utility class to allow easy construction of components that will perform logging.
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/11 14:34:25 $
Author:
Avalon Development Team
  • Constructor Details

    • AbstractLogEnabled

      public AbstractLogEnabled()
  • Method Details

    • enableLogging

      public void enableLogging(Logger logger)
      Set the components logger.
      Specified by:
      enableLogging in interface LogEnabled
      Parameters:
      logger - the logger
    • 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
    • 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