- java.lang.Object
-
- java.util.logging.Handler
-
- de.carne.util.logging.LogRecorder.Session
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Enclosing class:
- LogRecorder
public class LogRecorder.Session extends java.util.logging.Handler implements java.lang.AutoCloseableThis class represents a running recording session.- See Also:
LogRecorder.start(boolean),close()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()LogRecorder.SessionexcludeThread(java.util.function.Predicate<java.lang.Thread> exclude)Add an exclude Predicate to the LogRecorder.Session.voidflush()java.util.Collection<java.util.logging.LogRecord>getRecords()Get the LogRecords that have been recorded by this LogRecorder.Session so far.LogRecorder.SessionincludeThread(java.util.function.Predicate<java.lang.Thread> include)Add an include Predicate to the session.voidpublish(@Nullable java.util.logging.LogRecord logRecord)
-
-
-
Method Detail
-
includeThread
public LogRecorder.Session includeThread(java.util.function.Predicate<java.lang.Thread> include)
Add an include Predicate to the session.To be recorded an issued LogRecord's thread must match at least one of the include Predicates.
- Parameters:
include- The include Predicate to apply.- Returns:
- The updated LogRecorder.Session.
-
excludeThread
public LogRecorder.Session excludeThread(java.util.function.Predicate<java.lang.Thread> exclude)
Add an exclude Predicate to the LogRecorder.Session.To be recorded an issued LogRecord's thread must not match any of the exclude Predicates.
- Parameters:
exclude- The exclude Predicate to apply.- Returns:
- The updated LogRecorder.Session.
-
getRecords
public java.util.Collection<java.util.logging.LogRecord> getRecords()
Get the LogRecords that have been recorded by this LogRecorder.Session so far.- Returns:
- The recorded LogRecords.
-
publish
public void publish(@Nullable java.util.logging.LogRecord logRecord)
- Specified by:
publishin classjava.util.logging.Handler
-
flush
public void flush()
- Specified by:
flushin classjava.util.logging.Handler
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classjava.util.logging.Handler
-
-