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) StringThe prefix to place before each status message(package private) longFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatusEvent(Status status) protected abstract PrintStreamThe PrintStream used by derived classeslongprivate booleanisElapsedTimeLongerThanThreshold(long now, long timestamp) booleanprivate voidprivate voidPrint status messages retrospectivelyvoidvoidsetRetrospective(long retrospective) voidstart()Invoking the start method can cause the instance to print status messages created less than value of retrospectiveThresold.voidstop()Methods inherited from class 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
-
-
Constructor Details
-
OnPrintStreamStatusListenerBase
public OnPrintStreamStatusListenerBase()
-
-
Method Details
-
getPrintStream
-
print
-
addStatusEvent
- Specified by:
addStatusEventin interfaceStatusListener
-
retrospectivePrint
private void retrospectivePrint()Print status messages retrospectively -
isElapsedTimeLongerThanThreshold
private boolean isElapsedTimeLongerThanThreshold(long now, long timestamp) -
start
-
getPrefix
-
setPrefix
-
setRetrospective
public void setRetrospective(long retrospective) -
getRetrospective
public long getRetrospective() -
stop
-
isStarted
-