Package com.pnfsoftware.jeb.util.logging
Class StatusLogDrip
java.lang.Object
com.pnfsoftware.jeb.util.logging.StatusLogDrip
A manager for
STATUS
loggers. The drip may be used by
client code to issue Status
messages in a safer manner that calling directly to a
logger's status method
.
The drip period is used to specify the minimum waiting time between two status messages. Messages sent too early are discarded.
-
Constructor Details
-
StatusLogDrip
- Parameters:
period
- drip period in millisecondslogger
- optional logger; if null, will use theanonymous logger
-
-
Method Details
-
canSend
public boolean canSend()Determine whether a call tolog
will be successful at this time.- Returns:
-
log
Potentially send a message to the STATUS logger.- Parameters:
format
-params
-- Returns:
- true if the message was sent, false if it was discarded
-
forceLog
Always send a message to the STATUS logger (i.e. bypass the drip). This method is dangerous, it should not be called repeatedly.- Parameters:
format
-params
-
-