diff --git a/include/ehs/Log.h b/include/ehs/Log.h index c38d4fc..4ff37f3 100644 --- a/include/ehs/Log.h +++ b/include/ehs/Log.h @@ -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 &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 \ No newline at end of file diff --git a/src/Log.cpp b/src/Log.cpp index 3436f87..bc3f5bf 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -75,12 +75,12 @@ namespace ehs { } - Log::Log(LogType type, const std::initializer_list &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 tmpTags = tags.Split(", "); + + this->tags = Array(&tmpTags[0], tmpTags.Size()); } Log::Log(LogType type, Array tags, const UInt_64 code, Str_8 msg)