public class

StatusLogDrip

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.logging.StatusLogDrip

Class Overview

A manager for GlobalLog#status(String, Object...) STATUS loggers. The drip may be used by client code to issue Status messages in a safer manner that calling directly to a ILogger#status(String, Object...) 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.

Summary

Public Constructors
StatusLogDrip(long period, ILogger logger)
Public Methods
boolean canSend()
Determine whether a call to #log(String, Object...) log will be successful at this time.
void forceLog(String format, Object... params)
Always send a message to the STATUS logger (i.e.
boolean log(String format, Object... params)
Potentially send a message to the STATUS logger.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StatusLogDrip (long period, ILogger logger)

Parameters
period drip period in milliseconds
logger optional logger; if null, will use the anonymous logger

Public Methods

public boolean canSend ()

Determine whether a call to #log(String, Object...) log will be successful at this time.

public void forceLog (String format, Object... params)

Always send a message to the STATUS logger (i.e. bypass the drip). This method is dangerous, it should not be called repeatedly.

public boolean log (String format, Object... params)

Potentially send a message to the STATUS logger.

Returns
  • true if the message was sent, false if it was discarded