OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
StreamLogSink Class Reference

#include <StreamLogSink.h>

Inheritance diagram for StreamLogSink:
LogSink RotatingLogSink

Public Member Functions

 StreamLogSink (std::unique_ptr< OutputStream > stream)
 
 StreamLogSink (OutputStream *stream)
 
virtual ~StreamLogSink ()
 
virtual void write (const LogCategory &category, LogLevel level, std::string_view message) override
 
- Public Member Functions inherited from LogSink
virtual ~LogSink ()=default
 
virtual void write (const LogCategory &category, LogLevel level, std::string_view message)=0
 

Private Member Functions

void initFormatter ()
 

Private Attributes

std::unique_ptr< OutputStream_ownStream
 
OutputStream_stream = nullptr
 
std::unique_ptr< spdlog::formatter > _formatter
 

Additional Inherited Members

- Static Public Member Functions inherited from LogSink
static std::unique_ptr< LogSinkcreateDefaultSink ()
 

Constructor & Destructor Documentation

◆ StreamLogSink() [1/2]

StreamLogSink::StreamLogSink ( std::unique_ptr< OutputStream stream)
explicit

◆ StreamLogSink() [2/2]

StreamLogSink::StreamLogSink ( OutputStream stream)
explicit

◆ ~StreamLogSink()

StreamLogSink::~StreamLogSink ( )
virtualdefault

Member Function Documentation

◆ initFormatter()

void StreamLogSink::initFormatter ( )
private

◆ write()

void StreamLogSink::write ( const LogCategory category,
LogLevel  level,
std::string_view  message 
)
overridevirtual

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.

Implements LogSink.

Member Data Documentation

◆ _formatter

std::unique_ptr<spdlog::formatter> StreamLogSink::_formatter
private

◆ _ownStream

std::unique_ptr<OutputStream> StreamLogSink::_ownStream
private

◆ _stream

OutputStream* StreamLogSink::_stream = nullptr
private

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