org.codehaus.plexus.logging.console

Class ConsoleLoggerManager

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:
 
   org.codehaus.plexus.logging.ConsoleLoggerManager
   
     DEBUG
   
 
 

Version: $Id: ConsoleLoggerManager.java 6991 2007-10-23 03:59:32Z jvanzyl $

Author: Jason van Zyl Trygve Laugstøl

Field Summary
booleanbootTimeLogger
intcurrentThreshold
intloggerCount
The number of active loggers in use.
Maploggers
Stringthreshold
Message of this level or higher will be logged.
Constructor Summary
ConsoleLoggerManager()
ConsoleLoggerManager(String threshold)
This special constructor is called directly when the container is bootstrapping itself.
Method Summary
LoggercreateLogger(int threshold, String name)
voiddebug(String msg)
Remove this method and all references when this code is verified.
StringdecodeLogLevel(int logLevel)
intgetActiveLoggerCount()
LoggergetLoggerForComponent(String role, String roleHint)
intgetThreshold()
intgetThreshold(String role, String roleHint)
voidinitialize()
intparseThreshold(String text)
voidreturnComponentLogger(String role, String roleHint)
voidsetThreshold(int currentThreshold)
voidsetThreshold(String role, String roleHint, int threshold)
voidsetThresholds(int currentThreshold)

Field Detail

bootTimeLogger

private boolean bootTimeLogger

currentThreshold

private int currentThreshold

loggerCount

private int loggerCount
The number of active loggers in use.

loggers

private Map loggers

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.

Constructor Detail

ConsoleLoggerManager

public ConsoleLoggerManager()

ConsoleLoggerManager

public ConsoleLoggerManager(String threshold)
This special constructor is called directly when the container is bootstrapping itself.

Method Detail

createLogger

public Logger createLogger(int threshold, String name)

debug

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

Parameters: msg

decodeLogLevel

private String decodeLogLevel(int logLevel)

getActiveLoggerCount

public int getActiveLoggerCount()

getLoggerForComponent

public Logger getLoggerForComponent(String role, String roleHint)

getThreshold

public int getThreshold()

Returns: Returns the threshold.

getThreshold

public int getThreshold(String role, String roleHint)

initialize

public void initialize()

parseThreshold

private int parseThreshold(String text)

returnComponentLogger

public void returnComponentLogger(String role, String roleHint)

setThreshold

public void setThreshold(int currentThreshold)

setThreshold

public void setThreshold(String role, String roleHint, int threshold)

setThresholds

public void setThresholds(int currentThreshold)