Logger base class implementation.
More...
#include <LoggerBase.hpp>
|
virtual | ~LoggerBase () |
| Destructor Destroy all created log streams.
|
|
virtual void | Log (SA::Log _log) |
| Push a new log in logger.
|
|
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.
|
|
virtual void | ClearStreams (bool _bFlush=true) |
|
virtual void | Flush () |
| Force logger to flush all streams.
|
|
virtual void | EnableLogLevel (LogLevel _level) |
| Enable LogLevel for all registered streams.
|
|
virtual void | DisableLogLevel (LogLevel _level) |
| Disable LogLevel for all registered streams.
|
|
virtual void | EnableLogChannel (const std::wstring &_channel) |
| Enable LogChannel for all registered streams.
|
|
virtual void | DisableLogChannel (const std::wstring &_channel) |
| Disable LogChannel for all registered streams.
|
|
virtual void | IncrementFrameNum ()=0 |
| Increment current registered frame number.
|
|
virtual uint32_t | GetFrameNum () const =0 |
| Get current registered frame number.
|
|
|
std::list< ALogStream * > | mStreams |
| Registered output streams.
|
|
Logger base class implementation.
◆ Assert()
template<typename ExcepT >
void SA::LoggerBase::Assert |
( |
ExcepT | _exc | ) |
|
Process exception.
Log assertion on success, otherwise throw exception. Use SA_ASSERT as helper call.
- Template Parameters
-
- Parameters
-
[in] | _exc | exception to process. |
◆ ClearStreams()
virtual void SA::LoggerBase::ClearStreams |
( |
bool | _bFlush = true | ) |
|
|
virtual |
Destroy all streams.
- Parameters
-
_bFlush | Should flush stream before destroy. |
Reimplemented in SA::LoggerThread.
◆ CreateSteam()
template<typename StreamT , typename... Args>
StreamT & SA::LoggerBase::CreateSteam |
( |
Args &&... | _args | ) |
|
Create a new stream to output in.
- Template Parameters
-
StreamT | Type of stream to create. |
Args... | Argument variadic types to construct stream. |
- Parameters
-
[in] | _args | Arguments to construct stream. |
- Returns
- Newly created stream.
◆ DestroyStream()
template<typename StreamT >
bool SA::LoggerBase::DestroyStream |
( |
StreamT & | _stream, |
|
|
bool | _bFlush = true ) |
Destroy a previously created stream.
- Template Parameters
-
StreamT | Type of stream to destroy. |
- Parameters
-
_stream | Stream variable to destroy. |
_bFlush | Should flush stream before destroy. |
- Returns
- true on destroy success.
◆ DisableLogChannel()
virtual void SA::LoggerBase::DisableLogChannel |
( |
const std::wstring & | _channel | ) |
|
|
virtual |
Disable LogChannel for all registered streams.
- Parameters
-
[in] | _channel | Channel to disable. |
Reimplemented in SA::LoggerThread.
◆ DisableLogLevel()
virtual void SA::LoggerBase::DisableLogLevel |
( |
LogLevel | _level | ) |
|
|
virtual |
Disable LogLevel for all registered streams.
- Parameters
-
[in] | _level | Level to disable. |
Reimplemented in SA::LoggerThread.
◆ EnableLogChannel()
virtual void SA::LoggerBase::EnableLogChannel |
( |
const std::wstring & | _channel | ) |
|
|
virtual |
Enable LogChannel for all registered streams.
- Parameters
-
[in] | _channel | Channel to enable. |
Reimplemented in SA::LoggerThread.
◆ EnableLogLevel()
virtual void SA::LoggerBase::EnableLogLevel |
( |
LogLevel | _level | ) |
|
|
virtual |
Enable LogLevel for all registered streams.
- Parameters
-
[in] | _level | Level to enable. |
Reimplemented in SA::LoggerThread.
◆ Flush()
virtual void SA::LoggerBase::Flush |
( |
| ) |
|
|
virtual |
◆ GetFrameNum()
virtual uint32_t SA::LoggerBase::GetFrameNum |
( |
| ) |
const |
|
pure virtual |
◆ IncrementFrameNum()
virtual void SA::LoggerBase::IncrementFrameNum |
( |
| ) |
|
|
pure virtual |
◆ Log()
virtual void SA::LoggerBase::Log |
( |
SA::Log | _log | ) |
|
|
virtual |
◆ ProcessLog()
virtual void SA::LoggerBase::ProcessLog |
( |
const SA::Log & | _log, |
|
|
bool | _bForce = false ) |
|
protectedvirtual |
Process log to output.
- Parameters
-
[in] | _log | Log to process. |
[in] | _bForce | Should force log process. Default is false. |
◆ RegisterStream()
virtual void SA::LoggerBase::RegisterStream |
( |
ALogStream * | _stream | ) |
|
|
protectedvirtual |
Register a stream to output.
- Parameters
-
[in] | _stream | Stream to register. |
◆ UnregisterStream()
virtual bool SA::LoggerBase::UnregisterStream |
( |
ALogStream * | _stream | ) |
|
|
protectedvirtual |
Unregister a stream from output.
- Parameters
-
[in] | _stream | Stream to unregister. |
- Returns
- true on success.
The documentation for this class was generated from the following file: