public final class LogRecorder
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
LogRecorder.Session
This class represents a running recording session.
|
| Constructor and Description |
|---|
LogRecorder(java.util.logging.Level level)
Construct LogRecorder.
|
| Modifier and Type | Method and Description |
|---|---|
LogRecorder |
addLog(Log log)
Add a Log instance to the LogRecorder for recording.
|
LogRecorder |
addLogger(java.util.logging.Logger logger)
Add a Logger instance to the LogRecorder for recording.
|
LogRecorder |
excludeRecord(java.util.function.Predicate<java.util.logging.LogRecord> exclude)
Add an exclude Predicate to the recorder.
|
LogRecorder |
includeRecord(java.util.function.Predicate<java.util.logging.LogRecord> include)
Add an include Predicate to the recorder.
|
LogRecorder.Session |
start(boolean currentThreadOnly)
Start the recording LogRecorder.Session.
|
public LogRecorder(java.util.logging.Level level)
level - The Level to use for LogRecord filtering (all LogRecords
below this level are ignored).public LogRecorder includeRecord(java.util.function.Predicate<java.util.logging.LogRecord> include)
To be recorded an issued LogRecord must match at least one of the include Predicates.
include - The include Predicate to apply.public LogRecorder excludeRecord(java.util.function.Predicate<java.util.logging.LogRecord> exclude)
To be recorded an issued LogRecord must not match any of the exclude Predicates.
exclude - The exclude Predicate to apply.public LogRecorder addLog(Log log)
log - The Log instance to add to the recording.public LogRecorder addLogger(java.util.logging.Logger logger)
logger - The Logger instance to add to the recording.public LogRecorder.Session start(boolean currentThreadOnly)
After this method has been invoked the LogRecorder collects all LogRecords that
currentThreadOnly - Whether to include only LogRecords issued by the current
Thread.