MCPcopy Create free account
hub / github.com/chronoxor/CppLogging / SyncProcessor

Class SyncProcessor

include/logging/processors/sync_processor.h:26–47  ·  view source on GitHub ↗

Synchronous logging processor ! Synchronous logging processor process the given logging record under the critical section to avoid races in not thread-safe layouts, filters and appenders. Thread-safe. */

Source from the content-addressed store, hash-verified

24 Thread-safe.
25*/
26class SyncProcessor : public Processor
27{
28public:
29 //! Initialize synchronous logging processor with a given layout interface
30 /*!
31 \param layout - Logging layout interface
32 */
33 explicit SyncProcessor(const std::shared_ptr<Layout>& layout) : Processor(layout) {}
34 SyncProcessor(const SyncProcessor&) = delete;
35 SyncProcessor(SyncProcessor&&) = delete;
36 virtual ~SyncProcessor() = default;
37
38 SyncProcessor& operator=(const SyncProcessor&) = delete;
39 SyncProcessor& operator=(SyncProcessor&&) = delete;
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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected