Add a high time resolution tweak with default pattern

pull/868/head
Shane Yao 7 years ago
parent 226d5a1d36
commit 8ee2a0a429

@ -498,8 +498,13 @@ class full_formatter final : public flag_formatter
}
fmt_helper::append_buf(cached_datetime_, dest);
#ifdef SPDLOG_HIGH_RES
auto micros = fmt_helper::time_fraction<microseconds>(msg.time);
fmt_helper::pad6(static_cast<int>(micros.count()), dest);
#else
auto millis = fmt_helper::time_fraction<milliseconds>(msg.time);
fmt_helper::pad3(static_cast<int>(millis.count()), dest);
#endif
dest.push_back(']');
dest.push_back(' ');

@ -61,6 +61,13 @@
// #define SPDLOG_NO_NAME
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to make default pattern replace milliseconds with microseconds on
// tail.
//
// #define SPDLOG_HIGH_RES
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to enable the SPDLOG_DEBUG/SPDLOG_TRACE macros.
//

Loading…
Cancel
Save