This commit is contained in:
gabime
2014-02-03 20:28:19 +02:00
parent 5e8eea7e90
commit 52dc317cfb
4 changed files with 50 additions and 114 deletions

View File

@@ -9,12 +9,13 @@ void c11log::formatters::format_time(const c11log::formatters::timepoint& tp, st
//get ms
//auto duration = tp.time_since_epoch();
//int millis = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() % 1000);
char buf[64];
auto size = sprintf(buf, "[%d-%02d-%02d %02d:%02d:%02d]",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
dest.write(buf, size);
}