Package org.codehaus.plexus.logging
Class BaseLoggerManager
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLoggerManager
-
- org.codehaus.plexus.logging.BaseLoggerManager
-
- All Implemented Interfaces:
LoggerManager,Initializable
public abstract class BaseLoggerManager extends AbstractLoggerManager implements Initializable
Base class for all LoggerManagers which use cache of Loggers.
-
-
Field Summary
Fields Modifier and Type Field Description private intcurrentThresholdprivate java.util.MaploggerCacheprivate java.lang.Stringthreshold-
Fields inherited from interface org.codehaus.plexus.logging.LoggerManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description BaseLoggerManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract LoggercreateLogger(java.lang.String key)intgetActiveLoggerCount()LoggergetLoggerForComponent(java.lang.String role, java.lang.String roleHint)intgetThreshold()Returns the current threshold for all new loggers.intgetThreshold(java.lang.String role, java.lang.String roleHint)java.lang.StringgetThresholdAsString()voidinitialize()protected intparseThreshold(java.lang.String text)voidreturnComponentLogger(java.lang.String role, java.lang.String roleHint)voidsetThreshold(int currentThreshold)Sets the threshold for all new loggers.voidsetThreshold(java.lang.String role, java.lang.String roleHint, int threshold)voidsetThresholds(int currentThreshold)Sets the threshold for all new loggers.-
Methods inherited from class org.codehaus.plexus.logging.AbstractLoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold, toMapKey
-
-
-
-
Method Detail
-
initialize
public void initialize()
- Specified by:
initializein interfaceInitializable
-
parseThreshold
protected int parseThreshold(java.lang.String text)
-
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:
setThresholdin interfaceLoggerManager- Parameters:
currentThreshold- The new threshold.
-
setThresholds
public void setThresholds(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:
setThresholdsin interfaceLoggerManager- Parameters:
currentThreshold- The new threshold.
-
getThreshold
public int getThreshold()
Returns the current threshold for all new loggers.- Specified by:
getThresholdin interfaceLoggerManager- Returns:
- Returns the current threshold for all new loggers.
-
setThreshold
public void setThreshold(java.lang.String role, java.lang.String roleHint, int threshold)- Specified by:
setThresholdin interfaceLoggerManager
-
getThreshold
public int getThreshold(java.lang.String role, java.lang.String roleHint)- Specified by:
getThresholdin interfaceLoggerManager
-
getLoggerForComponent
public Logger getLoggerForComponent(java.lang.String role, java.lang.String roleHint)
- Specified by:
getLoggerForComponentin interfaceLoggerManager
-
createLogger
protected abstract Logger createLogger(java.lang.String key)
-
returnComponentLogger
public void returnComponentLogger(java.lang.String role, java.lang.String roleHint)- Specified by:
returnComponentLoggerin interfaceLoggerManager
-
getActiveLoggerCount
public int getActiveLoggerCount()
- Specified by:
getActiveLoggerCountin interfaceLoggerManager
-
getThresholdAsString
public java.lang.String getThresholdAsString()
-
-