- To guarantee of thread-safe
Change-Id: I707173361df0d5f0b2d901d30d4f588178301575
Signed-off-by: seolheui, kim <s414.kim@samsung.com>
resize();
auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
- std::tm tm = *std::localtime(&now);
+ std::tm tm = {
+ .tm_sec = 0,
+ .tm_min = 0,
+ .tm_hour = 0,
+ .tm_mday = 1,
+ .tm_mon = 1,
+ .tm_year = 0,
+ .tm_wday = 0,
+ .tm_yday = 0,
+ .tm_isdst = 1,
+ };
+
+ if (::localtime_r(&now, &tm) == nullptr)
+ std::cerr << "Failed to get local time" << std::endl;
+
std::string log("[" + std::to_string(tm.tm_hour)
+ ":"
+ std::to_string(tm.tm_min)