OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
LogSink Class Referenceabstract

#include <LogSink.h>

Inheritance diagram for LogSink:
BufferLogSink DistLogSink ScriptLogSink SpdlogSink< BaseSink > StreamLogSink RotatingLogSink

Public Member Functions

virtual ~LogSink ()=default
 
virtual void write (const LogCategory &category, LogLevel level, std::string_view message)=0
 

Static Public Member Functions

static std::unique_ptr< LogSinkcreateDefaultSink ()
 

Detailed Description

Log sink interface.

Log level handling & log formatting are done in Logger. LogSink implementations are expected to just dump the log message & do nothing else.

See also
Logger::setSink

Constructor & Destructor Documentation

◆ ~LogSink()

virtual LogSink::~LogSink ( )
virtualdefault

Member Function Documentation

◆ createDefaultSink()

std::unique_ptr< LogSink > LogSink::createDefaultSink ( )
static
Returns
Default sink for the current platform.

◆ write()

virtual void LogSink::write ( const LogCategory category,
LogLevel  level,
std::string_view  message 
)
pure virtual

Writes out the log message.

Calls into write from the Logger instance are guaranteed to be serialized with a mutex, so you don't need to do any locking in your implementation.

Parameters
categoryLog category.
levelLog level.
messageLog message.

Implemented in BufferLogSink, DistLogSink, SpdlogSink< BaseSink >, StreamLogSink, and ScriptLogSink.


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