9 #ifndef CPPLOGGING_PROCESSORS_ASYNC_WAIT_PROCESSOR_H
10 #define CPPLOGGING_PROCESSORS_ASYNC_WAIT_PROCESSOR_H
14 #include "threads/wait_batcher.h"
47 explicit AsyncWaitProcessor(
const std::shared_ptr<Layout>&
layout,
bool auto_start =
true,
size_t capacity = 8192,
size_t initial = 8192,
const std::function<
void ()>& on_thread_initialize = [](){},
const std::function<void ()>& on_thread_clenup = [](){});
56 bool Start()
override;
59 void Flush()
override;
62 CppCommon::WaitBatcher<Record> _queue;
64 std::function<void ()> _on_thread_initialize;
65 std::function<void ()> _on_thread_clenup;
67 bool EnqueueRecord(
Record& record);
68 void ProcessThread(
const std::function<
void ()>& on_thread_initialize,
const std::function<
void ()>& on_thread_clenup);
Asynchronous wait logging processor.
AsyncWaitProcessor(AsyncWaitProcessor &&)=delete
AsyncWaitProcessor(const std::shared_ptr< Layout > &layout, bool auto_start=true, size_t capacity=8192, size_t initial=8192, const std::function< void()> &on_thread_initialize=[](){}, const std::function< void()> &on_thread_clenup=[](){})
Initialize asynchronous processor with a given layout interface.
AsyncWaitProcessor & operator=(AsyncWaitProcessor &&)=delete
AsyncWaitProcessor & operator=(const AsyncWaitProcessor &)=delete
AsyncWaitProcessor(const AsyncWaitProcessor &)=delete
bool ProcessRecord(Record &record) override
Process the given logging record through all child filters, layouts and appenders.
virtual ~AsyncWaitProcessor()
bool Start() override
Start the logging processor.
void Flush() override
Flush the current logging processor.
bool Stop() override
Stop the logging processor.
Logging processor interface.
std::shared_ptr< Layout > & layout() noexcept
Get the logging processor layout.
C++ Logging project definitions.
Logging processor interface definition.