3#include <initializer_list>
31 static void DefaultRaisedCb(
const Log &log);
33 static void DefaultOutputCb(
const Array<Log> &logs);
39 static bool immediate;
66 Log(
LogType type,
const std::initializer_list<Str_8> &tags, UInt_64 code,
Str_8 msg);
91 bool operator==(const Log log);
96 bool operator!=(const Log log);
104 bool HasTags(
const std::initializer_list<Str_8> &tags)
const;
137 #define EHS_LOG_INT(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAcronym_8(), EHS_FILE, EHS_FUNC, ehs::Str_8::FromNum((ehs::UInt_32)EHS_LINE)}, code, msg))
139 #define EHS_LOG_INT(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAcronym_8(), EHS_FUNC}, code, msg))
145 #define EHS_LOG(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAppName_8(), EHS_FILE, EHS_FUNC, ehs::Str_8::FromNum((ehs::UInt_32)EHS_LINE)}, code, msg))
147 #define EHS_LOG(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAppName_8(), EHS_FUNC}, code, msg))
151#ifndef EHS_LOG_SUCCESS
152#define EHS_LOG_SUCCESS() ehs::Log::Raise({})
UInt_64 GetCode() const
Definition Log.cpp:192
Log & operator=(Log &&log) noexcept
Definition Log.cpp:103
Str_8 GetMsg() const
Definition Log.cpp:197
static void EnableImmediateMode(bool enable)
Definition Log.cpp:68
Str_8 ToStr() const
Definition Log.cpp:202
Log()
Default members initialization.
Definition Log.cpp:73
bool HasTags(const std::initializer_list< Str_8 > &tags) const
Definition Log.cpp:149
static void SetOutputCallback(LogOutputCb newCb)
Definition Log.cpp:33
bool IsValid() const
Definition Log.cpp:244
LogType GetType() const
Definition Log.cpp:144
static void OnExit()
Definition Log.cpp:38
static void Raise(Log log)
Definition Log.cpp:49
static Log GetLastLog()
Retrieves the last log raised.
Definition Log.cpp:61
const Array< Str_8 > & GetTags() const
Definition Log.cpp:187
bool HasTag(const Str_8 &tag) const
Definition Log.cpp:178
static void SetRaisedCallback(LogRaisedCb newCb)
Definition Log.cpp:28
void(* LogOutputCb)(const Array< Log > &)
Definition Log.h:15
unsigned char UInt_8
Definition Types.h:43
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953
void(* LogRaisedCb)(const Log &)
Definition Log.h:14
LogType
Definition Log.h:18
@ WARN
Definition Log.h:21
@ INFO
Definition Log.h:22
@ SUCCESS
Definition Log.h:19