com.sodius.mdw.core.util.log
Class LogRecorder

java.lang.Object
  extended by com.sodius.mdw.core.util.log.AbstractLogger
      extended by com.sodius.mdw.core.util.log.LogRecorder
All Implemented Interfaces:
Logger

public class LogRecorder
extends AbstractLogger

Creates records of logged information.

Clients may instantiate or subclass this class.


Nested Class Summary
static class LogRecorder.Record
          A Record keeps track of a logged information.
 
Constructor Summary
LogRecorder()
           
 
Method Summary
 void clear()
          Removes all records from this logger.
 List<LogRecorder.Record> getRecords()
          Return the list of recorded logged information.
protected  void log(Level level, Object message, Throwable error)
          Creates a record with the specified log information.
protected  void recorded(LogRecorder.Record record)
          Called when a record is created.
 
Methods inherited from class com.sodius.mdw.core.util.log.AbstractLogger
createMessage, debug, debug, debug, error, error, error, getLevel, info, info, info, isLoggable, setLevel, warning, warning, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogRecorder

public LogRecorder()
Method Detail

getRecords

public List<LogRecorder.Record> getRecords()
Return the list of recorded logged information.

Returns:
an unmodifiable list of Record elements.

clear

public void clear()
Removes all records from this logger.


log

protected void log(Level level,
                   Object message,
                   Throwable error)
Creates a record with the specified log information.

Specified by:
log in class AbstractLogger
Parameters:
level - the log level (known to be loggable).
message - the information to log (usually a String), maybe null.
error - an exception to log, maybe null.

recorded

protected void recorded(LogRecorder.Record record)
Called when a record is created. This default implementation does nothing.

Parameters:
record - the created record