CppLogging  1.0.4.0
C++ Logging Library
Public Member Functions | List of all members
CppLogging::LoggerFilter Class Reference

Logger filter. More...

#include <logger_filter.h>

Inheritance diagram for CppLogging::LoggerFilter:
CppLogging::Filter CppLogging::Element

Public Member Functions

 LoggerFilter (const std::string &pattern, bool positive=true)
 Initialize logger filter with a given pattern. More...
 
 LoggerFilter (const LoggerFilter &)=delete
 
 LoggerFilter (LoggerFilter &&)=delete
 
virtual ~LoggerFilter ()=default
 
LoggerFilteroperator= (const LoggerFilter &)=delete
 
LoggerFilteroperator= (LoggerFilter &&)=delete
 
bool positive () const noexcept
 Get the positive filtration flag. More...
 
const std::string & pattern () const noexcept
 Get the logger 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...
 

Detailed Description

Logger filter.

Logger filters out logging records which logger filed is not matched to the given pattern.

Thread-safe.

Definition at line 26 of file logger_filter.h.

Constructor & Destructor Documentation

◆ LoggerFilter() [1/3]

CppLogging::LoggerFilter::LoggerFilter ( const std::string &  pattern,
bool  positive = true 
)
inlineexplicit

Initialize logger filter with a given pattern.

Parameters
pattern- Logger pattern
positive- Positive filtration (default is true)

Definition at line 34 of file logger_filter.h.

◆ LoggerFilter() [2/3]

CppLogging::LoggerFilter::LoggerFilter ( const LoggerFilter )
delete

◆ LoggerFilter() [3/3]

CppLogging::LoggerFilter::LoggerFilter ( LoggerFilter &&  )
delete

◆ ~LoggerFilter()

virtual CppLogging::LoggerFilter::~LoggerFilter ( )
virtualdefault

Member Function Documentation

◆ FilterRecord()

bool CppLogging::LoggerFilter::FilterRecord ( Record record)
overridevirtual

Filter the given logging record.

Parameters
record- Logging record
Returns
'true' if the logging record should be processed, 'false' if the logging record was filtered out

Implements CppLogging::Filter.

Definition at line 13 of file logger_filter.cpp.

◆ operator=() [1/2]

LoggerFilter& CppLogging::LoggerFilter::operator= ( const LoggerFilter )
delete

◆ operator=() [2/2]

LoggerFilter& CppLogging::LoggerFilter::operator= ( LoggerFilter &&  )
delete

◆ pattern()

const std::string& CppLogging::LoggerFilter::pattern ( ) const
inlinenoexcept

Get the logger pattern.

Definition at line 46 of file logger_filter.h.

◆ positive()

bool CppLogging::LoggerFilter::positive ( ) const
inlinenoexcept

Get the positive filtration flag.

Definition at line 43 of file logger_filter.h.


The documentation for this class was generated from the following files: