logahawk
Class SeverityFilter
java.lang.Object
logahawk.SeverityFilter
@ThreadSafe
public class SeverityFilter
- extends Object
Helper class to filter out log messages based on Severity
.
This class is used by classes such as SeverityFilterLogger
and SeverityFilterListener
. A single
instance of this class can be shared with multiple classes to consolidate filtering.
- See Also:
SeverityFilterLogger
,
SeverityFilterListener
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
enableMap
protected Map<Severity,Boolean> enableMap
SeverityFilter
public SeverityFilter()
- Default is
Severity
levels are enabled.
SeverityFilter
public SeverityFilter(boolean defaultValue)
getEnabled
public boolean getEnabled(Severity s)
- Returns true if the
Severity
is enabled or allowed. Conversely this returns false if log statements
with the provided Severity
should be ignored or filtered out.
setEnabled
public void setEnabled(Severity s,
boolean enabled)
setAllEnabled
public void setAllEnabled(boolean enabled)
- Performs
setEnabled(Severity, boolean)
for all Severity
values.