mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
delete
This commit is contained in:
@@ -10,10 +10,10 @@ void c11log::formatters::format_time(const c11log::formatters::timepoint& tp, st
|
||||
int millis = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() % 1000);
|
||||
//std::put_time(&tm, "[ %Y-%m-%d %H:%M:%S ]") - seems too slow
|
||||
char buf[64];
|
||||
sprintf(buf, "[%d-%02d-%02d %02d:%02d:%02d.%03d]",
|
||||
auto size = sprintf(buf, "[%d-%02d-%02d %02d:%02d:%02d.%03d]",
|
||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec, millis);
|
||||
dest << buf;
|
||||
dest.write(buf, size);
|
||||
}
|
||||
|
||||
void c11log::formatters::format_time(std::ostream& dest)
|
||||
@@ -33,4 +33,4 @@ std::string c11log::formatters::to_hex(const unsigned char* buf, std::size_t siz
|
||||
oss << _hex_chars[buf[i] & 0x0F];
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
}
|
||||
|
@@ -7,11 +7,14 @@ namespace details {
|
||||
namespace os {
|
||||
std::tm localtime(const std::time_t &time_t)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
||||
std::tm tm;
|
||||
#ifdef _MSC_VER
|
||||
localtime_s(&tm, &time_t);
|
||||
return tm;
|
||||
#else
|
||||
localtime_r(&time_t, &tm);
|
||||
#endif
|
||||
return tm;
|
||||
}
|
||||
|
||||
std::tm localtime()
|
||||
@@ -21,4 +24,4 @@ std::tm localtime()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user