public class PeriodicLogTemplate<C> extends DelegateLogTemplate<C>
isEnabled(Object)
is only true after N milliseconds from the last log.Constructor and Description |
---|
PeriodicLogTemplate(LogTemplate<C> delegate,
long period)
Constructor with other template and the required period in ms.
|
PeriodicLogTemplate(LogTemplate<C> delegate,
long period,
SimonClock clock) |
Modifier and Type | Method and Description |
---|---|
long |
getNextTime()
Get next invocation time time.
|
protected boolean |
isEnabled(C context)
Tells whether logging is enabled.
|
boolean |
isNextTimePassed()
Indicates whether next timestamp is in past.
|
protected void |
log(String message)
Logs a message.
|
getDelegate
log
public PeriodicLogTemplate(LogTemplate<C> delegate, long period)
delegate
- concrete log templateperiod
- logging period in millisecondspublic PeriodicLogTemplate(LogTemplate<C> delegate, long period, SimonClock clock)
public long getNextTime()
public boolean isNextTimePassed()
protected boolean isEnabled(C context)
isEnabled
in class DelegateLogTemplate<C>
protected void log(String message)
log
in class DelegateLogTemplate<C>
Copyright © 2019. All rights reserved.