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
ConstructorsConstructorDescriptionConsoleLoggerManager(String threshold) This special constructor is called directly when the container is bootstrapping itself. -
Method Summary
Modifier and TypeMethodDescriptioncreateLogger(int threshold, String name) intgetLoggerForComponent(String role, String roleHint) intReturns the current threshold for all new loggers.intgetThreshold(String role, String roleHint) voidvoidreturnComponentLogger(String role, String roleHint) voidsetThreshold(int currentThreshold) Sets the threshold for all new loggers.voidsetThreshold(String role, String roleHint, int threshold) voidsetThresholds(int currentThreshold) Sets the threshold for all loggers.Methods inherited from class org.codehaus.plexus.logging.AbstractLoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold, toMapKeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.plexus.logging.LoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold
-
Constructor Details
-
ConsoleLoggerManager
public ConsoleLoggerManager() -
ConsoleLoggerManager
This special constructor is called directly when the container is bootstrapping itself.- Parameters:
threshold- The threshold.
-
-
Method Details
-
initialize
public void initialize()- Specified by:
initializein interfaceInitializable
-
setThreshold
public void setThreshold(int currentThreshold) Description copied from interface:LoggerManagerSets 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:
setThresholdin interfaceLoggerManager- Parameters:
currentThreshold- The new threshold.
-
setThresholds
public void setThresholds(int currentThreshold) Description copied from interface:LoggerManagerSets the threshold for all loggers. It affects all the existing loggers as well as future loggers.- Specified by:
setThresholdsin interfaceLoggerManager- Parameters:
currentThreshold- The new threshold.
-
getThreshold
public int getThreshold()Description copied from interface:LoggerManagerReturns the current threshold for all new loggers.- Specified by:
getThresholdin interfaceLoggerManager- Returns:
- Returns the threshold.
-
setThreshold
- Specified by:
setThresholdin interfaceLoggerManager
-
getThreshold
- Specified by:
getThresholdin interfaceLoggerManager
-
createLogger
-
getLoggerForComponent
- Specified by:
getLoggerForComponentin interfaceLoggerManager
-
returnComponentLogger
- Specified by:
returnComponentLoggerin interfaceLoggerManager
-
getActiveLoggerCount
public int getActiveLoggerCount()- Specified by:
getActiveLoggerCountin interfaceLoggerManager
-