CppLogging 1.0.6.0
C++ Logging Library
Loading...
Searching...
No Matches
CppLogging::ExclusiveProcessor Class Reference

Exclusive logging processor. More...

#include <exclusive_processor.h>

Inheritance diagram for CppLogging::ExclusiveProcessor:
CppLogging::Processor CppLogging::Element

Public Member Functions

 ExclusiveProcessor (const std::shared_ptr< Layout > &layout)
 Initialize exclusive logging processor with a given layout interface.
 ExclusiveProcessor (const ExclusiveProcessor &)=delete
 ExclusiveProcessor (ExclusiveProcessor &&)=delete
virtual ~ExclusiveProcessor ()=default
ExclusiveProcessoroperator= (const ExclusiveProcessor &)=delete
ExclusiveProcessoroperator= (ExclusiveProcessor &&)=delete
bool ProcessRecord (Record &record) override
 Process the given logging record through all child filters, layouts and appenders.
Public Member Functions inherited from CppLogging::Processor
 Processor (const std::shared_ptr< Layout > &layout)
 Initialize logging processor with a given layout interface.
 Processor (const Processor &)=delete
 Processor (Processor &&) noexcept=delete
virtual ~Processor ()
Processoroperator= (const Processor &)=delete
Processoroperator= (Processor &&) noexcept=delete
std::shared_ptr< Layout > & layout () noexcept
 Get the logging processor layout.
std::vector< std::shared_ptr< Filter > > & filters () noexcept
 Get collection of child filters.
std::vector< std::shared_ptr< Appender > > & appenders () noexcept
 Get collection of child appenders.
std::vector< std::shared_ptr< Processor > > & processors () noexcept
 Get collection of child processors.
bool IsStarted () const noexcept override
 Is the logging processor started?
bool Start () override
 Start the logging processor.
bool Stop () override
 Stop the logging processor.
virtual bool FilterRecord (Record &record)
 Filter the given logging record.
virtual void Flush ()
 Flush the current logging processor.

Additional Inherited Members

Protected Attributes inherited from CppLogging::Processor
std::atomic< bool > _started {true}
std::shared_ptr< Layout_layout
std::vector< std::shared_ptr< Filter > > _filters
std::vector< std::shared_ptr< Appender > > _appenders
std::vector< std::shared_ptr< Processor > > _processors

Detailed Description

Exclusive logging processor.

Exclusive logging processor filters out the given logging record and process it exclusively without providing the record to other processors.

Not thread-safe.

Definition at line 24 of file exclusive_processor.h.

Constructor & Destructor Documentation

◆ ExclusiveProcessor() [1/3]

CppLogging::ExclusiveProcessor::ExclusiveProcessor ( const std::shared_ptr< Layout > & layout)
inlineexplicit

Initialize exclusive logging processor with a given layout interface.

Parameters
layout- Logging layout interface

Definition at line 31 of file exclusive_processor.h.

◆ ExclusiveProcessor() [2/3]

CppLogging::ExclusiveProcessor::ExclusiveProcessor ( const ExclusiveProcessor & )
delete

◆ ExclusiveProcessor() [3/3]

CppLogging::ExclusiveProcessor::ExclusiveProcessor ( ExclusiveProcessor && )
delete

◆ ~ExclusiveProcessor()

virtual CppLogging::ExclusiveProcessor::~ExclusiveProcessor ( )
virtualdefault

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ ProcessRecord()

bool CppLogging::ExclusiveProcessor::ProcessRecord ( Record & record)
overridevirtual

Process the given logging record through all child filters, layouts and appenders.

Default behavior of the method will take the given logging record and process it in the following sequence:

  • all filters (if any present)
  • all layouts (if any present)
  • all appenders (if any present)
  • all sub processors (if any present)
Parameters
record- Logging record
Returns
'true' if the logging record was successfully processed, 'false' if the logging record was filtered out

Reimplemented from CppLogging::Processor.

Definition at line 13 of file exclusive_processor.cpp.


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