@API(status=INTERNAL,
since="1.1")
public class LogRecordListener
extends Object
LogRecordListener is only intended for testing purposes within
JUnit's own test suite.| Constructor and Description |
|---|
LogRecordListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all existing
log records that have been
submitted to this listener. |
void |
logRecordSubmitted(LogRecord logRecord)
Inform the listener of a
LogRecord that was submitted to JUL for
processing. |
Stream<LogRecord> |
stream()
Get a stream of
log records that have been
submitted to this listener. |
Stream<LogRecord> |
stream(Class<?> clazz)
Get a stream of
log records that have been
submitted to this listener for the
logger name equal to the name of the given class. |
Stream<LogRecord> |
stream(Class<?> clazz,
Level level)
Get a stream of
log records that have been
submitted to this listener for the
logger name equal to the name of the given class at the given log level. |
public void logRecordSubmitted(LogRecord logRecord)
LogRecord that was submitted to JUL for
processing.public Stream<LogRecord> stream()
log records that have been
submitted to this listener.
As stated in the JavaDoc for LogRecord, a submitted
LogRecord should not be updated by the client application. Thus,
the LogRecords in the returned stream should only be inspected for
testing purposes and not modified in any way.
public Stream<LogRecord> stream(Class<?> clazz)
log records that have been
submitted to this listener for the
logger name equal to the name of the given class.
As stated in the JavaDoc for LogRecord, a submitted
LogRecord should not be updated by the client application. Thus,
the LogRecords in the returned stream should only be inspected for
testing purposes and not modified in any way.
clazz - the class for which to get the log records; never nullpublic Stream<LogRecord> stream(Class<?> clazz, Level level)
log records that have been
submitted to this listener for the
logger name equal to the name of the given class at the given log level.
As stated in the JavaDoc for LogRecord, a submitted
LogRecord should not be updated by the client application. Thus,
the LogRecords in the returned stream should only be inspected for
testing purposes and not modified in any way.
clazz - the class for which to get the log records; never nulllevel - the log level for which to get the log records; never nullpublic void clear()
log records that have been
submitted to this listener.Copyright © 2020. All rights reserved.