CppLogging
1.0.4.0
C++ Logging Library
|
Message filter. More...
#include <message_filter.h>
Public Member Functions | |
MessageFilter (const std::regex &pattern, bool positive=true) | |
Initialize message filter with a given regular expression pattern. More... | |
MessageFilter (const MessageFilter &)=delete | |
MessageFilter (MessageFilter &&)=delete | |
virtual | ~MessageFilter ()=default |
MessageFilter & | operator= (const MessageFilter &)=delete |
MessageFilter & | operator= (MessageFilter &&)=delete |
bool | positive () const noexcept |
Get the positive filtration flag. More... | |
const std::regex & | pattern () const noexcept |
Get the message regular expression pattern. More... | |
bool | FilterRecord (Record &record) override |
Filter the given logging record. More... | |
Public Member Functions inherited from CppLogging::Element | |
virtual bool | IsStarted () const noexcept |
Is the logging element started? More... | |
virtual bool | Start () |
Start the logging element. More... | |
virtual bool | Stop () |
Stop the logging element. More... | |
Message filter.
Message filters out logging records which message field is not matched to the given regular expression pattern.
Thread-safe.
Definition at line 26 of file message_filter.h.
|
inlineexplicit |
Initialize message filter with a given regular expression pattern.
pattern | - Regular expression pattern |
positive | - Positive filtration (default is true) |
Definition at line 34 of file message_filter.h.
|
delete |
|
delete |
|
virtualdefault |
|
overridevirtual |
Filter the given logging record.
record | - Logging record |
Implements CppLogging::Filter.
Definition at line 13 of file message_filter.cpp.
|
delete |
|
delete |
|
inlinenoexcept |
Get the message regular expression pattern.
Definition at line 46 of file message_filter.h.
|
inlinenoexcept |
Get the positive filtration flag.
Definition at line 43 of file message_filter.h.