Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::record::AsyncLogger Class Referencefinal

Asynchronous logger. More...

#include <AsyncLogger.h>

Inheritance diagram for sese::record::AsyncLogger:
sese::record::Logger

Public Member Functions

 AsyncLogger ()
 
 ~AsyncLogger () noexcept override
 
void log (const Event::Ptr &event) noexcept override
 
void dump (const void *buffer, size_t length) noexcept override
 
void loop () noexcept
 
- Public Member Functions inherited from sese::record::Logger
 Logger () noexcept
 
virtual ~Logger () noexcept=default
 
void addAppender (const AbstractAppender::Ptr &appender) noexcept
 
void removeAppender (const AbstractAppender::Ptr &appender) noexcept
 

Protected Attributes

io::FixedBuildercurrentBuffer
 
io::FixedBuildernextBuffer
 
std::vector< io::FixedBuilder * > buffer2Ready
 
std::mutex mutex
 
std::condition_variable conditionVariable
 
std::atomic_bool isShutdown {}
 
sese::Thread::Ptr thread
 
- Protected Attributes inherited from sese::record::Logger
std::shared_ptr< AbstractFormatterformatter
 
std::shared_ptr< ConsoleAppenderbuiltInAppender
 
std::vector< AbstractAppender::PtrappenderVector
 

Additional Inherited Members

- Public Types inherited from sese::record::Logger
typedef std::shared_ptr< LoggerPtr
 
- Static Public Member Functions inherited from sese::record::Logger
template<typename... ARGS>
static void debug (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void debug (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void info (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void info (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void warn (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void warn (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void error (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void error (PatternAndLocation pattern_and_location)
 
static void addGlobalLoggerAppender (const AbstractAppender::Ptr &appender) noexcept
 
static void removeGlobalLoggerAppender (const AbstractAppender::Ptr &appender) noexcept
 

Detailed Description

Asynchronous logger.

Constructor & Destructor Documentation

◆ AsyncLogger()

AsyncLogger::AsyncLogger ( )

◆ ~AsyncLogger()

AsyncLogger::~AsyncLogger ( )
overridenoexcept

Member Function Documentation

◆ dump()

void AsyncLogger::dump ( const void * buffer,
size_t length )
overridevirtualnoexcept

Output raw content

Parameters
bufferBuffer
lengthLength of buffer

Reimplemented from sese::record::Logger.

References RECORD_BUFFER_SIZE.

◆ log()

void AsyncLogger::log ( const Event::Ptr & event)
overridevirtualnoexcept

Output log

Parameters
eventLog event

Reimplemented from sese::record::Logger.

References RECORD_BUFFER_SIZE.

◆ loop()

Member Data Documentation

◆ buffer2Ready

std::vector<io::FixedBuilder *> sese::record::AsyncLogger::buffer2Ready
protected

Referenced by loop().

◆ conditionVariable

std::condition_variable sese::record::AsyncLogger::conditionVariable
protected

Referenced by loop(), and ~AsyncLogger().

◆ currentBuffer

io::FixedBuilder* sese::record::AsyncLogger::currentBuffer
protected

Referenced by AsyncLogger(), loop(), and ~AsyncLogger().

◆ isShutdown

std::atomic_bool sese::record::AsyncLogger::isShutdown {}
protected

Referenced by AsyncLogger(), loop(), and ~AsyncLogger().

◆ mutex

std::mutex sese::record::AsyncLogger::mutex
protected

Referenced by loop().

◆ nextBuffer

io::FixedBuilder* sese::record::AsyncLogger::nextBuffer
protected

Referenced by AsyncLogger(), loop(), and ~AsyncLogger().

◆ thread

sese::Thread::Ptr sese::record::AsyncLogger::thread
protected

Referenced by AsyncLogger(), and ~AsyncLogger().


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