SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SA::LoggerThread Class Reference

Multithread logger class. More...

#include <LoggerThread.hpp>

Inheritance diagram for SA::LoggerThread:
SA::LoggerBase

Public Member Functions

 LoggerThread (uint32_t _ringBufferSize=32) noexcept
 Default Constructor.
 
 ~LoggerThread ()
 
void Log (SA::Log _log) override final
 Push a new log in logger.
 
void ClearStreams (bool _bFlush=true) override final
 
void Flush () override final
 Force logger to flush all streams.
 
void EnableLogLevel (LogLevel _level) override final
 Enable LogLevel for all registered streams.
 
void DisableLogLevel (LogLevel _level) override final
 Disable LogLevel for all registered streams.
 
void EnableLogChannel (const std::wstring &_channel) override final
 Enable LogChannel for all registered streams.
 
void DisableLogChannel (const std::wstring &_channel) override final
 Disable LogChannel for all registered streams.
 
void IncrementFrameNum () override final
 Increment current registered frame number.
 
uint32_t GetFrameNum () const override final
 Get current registered frame number.
 
- Public Member Functions inherited from SA::LoggerBase
virtual ~LoggerBase ()
 Destructor Destroy all created log streams.
 
template<typename ExcepT >
void Assert (ExcepT _exc)
 Process exception.
 
template<typename StreamT , typename... Args>
StreamT & CreateSteam (Args &&... _args)
 Create a new stream to output in.
 
template<typename StreamT >
bool DestroyStream (StreamT &_stream, bool _bFlush=true)
 Destroy a previously created stream.
 

Additional Inherited Members

- Protected Attributes inherited from SA::LoggerBase
std::list< ALogStream * > mStreams
 Registered output streams.
 

Detailed Description

Multithread logger class.

Create one thread for log output. Push logs in thread-safe queue.

Constructor & Destructor Documentation

◆ ~LoggerThread()

SA::LoggerThread::~LoggerThread ( )

Thread-safe destructor. Flush all remaining logs in streams before join.

Member Function Documentation

◆ ClearStreams()

void SA::LoggerThread::ClearStreams ( bool _bFlush = true)
finaloverridevirtual

Destroy all streams.

Parameters
_bFlushShould flush stream before destroy.

Reimplemented from SA::LoggerBase.

◆ DisableLogChannel()

void SA::LoggerThread::DisableLogChannel ( const std::wstring & _channel)
finaloverridevirtual

Disable LogChannel for all registered streams.

Parameters
[in]_channelChannel to disable.

Reimplemented from SA::LoggerBase.

◆ DisableLogLevel()

void SA::LoggerThread::DisableLogLevel ( LogLevel _level)
finaloverridevirtual

Disable LogLevel for all registered streams.

Parameters
[in]_levelLevel to disable.

Reimplemented from SA::LoggerBase.

◆ EnableLogChannel()

void SA::LoggerThread::EnableLogChannel ( const std::wstring & _channel)
finaloverridevirtual

Enable LogChannel for all registered streams.

Parameters
[in]_channelChannel to enable.

Reimplemented from SA::LoggerBase.

◆ EnableLogLevel()

void SA::LoggerThread::EnableLogLevel ( LogLevel _level)
finaloverridevirtual

Enable LogLevel for all registered streams.

Parameters
[in]_levelLevel to enable.

Reimplemented from SA::LoggerBase.

◆ Flush()

void SA::LoggerThread::Flush ( )
finaloverridevirtual

Force logger to flush all streams.

Reimplemented from SA::LoggerBase.

◆ GetFrameNum()

uint32_t SA::LoggerThread::GetFrameNum ( ) const
finaloverridevirtual

Get current registered frame number.

Implements SA::LoggerBase.

◆ IncrementFrameNum()

void SA::LoggerThread::IncrementFrameNum ( )
finaloverridevirtual

Increment current registered frame number.

Implements SA::LoggerBase.

◆ Log()

void SA::LoggerThread::Log ( SA::Log _log)
finaloverridevirtual

Push a new log in logger.

Parameters
[in]_logLog to push.

Reimplemented from SA::LoggerBase.


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