CppLogging 1.0.5.0
C++ Logging Library
Loading...
Searching...
No Matches
sync_processor.h
Go to the documentation of this file.
1
9#ifndef CPPLOGGING_PROCESSORS_SYNC_PROCESSOR_H
10#define CPPLOGGING_PROCESSORS_SYNC_PROCESSOR_H
11
12#include "logging/processor.h"
13
14#include "threads/critical_section.h"
15
16namespace CppLogging {
17
19
27{
28public:
30
33 explicit SyncProcessor(const std::shared_ptr<Layout>& layout) : Processor(layout) {}
34 SyncProcessor(const SyncProcessor&) = delete;
36 virtual ~SyncProcessor() = default;
37
40
41 // Implementation of Processor
42 bool ProcessRecord(Record& record) override;
43 void Flush() override;
44
45private:
46 CppCommon::CriticalSection _lock;
47};
48
49} // namespace CppLogging
50
53#endif // CPPLOGGING_PROCESSORS_SYNC_PROCESSOR_H
Logging processor interface.
Definition processor.h:31
std::shared_ptr< Layout > & layout() noexcept
Get the logging processor layout.
Definition processor.h:46
Logging record.
Definition record.h:37
Synchronous logging processor.
void Flush() override
Flush the current logging processor.
bool ProcessRecord(Record &record) override
Process the given logging record through all child filters, layouts and appenders.
SyncProcessor(SyncProcessor &&)=delete
SyncProcessor(const SyncProcessor &)=delete
SyncProcessor & operator=(const SyncProcessor &)=delete
SyncProcessor & operator=(SyncProcessor &&)=delete
virtual ~SyncProcessor()=default
SyncProcessor(const std::shared_ptr< Layout > &layout)
Initialize synchronous logging processor with a given layout interface.
C++ Logging project definitions.
Definition appender.h:15
Logging processor interface definition.