|
|
|
@ -49,26 +49,26 @@ inline void c11log::formatters::default_formatter::_format_time(const log_clock:
|
|
|
|
|
__declspec(thread) static std::tm last_tm = { 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
|
|
|
__declspec(thread) static char last_time_str[64];
|
|
|
|
|
#else
|
|
|
|
|
thread_local static std::tm last_tm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
|
|
|
thread_local static char last_time_str[64];
|
|
|
|
|
thread_local static std::tm last_tm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
|
|
|
thread_local static char last_time_str[64];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
auto tm_now = details::os::localtime(log_clock::to_time_t(tp));
|
|
|
|
|
using namespace c11log::details::os;
|
|
|
|
|
using namespace c11log::details::os;
|
|
|
|
|
if(last_tm != tm_now)
|
|
|
|
|
{
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
::sprintf_s
|
|
|
|
|
::sprintf_s
|
|
|
|
|
#else
|
|
|
|
|
::snprintf
|
|
|
|
|
::snprintf
|
|
|
|
|
#endif
|
|
|
|
|
(last_time_str, sizeof(last_time_str), "[%d-%02d-%02d %02d:%02d:%02d]",
|
|
|
|
|
tm_now.tm_year + 1900,
|
|
|
|
|
tm_now.tm_mon + 1,
|
|
|
|
|
tm_now.tm_mday,
|
|
|
|
|
tm_now.tm_hour,
|
|
|
|
|
tm_now.tm_min,
|
|
|
|
|
tm_now.tm_sec);
|
|
|
|
|
(last_time_str, sizeof(last_time_str), "[%d-%02d-%02d %02d:%02d:%02d]",
|
|
|
|
|
tm_now.tm_year + 1900,
|
|
|
|
|
tm_now.tm_mon + 1,
|
|
|
|
|
tm_now.tm_mday,
|
|
|
|
|
tm_now.tm_hour,
|
|
|
|
|
tm_now.tm_min,
|
|
|
|
|
tm_now.tm_sec);
|
|
|
|
|
last_tm = tm_now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|