summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kazmin <a.kazmin@partner.samsung.com>2019-12-23 13:32:58 +0300
committerAndrey Kazmin <a.kazmin@partner.samsung.com>2019-12-23 13:37:29 +0300
commit46567b70fedc89ffc609812d2c3534bfbaada7f8 (patch)
tree22a94d541eead68055681adf873b0bd57768d1d4
parent94328469ba97490ee308b6b6b3733110bf7380d1 (diff)
downloadbrowser-sandbox/akazmin/tizen_6.0_build.tar.gz
browser-sandbox/akazmin/tizen_6.0_build.tar.bz2
browser-sandbox/akazmin/tizen_6.0_build.zip
Fixed missed initialization of struct tm in Logger::timeStampsandbox/akazmin/tizen_6.0_build
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
-rwxr-xr-xcore/Logger/Logger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Logger/Logger.cpp b/core/Logger/Logger.cpp
index 96c1e9b..2394c5a 100755
--- a/core/Logger/Logger.cpp
+++ b/core/Logger/Logger.cpp
@@ -155,13 +155,15 @@ int Logger::registerLogger(AbstractLogger *l) {
}
std::string Logger::timeStamp() {
- struct tm b;
+ struct tm *b;
struct timeval detail_time;
+
gettimeofday(&detail_time, NULL);
+ b = gmtime(&detail_time.tv_sec);
char buf[80];
// strftime(buf, sizeof(buf), "%d/%m/%y,%T ", brokenTime, detail_time.tv_usec/1000);
- snprintf(buf, sizeof(buf), "[%d/%d/%d,%d:%d:%d.%ld]", b.tm_year, b.tm_mon, b.tm_mday, b.tm_hour, b.tm_min, b.tm_sec, detail_time.tv_usec/1000);
+ snprintf(buf, sizeof(buf), "[%d/%d/%d,%d:%d:%d.%ld]", b->tm_year, b->tm_mon, b->tm_mday, b->tm_hour, b->tm_min, b->tm_sec, detail_time.tv_usec/1000);
return std::string(buf);
}