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>
- Author:
- Jason van Zyl, Trygve Laugstøl
-
-
Field Summary
-
Fields inherited from interface org.codehaus.plexus.logging.LoggerManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description ConsoleLoggerManager()
ConsoleLoggerManager(String threshold)
This special constructor is called directly when the container is bootstrapping itself.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Logger
createLogger(int threshold, String name)
int
getActiveLoggerCount()
Logger
getLoggerForComponent(String role, String roleHint)
int
getThreshold()
Returns the current threshold for all new loggers.int
getThreshold(String role, String roleHint)
void
initialize()
void
returnComponentLogger(String role, String roleHint)
void
setThreshold(int currentThreshold)
Sets the threshold for all new loggers.void
setThreshold(String role, String roleHint, int threshold)
void
setThresholds(int currentThreshold)
Sets the threshold for all loggers.-
Methods inherited from class org.codehaus.plexus.logging.AbstractLoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold, toMapKey
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.plexus.logging.LoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold
-
-
-
-
Constructor Detail
-
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 Detail
-
initialize
public void initialize()
- Specified by:
initialize
in interfaceInitializable
-
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 interfaceLoggerManager
- 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 interfaceLoggerManager
- 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 interfaceLoggerManager
- Returns:
- Returns the threshold.
-
setThreshold
public void setThreshold(String role, String roleHint, int threshold)
- Specified by:
setThreshold
in interfaceLoggerManager
-
getThreshold
public int getThreshold(String role, String roleHint)
- Specified by:
getThreshold
in interfaceLoggerManager
-
getLoggerForComponent
public Logger getLoggerForComponent(String role, String roleHint)
- Specified by:
getLoggerForComponent
in interfaceLoggerManager
-
returnComponentLogger
public void returnComponentLogger(String role, String roleHint)
- Specified by:
returnComponentLogger
in interfaceLoggerManager
-
getActiveLoggerCount
public int getActiveLoggerCount()
- Specified by:
getActiveLoggerCount
in interfaceLoggerManager
-
-