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
Fields Modifier and Type Field Description (package private) static longDEFAULT_RETROSPECTIVE(package private) booleanisStarted(package private) java.lang.StringprefixThe prefix to place before each status message(package private) longretrospectiveThresold-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description OnPrintStreamStatusListenerBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddStatusEvent(Status status)java.lang.StringgetPrefix()protected abstract java.io.PrintStreamgetPrintStream()The PrintStream used by derived classeslonggetRetrospective()private booleanisElapsedTimeLongerThanThreshold(long now, long timestamp)booleanisStarted()private voidprint(Status status)private voidretrospectivePrint()Print status messages retrospectivelyvoidsetPrefix(java.lang.String prefix)voidsetRetrospective(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 ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Field Detail
-
isStarted
boolean isStarted
-
DEFAULT_RETROSPECTIVE
static final long DEFAULT_RETROSPECTIVE
- See Also:
- Constant Field Values
-
retrospectiveThresold
long retrospectiveThresold
-
prefix
java.lang.String prefix
The prefix to place before each status message- Since:
- 1.1.10
-
-
Method Detail
-
getPrintStream
protected abstract java.io.PrintStream getPrintStream()
The PrintStream used by derived classes- Returns:
-
print
private void print(Status status)
-
addStatusEvent
public void addStatusEvent(Status status)
- Specified by:
addStatusEventin 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
public java.lang.String getPrefix()
-
setPrefix
public void setPrefix(java.lang.String prefix)
-
setRetrospective
public void setRetrospective(long retrospective)
-
getRetrospective
public long getRetrospective()
-
-