Package org.sosy_lab.common.log
Class LogManagerWithoutDuplicates
java.lang.Object
org.sosy_lab.common.log.ForwardingLogManager
org.sosy_lab.common.log.LogManagerWithoutDuplicates
- All Implemented Interfaces:
LogManager
LogManager implementation which helps to get log messages printed only once, and avoid duplicate
messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogManagerdelegate()voidLogging method similar toForwardingLogManager.logf(Level, String, Object...), however, subsequent calls to this method with the same arguments will be silently ignored.voidLogging method similar toForwardingLogManager.log(Level, Object...), however, subsequent calls to this method with the same arguments will be silently ignored.voidLogging method similar toForwardingLogManager.log(Level, Supplier), however, subsequent calls to this method with the same arguments will be silently ignored.voidReset all seen log messages, such thatlogfOnce(Level, String, Object...)andlogfOnce(Level, String, Object...)will be guaranteed to behave exactly like in a fresh instance of this class.withComponentName(String pName) This method returns a new LogManagerWithoutDuplicates, which does not share state with the current instance (i.e., it is possible to log the same message both through the old and the new instance once).Methods inherited from class org.sosy_lab.common.log.ForwardingLogManager
flush, log, log, logDebugException, logDebugException, logException, logf, logfDebugException, logfException, logfUserException, logUserException, wouldBeLoggedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sosy_lab.common.log.LogManager
flush, log, log, logDebugException, logDebugException, logException, logf, logfDebugException, logfException, logfUserException, logUserException, wouldBeLogged
-
Constructor Details
-
LogManagerWithoutDuplicates
-
-
Method Details
-
delegate
- Specified by:
delegatein classForwardingLogManager
-
withComponentName
This method returns a new LogManagerWithoutDuplicates, which does not share state with the current instance (i.e., it is possible to log the same message both through the old and the new instance once).- Specified by:
withComponentNamein interfaceLogManager- Parameters:
pName- A non-empty string.- Returns:
- A LogManager instance.
- See Also:
-
logOnce
Logging method similar toForwardingLogManager.log(Level, Object...), however, subsequent calls to this method with the same arguments will be silently ignored. Direct calls toForwardingLogManager.log(Level, Object...)are not affected.Make sure to call this method only with immutable parameters, such as Strings! If objects are changed after being passed to this method, detecting duplicate log messages may not work, or too many log messages may be ignored.
-
logOnce
Logging method similar toForwardingLogManager.log(Level, Supplier), however, subsequent calls to this method with the same arguments will be silently ignored. Direct calls toForwardingLogManager.log(Level, Supplier)are not affected.Make sure to call this method only with immutable parameters, such as Strings! If objects are changed after being passed to this method, detecting duplicate log messages may not work, or too many log messages may be ignored.
-
logfOnce
Logging method similar toForwardingLogManager.logf(Level, String, Object...), however, subsequent calls to this method with the same arguments will be silently ignored. Direct calls toForwardingLogManager.logf(Level, String, Object...)are not affected.Make sure to call this method only with immutable parameters, such as Strings! If objects are changed after being passed to this method, detecting duplicate log messages may not work, or too many log messages may be ignored.
-
resetSeenMessages
public void resetSeenMessages()Reset all seen log messages, such thatlogfOnce(Level, String, Object...)andlogfOnce(Level, String, Object...)will be guaranteed to behave exactly like in a fresh instance of this class.
-