summaryrefslogtreecommitdiff
path: root/src/common/Logging/LogMessage.cpp
diff options
context:
space:
mode:
authorKargatum <dowlandtop@yandex.com>2022-01-19 12:01:59 +0700
committerGitHub <noreply@github.com>2022-01-19 12:01:59 +0700
commit259b9133f68ef0d740fc871d59fab3d2791f33b4 (patch)
tree89da4d2a14ee203de3baff62e6c2d5b4b025bbfa /src/common/Logging/LogMessage.cpp
parentb5ab409614bf0d45e7a4f03c57b15edf113fe5f0 (diff)
feat(Core/Common): add new helpers for time utility (#10207)
Diffstat (limited to 'src/common/Logging/LogMessage.cpp')
-rw-r--r--src/common/Logging/LogMessage.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/Logging/LogMessage.cpp b/src/common/Logging/LogMessage.cpp
index 4a0cf3a0bd..28f8e82ba5 100644
--- a/src/common/Logging/LogMessage.cpp
+++ b/src/common/Logging/LogMessage.cpp
@@ -17,7 +17,7 @@
#include "LogMessage.h"
#include "StringFormat.h"
-#include "Util.h"
+#include "Timer.h"
LogMessage::LogMessage(LogLevel _level, std::string const& _type, std::string&& _text)
: level(_level), type(_type), text(std::forward<std::string>(_text)), mtime(time(nullptr))
@@ -31,9 +31,7 @@ LogMessage::LogMessage(LogLevel _level, std::string const& _type, std::string&&
std::string LogMessage::getTimeStr(time_t time)
{
- tm aTm;
- localtime_r(&time, &aTm);
- return Acore::StringFormat("%04d-%02d-%02d_%02d:%02d:%02d", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
+ return Acore::Time::TimeToTimestampStr(Seconds(time), "%Y-%m-%d %X");
}
std::string LogMessage::getTimeStr() const