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

Logging trigger. More...

#include <trigger.h>

Inheritance diagram for CppLogging::Trigger:
CppLogging::Filter CppLogging::Element

Public Member Functions

 Trigger (bool state=true)
 Initialize trigger with an initial logging state (enabled or disabled) More...
 
 Trigger (const Trigger &)=delete
 
 Trigger (Trigger &&)=delete
 
virtual ~Trigger ()=default
 
Triggeroperator= (const Trigger &)=delete
 
Triggeroperator= (Trigger &&)=delete
 
bool IsEnabled () noexcept
 Is logging enabled? More...
 
void Enable () noexcept
 Enable logging. More...
 
void Disable () noexcept
 Disable logging. More...
 
void Toggle () noexcept
 Toggle logging. 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

Logging trigger.

Logging trigger is a special filter that allows to enable or disable logging.

Thread-safe.

Definition at line 24 of file trigger.h.

Constructor & Destructor Documentation

◆ Trigger() [1/3]

CppLogging::Trigger::Trigger ( bool  state = true)
inlineexplicit

Initialize trigger with an initial logging state (enabled or disabled)

Parameters
state- Initial logging state (default is true)

Definition at line 31 of file trigger.h.

◆ Trigger() [2/3]

CppLogging::Trigger::Trigger ( const Trigger )
delete

◆ Trigger() [3/3]

CppLogging::Trigger::Trigger ( Trigger &&  )
delete

◆ ~Trigger()

virtual CppLogging::Trigger::~Trigger ( )
virtualdefault

Member Function Documentation

◆ Disable()

void CppLogging::Trigger::Disable ( )
inlinenoexcept

Disable logging.

Definition at line 45 of file trigger.h.

◆ Enable()

void CppLogging::Trigger::Enable ( )
inlinenoexcept

Enable logging.

Definition at line 43 of file trigger.h.

◆ FilterRecord()

bool CppLogging::Trigger::FilterRecord ( Record record)
inlineoverridevirtual

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 50 of file trigger.h.

◆ IsEnabled()

bool CppLogging::Trigger::IsEnabled ( )
inlinenoexcept

Is logging enabled?

Definition at line 40 of file trigger.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Toggle()

void CppLogging::Trigger::Toggle ( )
inlinenoexcept

Toggle logging.

Definition at line 47 of file trigger.h.


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