Fixed the logger.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace ehs
|
|||||||
/// @param [in] tags The tags to associate this log with.
|
/// @param [in] tags The tags to associate this log with.
|
||||||
/// @param [in] code The unique code to use.
|
/// @param [in] code The unique code to use.
|
||||||
/// @param [in] msg Detailed information about what happened.
|
/// @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.
|
/// Initializes members with the given information.
|
||||||
/// @param [in] tags The tags to associate this log with.
|
/// @param [in] tags The tags to associate this log with.
|
||||||
@@ -134,20 +134,20 @@ namespace ehs
|
|||||||
|
|
||||||
#ifndef EHS_LOG_INT
|
#ifndef EHS_LOG_INT
|
||||||
#ifdef EHS_DEBUG
|
#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
|
#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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EHS_LOG
|
#ifndef EHS_LOG
|
||||||
#ifdef EHS_DEBUG
|
#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
|
#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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EHS_LOG_SUCCESS
|
#ifndef EHS_LOG_SUCCESS
|
||||||
#define EHS_LOG_SUCCESS() ehs::Log::Raise({})
|
#define EHS_LOG_SUCCESS() ehs::Log::Raise({})
|
||||||
#endif
|
#endif
|
10
src/Log.cpp
10
src/Log.cpp
@@ -75,12 +75,12 @@ namespace ehs
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::Log(LogType type, const std::initializer_list<Str_8> &tags, const UInt_64 code, Str_8 msg)
|
Log::Log(LogType type, const Str_8 &tags, const UInt_64 code, Str_8 msg)
|
||||||
: type(type), tags(tags.size()), code(code), msg((Str_8&&)msg)
|
: type(type), code(code), msg((Str_8&&)msg)
|
||||||
{
|
{
|
||||||
UInt_64 i = 0;
|
const Vector<Str_8> tmpTags = tags.Split(", ");
|
||||||
for (auto v = tags.begin(); v != tags.end(); ++v)
|
|
||||||
this->tags[i++] = *v;
|
this->tags = Array<Str_8>(&tmpTags[0], tmpTags.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::Log(LogType type, Array<Str_8> tags, const UInt_64 code, Str_8 msg)
|
Log::Log(LogType type, Array<Str_8> tags, const UInt_64 code, Str_8 msg)
|
||||||
|
Reference in New Issue
Block a user