Add std::tm formatter, fix spdlog::stopwatch formatter, conditionally use fmt::runtime in test_errors

This commit is contained in:
Charless Milette
2021-11-15 14:57:13 -05:00
parent 849e90bd01
commit f6901606f5
3 changed files with 105 additions and 4 deletions

View File

@@ -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<spdlog::stopwatch> : formatter<double>
{
@@ -58,4 +65,4 @@ struct formatter<spdlog::stopwatch> : formatter<double>
return formatter<double>::format(sw.elapsed().count(), ctx);
}
};
} // namespace fmt
} // namespace fmt/std