Class LogRecordListener
LogRecordListener
is only intended for testing purposes within
JUnit's own test suite.- Since:
- 1.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all existinglog records
that have been submitted to this listener by the current thread.void
logRecordSubmitted
(LogRecord logRecord) Inform the listener of aLogRecord
that was submitted to JUL for processing.stream()
Get a stream oflog records
that have been submitted to this listener by the current thread.Get a stream oflog records
that have been submitted to this listener by the current thread for the logger name equal to the name of the given class.Get a stream oflog records
that have been submitted to this listener by the current thread for the logger name equal to the name of the given class at the given log level.Get a stream oflog records
that have been submitted to this listener by the current thread at the given log level.
-
Constructor Details
-
LogRecordListener
public LogRecordListener()
-
-
Method Details
-
logRecordSubmitted
Inform the listener of aLogRecord
that was submitted to JUL for processing. -
stream
Get a stream oflog records
that have been submitted to this listener by the current thread.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.- See Also:
-
stream
Get a stream oflog records
that have been submitted to this listener by the current thread 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:
level
- the log level for which to get the log records; nevernull
- Since:
- 1.4
- See Also:
-
stream
Get a stream oflog records
that have been submitted to this listener by the current thread 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
- See Also:
-
stream
Get a stream oflog records
that have been submitted to this listener by the current thread 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
- See Also:
-
clear
public void clear()Clear all existinglog records
that have been submitted to this listener by the current thread.
-