Belle II Software development
|
Implements a log connection that filters repeated messages. More...
#include <LogConnectionFilter.h>
Public Member Functions | |
LogConnectionFilter (LogConnectionBase *logConnection) | |
The constructor. | |
virtual | ~LogConnectionFilter () |
The LogConnectionFilter destructor. | |
bool | sendMessage (const LogMessage &message) override |
Sends a log message. | |
bool | isConnected () override |
Returns true if the log connection could be established. | |
void | finalizeOnAbort () override |
Finalize on Abort: make sure last repetition is printed if there is any and that connected connection is also finalized. | |
Private Member Functions | |
void | printRepetitions () |
If there are repeated messages print the number of repetitions. | |
Private Attributes | |
std::unique_ptr< LogConnectionBase > | m_logConnection |
The actual log connection. | |
LogMessage | m_previousMessage |
The previous log message. | |
int | m_repeatCounter |
Counter for repeated messages. | |
Implements a log connection that filters repeated messages.
This connection can be used to prevent printing of the same message again and again. Messages are suppressed if they match with the one previously sent.
Definition at line 28 of file LogConnectionFilter.h.
|
explicit |
The constructor.
logConnection | The log connection that actually prints the messages. |
Definition at line 14 of file LogConnectionFilter.cc.
|
virtual |
The LogConnectionFilter destructor.
Definition at line 22 of file LogConnectionFilter.cc.
|
inlineoverridevirtual |
Finalize on Abort: make sure last repetition is printed if there is any and that connected connection is also finalized.
Reimplemented from LogConnectionBase.
Definition at line 62 of file LogConnectionFilter.h.
|
overridevirtual |
Returns true if the log connection could be established.
Implements LogConnectionBase.
Definition at line 28 of file LogConnectionFilter.cc.
|
private |
If there are repeated messages print the number of repetitions.
Definition at line 51 of file LogConnectionFilter.cc.
|
overridevirtual |
Sends a log message.
message | The log message object. |
Implements LogConnectionBase.
Definition at line 34 of file LogConnectionFilter.cc.
|
private |
The actual log connection.
Definition at line 72 of file LogConnectionFilter.h.
|
private |
The previous log message.
Definition at line 73 of file LogConnectionFilter.h.
|
private |
Counter for repeated messages.
Definition at line 74 of file LogConnectionFilter.h.