Package ch.qos.logback.core.status
Class OnPrintStreamStatusListenerBase
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.status.OnPrintStreamStatusListenerBase
- All Implemented Interfaces:
ContextAware
,LifeCycle
,StatusListener
- Direct Known Subclasses:
OnConsoleStatusListener
,OnErrorConsoleStatusListener
public abstract class OnPrintStreamStatusListenerBase
extends ContextAwareBase
implements StatusListener, LifeCycle
Print all new incoming status messages on the on the designated PrintStream.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final long
(package private) boolean
(package private) String
The prefix to place before each status message(package private) long
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusEvent
(Status status) protected abstract PrintStream
The PrintStream used by derived classeslong
private boolean
isElapsedTimeLongerThanThreshold
(long now, long timestamp) boolean
private void
private void
Print status messages retrospectivelyvoid
void
setRetrospective
(long retrospective) void
start()
Invoking the start method can cause the instance to print status messages created less than value of retrospectiveThresold.void
stop()
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Field Details
-
isStarted
boolean isStarted -
DEFAULT_RETROSPECTIVE
static final long DEFAULT_RETROSPECTIVE- See Also:
-
retrospectiveThresold
long retrospectiveThresold -
prefix
String prefixThe prefix to place before each status message- Since:
- 1.1.10
-
-
Constructor Details
-
OnPrintStreamStatusListenerBase
public OnPrintStreamStatusListenerBase()
-
-
Method Details
-
getPrintStream
The PrintStream used by derived classes- Returns:
-
print
-
addStatusEvent
- Specified by:
addStatusEvent
in interfaceStatusListener
-
retrospectivePrint
private void retrospectivePrint()Print status messages retrospectively -
isElapsedTimeLongerThanThreshold
private boolean isElapsedTimeLongerThanThreshold(long now, long timestamp) -
start
public void start()Invoking the start method can cause the instance to print status messages created less than value of retrospectiveThresold. -
getPrefix
-
setPrefix
-
setRetrospective
public void setRetrospective(long retrospective) -
getRetrospective
public long getRetrospective() -
stop
public void stop() -
isStarted
public boolean isStarted()
-