Interface Log

All Known Implementing Classes:
LocalLog, RemoteLogClient

public interface Log

A Log collects and performs computations on LogRecords. This is an interface because we may implement logs different, e.g. as a local array, as a Collection, as a remote server or database, etc.


Method Summary
 void add(LogRecord record)
          Stores a LogRecord in the Log if it matches the current filter (as set by setFilter, below).
 LogRecord[] getAll(long windowMS)
          Returns all LogRecords whose timestamps are within a window of time.
 void setFilter(java.lang.String pattern)
          Sets a regular-expression filter on what events are stored.
 

Method Detail

add

public void add(LogRecord record)
Stores a LogRecord in the Log if it matches the current filter (as set by setFilter, below).


getAll

public LogRecord[] getAll(long windowMS)
Returns all LogRecords whose timestamps are within a window of time. Note that inclusion is based on the timestamp of the LogRecord, not the time at which the record was stored in the Log.

Parameters:
windowMS - return all records from the last [windowMS] milliseconds.

setFilter

public void setFilter(java.lang.String pattern)
Sets a regular-expression filter on what events are stored.

Parameters:
pattern - is a regular expression to match against; if the event portion of a LogRecord passed to add, above, matches this expression, then the LogRecord is retained, and is otherwise discarded.