public class LogRecorder extends AbstractLogger
Clients may instantiate or subclass this class.
Modifier and Type | Class and Description |
---|---|
static class |
LogRecorder.Record
A
Record keeps track of a logged information. |
Constructor and Description |
---|
LogRecorder() |
Modifier and Type | Method and Description |
---|---|
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.
|
public List<LogRecorder.Record> getRecords()
Record
elements.public void clear()
protected void log(Level level, Object message, Throwable error)
log
in class AbstractLogger
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
.protected void recorded(LogRecorder.Record record)
record
- the created record