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

Level filter. More...

#include <level_filter.h>

Inheritance diagram for CppLogging::LevelFilter:
CppLogging::Filter CppLogging::Element

Public Member Functions

 LevelFilter (Level level, bool positive=true)
 Initialize level filter with a given level value. More...
 
 LevelFilter (Level from, Level to, bool positive=true)
 Initialize level filter with a given level range. More...
 
 LevelFilter (const LevelFilter &)=delete
 
 LevelFilter (LevelFilter &&)=delete
 
virtual ~LevelFilter ()=default
 
LevelFilteroperator= (const LevelFilter &)=delete
 
LevelFilteroperator= (LevelFilter &&)=delete
 
bool positive () const noexcept
 Get the positive filtration flag. More...
 
Level from () const noexcept
 Get Level from value. More...
 
Level to () const noexcept
 Get Level to value. More...
 
void Update (Level level, bool positive=true)
 Update level filter with a given level value. More...
 
void Update (Level from, Level to, bool positive=true)
 Update level filter with a given level range. 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

Level filter.

Level filters out logging records which level filed is not matched to the given level value or range.

Thread-safe.

Definition at line 25 of file level_filter.h.

Constructor & Destructor Documentation

◆ LevelFilter() [1/4]

CppLogging::LevelFilter::LevelFilter ( Level  level,
bool  positive = true 
)
inlineexplicit

Initialize level filter with a given level value.

Parameters
level- Level value
positive- Positive filtration (default is true)

Definition at line 33 of file level_filter.h.

◆ LevelFilter() [2/4]

CppLogging::LevelFilter::LevelFilter ( Level  from,
Level  to,
bool  positive = true 
)
inlineexplicit

Initialize level filter with a given level range.

Parameters
from- Level from value
to- Level to value
positive- Positive filtration (default is true)

Definition at line 40 of file level_filter.h.

◆ LevelFilter() [3/4]

CppLogging::LevelFilter::LevelFilter ( const LevelFilter )
delete

◆ LevelFilter() [4/4]

CppLogging::LevelFilter::LevelFilter ( LevelFilter &&  )
delete

◆ ~LevelFilter()

virtual CppLogging::LevelFilter::~LevelFilter ( )
virtualdefault

Member Function Documentation

◆ FilterRecord()

bool CppLogging::LevelFilter::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 35 of file level_filter.cpp.

◆ from()

Level CppLogging::LevelFilter::from ( ) const
inlinenoexcept

Get Level from value.

Definition at line 52 of file level_filter.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ positive()

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

Get the positive filtration flag.

Definition at line 49 of file level_filter.h.

◆ to()

Level CppLogging::LevelFilter::to ( ) const
inlinenoexcept

Get Level to value.

Definition at line 54 of file level_filter.h.

◆ Update() [1/2]

void CppLogging::LevelFilter::Update ( Level  from,
Level  to,
bool  positive = true 
)

Update level filter with a given level range.

Parameters
from- Level from value
to- Level to value
positive- Positive filtration (default is true)

Definition at line 20 of file level_filter.cpp.

◆ Update() [2/2]

void CppLogging::LevelFilter::Update ( Level  level,
bool  positive = true 
)

Update level filter with a given level value.

Parameters
level- Level value
positive- Positive filtration (default is true)

Definition at line 13 of file level_filter.cpp.


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