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

Switch filter. More...

#include <switch_filter.h>

Inheritance diagram for CppLogging::SwitchFilter:
CppLogging::Filter CppLogging::Element

Public Member Functions

 SwitchFilter (bool enabled)
 Initialize switch filter with a given enabled flag. More...
 
 SwitchFilter (const SwitchFilter &)=delete
 
 SwitchFilter (SwitchFilter &&)=delete
 
virtual ~SwitchFilter ()=default
 
SwitchFilteroperator= (const SwitchFilter &)=delete
 
SwitchFilteroperator= (SwitchFilter &&)=delete
 
bool enabled () const noexcept
 Get the filter enabled flag. More...
 
void Update (bool enabled)
 Update switch filter with a given enabled flag. 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

Switch filter.

Switch filters is used to turn on/off logging.

Thread-safe.

Definition at line 24 of file switch_filter.h.

Constructor & Destructor Documentation

◆ SwitchFilter() [1/3]

CppLogging::SwitchFilter::SwitchFilter ( bool  enabled)
inlineexplicit

Initialize switch filter with a given enabled flag.

Parameters
enabled- Enabled flag

Definition at line 31 of file switch_filter.h.

◆ SwitchFilter() [2/3]

CppLogging::SwitchFilter::SwitchFilter ( const SwitchFilter )
delete

◆ SwitchFilter() [3/3]

CppLogging::SwitchFilter::SwitchFilter ( SwitchFilter &&  )
delete

◆ ~SwitchFilter()

virtual CppLogging::SwitchFilter::~SwitchFilter ( )
virtualdefault

Member Function Documentation

◆ enabled()

bool CppLogging::SwitchFilter::enabled ( ) const
inlinenoexcept

Get the filter enabled flag.

Definition at line 40 of file switch_filter.h.

◆ FilterRecord()

bool CppLogging::SwitchFilter::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 18 of file switch_filter.cpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Update()

void CppLogging::SwitchFilter::Update ( bool  enabled)

Update switch filter with a given enabled flag.

Parameters
enabled- Enabled flag

Definition at line 13 of file switch_filter.cpp.


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