public class LevelFilteringStatusListener extends DelegatingStatusListener
DelegatingStatusListener
that filters Status
events based on their level
(e.g. Status.INFO
, Status.WARN
, Status.ERROR
)
before forwarding the status event to the delegate.
Only those Status
events whose level is greater than or equal to
the configured level will be forwarded to the delegate StatusListener
.
For example if level is Status.WARN
, then status' whose level is
Status.WARN
or Status.ERROR
will be forwarded.
context
Constructor and Description |
---|
LevelFilteringStatusListener() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusEvent(Status status) |
int |
getLevelValue() |
void |
setDelegate(StatusListener delegate) |
void |
setLevel(String level) |
void |
setLevelValue(int levelValue) |
getDelegate, isStarted, setContext, start, stop
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager
public void addStatusEvent(Status status)
addStatusEvent
in interface StatusListener
addStatusEvent
in class DelegatingStatusListener
public void setLevel(String level)
public int getLevelValue()
public void setLevelValue(int levelValue)
public void setDelegate(StatusListener delegate)
setDelegate
in class DelegatingStatusListener
Copyright © 2020. All rights reserved.