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 long
DEFAULT_RETROSPECTIVE
(package private) boolean
isStarted
(package private) java.lang.String
prefix
The prefix to place before each status message(package private) long
retrospectiveThresold
-
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 void
addStatusEvent(Status status)
java.lang.String
getPrefix()
protected abstract java.io.PrintStream
getPrintStream()
The PrintStream used by derived classeslong
getRetrospective()
private boolean
isElapsedTimeLongerThanThreshold(long now, long timestamp)
boolean
isStarted()
private void
print(Status status)
private void
retrospectivePrint()
Print status messages retrospectivelyvoid
setPrefix(java.lang.String prefix)
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 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:
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
public java.lang.String getPrefix()
-
setPrefix
public void setPrefix(java.lang.String prefix)
-
setRetrospective
public void setRetrospective(long retrospective)
-
getRetrospective
public long getRetrospective()
-
-