LoggerBackend class
#include <Core/Logger.h>
Logger backend processes trace items in the background.
This class should not usually be used directly.
Constructors, destructors, conversion operators
- LoggerBackend()
- ~LoggerBackend()
- LoggerBackend(LoggerBackend const&) deleted
Public functions
- auto operator=(LoggerBackend const&) -> LoggerBackend& deleted
- void AttachSink(ITraceSink* sink)
- Adds the sink to the list right away, the first one starts the background worker.
- void RemoveSink(ITraceSink* sink)
- Removes the sink from the list right away, the background worker stops once no sink is left.
- void Notify() noexcept
- Notifies the background worker about new entries in the queue.
- auto IsAlive() const -> bool noexcept
- Returns
trueif the background worker is alive. - auto IsWorkerThread() const -> bool noexcept
- Returns
trueif the current thread is the background worker thread. -
void InitializeBacktrace(std::
uint32_t capacity) - Initializes backtrace storage to be able to use TraceLevel::
Deferred. - void FlushBacktraceAsync() noexcept
- Writes any stored deferred entries to all sinks asynchronously.
-
void EnqueueEntryToBacktrace(std::
uint64_t timestamp, const void* functionName, const void* content, std:: uint32_t contentLength) noexcept - Enqueues the specified entry to backtrace storage.
- auto GetBacktraceFlushLevel() const -> TraceLevel noexcept
- Returns minimum trace level to trigger automatic flushing of deferred entries.
- void SetBacktraceFlushLevel(TraceLevel flushLevel) noexcept
- Sets minimum trace level to trigger automatic flushing of deferred entries.
Function documentation
void Death:: Trace:: LoggerBackend:: AttachSink(ITraceSink* sink)
Adds the sink to the list right away, the first one starts the background worker.
While the background worker is running, only the worker may change the list, Logger sends the change through the queue then.
void Death:: Trace:: LoggerBackend:: RemoveSink(ITraceSink* sink)
Removes the sink from the list right away, the background worker stops once no sink is left.
While the background worker is running, only the worker may change the list, Logger sends the change through the queue then.