org.codehaus.plexus.logging.console

Class ConsoleLoggerManager

Implemented Interfaces:
Initializable, LoggerManager

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 1323 2004-12-20 23:00:59Z jvanzyl $
Authors:
Jason van Zyl
Trygve Laugstøl

Field Summary

private boolean
bootTimeLogger
private int
currentThreshold
private int
loggerCount
The number of active loggers in use.
private Map
loggers
private String
threshold
Message of this level or higher will be logged.

Fields inherited from interface org.codehaus.plexus.logging.LoggerManager

ROLE

Constructor Summary

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

Method Summary

private void
debug(String msg)
Remove this method and all references when this code is verified.
private String
decodeLogLevel(int logLevel)
int
getActiveLoggerCount()
Logger
getLoggerForComponent(String role, String roleHint)
int
getThreshold()
int
getThreshold(String role, String roleHint)
void
initialize()
private int
parseThreshold(String text)
void
returnComponentLogger(String role, String roleHint)
void
setThreshold(String role, String roleHint, int threshold)
void
setThreshold(int currentThreshold)
Sets the threshold for all new loggers.

Methods inherited from class org.codehaus.plexus.logging.AbstractLoggerManager

getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold, toMapKey

Field Details

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 Details

ConsoleLoggerManager

public ConsoleLoggerManager()

ConsoleLoggerManager

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

Method Details

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()
Specified by:
getActiveLoggerCount in interface LoggerManager

getLoggerForComponent

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

getThreshold

public int getThreshold()
Specified by:
getThreshold in interface LoggerManager
Returns:
Returns the threshold.

getThreshold

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

initialize

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

parseThreshold

private int parseThreshold(String text)

returnComponentLogger

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

setThreshold

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

setThreshold

public void setThreshold(int currentThreshold)
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: