Class ConsoleLoggerManager

java.lang.Object
org.codehaus.plexus.logging.AbstractLoggerManager
org.codehaus.plexus.logging.console.ConsoleLoggerManager
All Implemented Interfaces:
LoggerManager, Initializable

public class ConsoleLoggerManager extends AbstractLoggerManager implements LoggerManager, Initializable
This is a simple logger manager that will only write the logging statements to the console. Sample configuration:

 <logging>
   <implementation>org.codehaus.plexus.logging.ConsoleLoggerManager</implementation>
   <logger>
     <threshold>DEBUG</threshold>
   </logger>
 </logging>
 
  • Field Details

    • threshold

      private String threshold
      Message of this level or higher will be logged. This field is set by the plexus container thus the name is 'threshold'. The field currentThreshold contains the current setting of the threshold.
    • currentThreshold

      private int currentThreshold
    • loggers

      private Map loggers
    • loggerCount

      private int loggerCount
      The number of active loggers in use.
    • bootTimeLogger

      private boolean bootTimeLogger
  • Constructor Details

    • ConsoleLoggerManager

      public ConsoleLoggerManager()
    • ConsoleLoggerManager

      public ConsoleLoggerManager(String threshold)
      This special constructor is called directly when the container is bootstrapping itself.
      Parameters:
      threshold - The threshold.
  • Method Details

    • initialize

      public void initialize()
      Specified by:
      initialize in interface Initializable
    • setThreshold

      public void setThreshold(int currentThreshold)
      Description copied from interface: LoggerManager
      Sets the threshold for all new loggers. It will NOT affect the existing loggers. This is usually only set once while the logger manager is configured.
      Specified by:
      setThreshold in interface LoggerManager
      Parameters:
      currentThreshold - The new threshold.
    • setThresholds

      public void setThresholds(int currentThreshold)
      Description copied from interface: LoggerManager
      Sets the threshold for all loggers. It affects all the existing loggers as well as future loggers.
      Specified by:
      setThresholds in interface LoggerManager
      Parameters:
      currentThreshold - The new threshold.
    • getThreshold

      public int getThreshold()
      Description copied from interface: LoggerManager
      Returns the current threshold for all new loggers.
      Specified by:
      getThreshold in interface LoggerManager
      Returns:
      Returns the threshold.
    • setThreshold

      public void setThreshold(String role, String roleHint, int threshold)
      Specified by:
      setThreshold in interface LoggerManager
    • getThreshold

      public int getThreshold(String role, String roleHint)
      Specified by:
      getThreshold in interface LoggerManager
    • createLogger

      public Logger createLogger(int threshold, String name)
    • getLoggerForComponent

      public Logger getLoggerForComponent(String role, String roleHint)
      Specified by:
      getLoggerForComponent in interface LoggerManager
    • returnComponentLogger

      public void returnComponentLogger(String role, String roleHint)
      Specified by:
      returnComponentLogger in interface LoggerManager
    • getActiveLoggerCount

      public int getActiveLoggerCount()
      Specified by:
      getActiveLoggerCount in interface LoggerManager
    • parseThreshold

      private int parseThreshold(String text)
    • decodeLogLevel

      private String decodeLogLevel(int logLevel)
    • debug

      private void debug(String msg)
      Remove this method and all references when this code is verified.
      Parameters:
      msg -