Class LogRecordListener
- java.lang.Object
-
- org.junit.platform.commons.logging.LogRecordListener
-
-
Constructor Summary
Constructors Constructor Description LogRecordListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear all existinglog records
that have been submitted to this listener.void
logRecordSubmitted(LogRecord logRecord)
Inform the listener of aLogRecord
that was submitted to JUL for processing.Stream<LogRecord>
stream()
Get a stream oflog records
that have been submitted to this listener.Stream<LogRecord>
stream(Class<?> clazz)
Get a stream oflog 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 oflog 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.
-
-
-
Method Detail
-
logRecordSubmitted
public void logRecordSubmitted(LogRecord logRecord)
Inform the listener of aLogRecord
that was submitted to JUL for processing.
-
stream
public Stream<LogRecord> stream()
Get a stream oflog records
that have been submitted to this listener.As stated in the JavaDoc for
LogRecord
, a submittedLogRecord
should not be updated by the client application. Thus, theLogRecords
in the returned stream should only be inspected for testing purposes and not modified in any way.
-
stream
public Stream<LogRecord> stream(Class<?> clazz)
Get a stream oflog 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 submittedLogRecord
should not be updated by the client application. Thus, theLogRecords
in the returned stream should only be inspected for testing purposes and not modified in any way.- Parameters:
clazz
- the class for which to get the log records; nevernull
-
stream
public Stream<LogRecord> stream(Class<?> clazz, Level level)
Get a stream oflog 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 submittedLogRecord
should not be updated by the client application. Thus, theLogRecords
in the returned stream should only be inspected for testing purposes and not modified in any way.- Parameters:
clazz
- the class for which to get the log records; nevernull
level
- the log level for which to get the log records; nevernull
-
clear
public void clear()
Clear all existinglog records
that have been submitted to this listener.
-
-