Fixed the logger.

This commit is contained in:
2025-07-27 23:50:13 -07:00
parent 73f7ec1a8d
commit 46184df89c
2 changed files with 11 additions and 11 deletions

View File

@@ -63,7 +63,7 @@ namespace ehs
/// @param [in] tags The tags to associate this log with.
/// @param [in] code The unique code to use.
/// @param [in] msg Detailed information about what happened.
Log(LogType type, const std::initializer_list<Str_8> &tags, UInt_64 code, Str_8 msg);
Log(LogType type, const Str_8 &tags, UInt_64 code, Str_8 msg);
/// Initializes members with the given information.
/// @param [in] tags The tags to associate this log with.
@@ -134,20 +134,20 @@ namespace ehs
#ifndef EHS_LOG_INT
#ifdef EHS_DEBUG
#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))
#define EHS_LOG_INT(type, code, msg) ehs::Log::Raise(ehs::Log(type, ehs::Str_8(ehs::GetAcronym_8()) + ", " + EHS_FILE + ", " + EHS_FUNC + ", " + ehs::Str_8::FromNum((ehs::UInt_32)EHS_LINE), code, msg))
#else
#define EHS_LOG_INT(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAcronym_8(), EHS_FUNC}, code, msg))
#define EHS_LOG_INT(type, code, msg) ehs::Log::Raise(ehs::Log(type, ehs::Str_8(ehs::GetAcronym_8()) + ", " + EHS_FUNC, code, msg))
#endif
#endif
#ifndef EHS_LOG
#ifdef EHS_DEBUG
#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))
#define EHS_LOG(type, code, msg) ehs::Log::Raise(ehs::Log(type, ehs::Str_8(ehs::GetAppName_8()) + ", " + EHS_FILE + ", " + EHS_FUNC + ", " + ehs::Str_8::FromNum((ehs::UInt_32)EHS_LINE), code, msg))
#else
#define EHS_LOG(type, code, msg) ehs::Log::Raise(ehs::Log(type, {ehs::GetAppName_8(), EHS_FUNC}, code, msg))
#define EHS_LOG(type, code, msg) ehs::Log::Raise(ehs::Log(type, ehs::Str_8(ehs::GetAppName_8()) + ", " + EHS_FUNC, code, msg))
#endif
#endif
#ifndef EHS_LOG_SUCCESS
#define EHS_LOG_SUCCESS() ehs::Log::Raise({})
#define EHS_LOG_SUCCESS() ehs::Log::Raise({})
#endif

View File

@@ -75,12 +75,12 @@ namespace ehs
{
}
Log::Log(LogType type, const std::initializer_list<Str_8> &tags, const UInt_64 code, Str_8 msg)
: type(type), tags(tags.size()), code(code), msg((Str_8&&)msg)
Log::Log(LogType type, const Str_8 &tags, const UInt_64 code, Str_8 msg)
: type(type), code(code), msg((Str_8&&)msg)
{
UInt_64 i = 0;
for (auto v = tags.begin(); v != tags.end(); ++v)
this->tags[i++] = *v;
const Vector<Str_8> tmpTags = tags.Split(", ");
this->tags = Array<Str_8>(&tmpTags[0], tmpTags.Size());
}
Log::Log(LogType type, Array<Str_8> tags, const UInt_64 code, Str_8 msg)