From f6901606f5a36047036072d0c6c58f0c9d90bb9f Mon Sep 17 00:00:00 2001 From: Charless Milette Date: Mon, 15 Nov 2021 14:57:13 -0500 Subject: Add std::tm formatter, fix spdlog::stopwatch formatter, conditionally use fmt::runtime in test_errors --- include/spdlog/stopwatch.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/spdlog/stopwatch.h') diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h index bb976b19..52b4b6ad 100644 --- a/include/spdlog/stopwatch.h +++ b/include/spdlog/stopwatch.h @@ -48,7 +48,14 @@ public: } // namespace spdlog // Support for fmt formatting (e.g. "{:012.9}" or just "{}") -namespace fmt { +namespace +#ifdef SPDLOG_USE_STD_FORMAT + std +#else + fmt +#endif +{ + template<> struct formatter : formatter { @@ -58,4 +65,4 @@ struct formatter : formatter return formatter::format(sw.elapsed().count(), ctx); } }; -} // namespace fmt +} // namespace fmt/std -- cgit v1.2.3