Class StatusLogDrip

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

public class StatusLogDrip extends Object
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

      public StatusLogDrip(long period, ILogger logger)
      Parameters:
      period - drip period in milliseconds
      logger - optional logger; if null, will use the anonymous logger
  • Method Details

    • canSend

      public boolean canSend()
      Determine whether a call to log will be successful at this time.
      Returns:
    • log

      public boolean log(String format, Object... params)
      Potentially send a message to the STATUS logger.
      Parameters:
      format -
      params -
      Returns:
      true if the message was sent, false if it was discarded
    • forceLog

      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.
      Parameters:
      format -
      params -