From ce6bccb1949d14e7e9ce96054a407b60d047fe2f Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sat, 16 Sep 2023 16:53:39 +0300 Subject: [PATCH] Fixed logger::log with std::format under msvc --- include/spdlog/logger.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 22d83ae9..74108abe 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -81,14 +81,17 @@ public: { if (should_log(lvl)) { - log_with_format_(loc, lvl, fmt, std::forward(args)...); + log_with_format_(loc, lvl, fmt.get(), std::forward(args)...); } } template void log(level::level_enum lvl, format_string_t fmt, Args &&...args) { - log(source_loc{}, lvl, fmt, std::forward(args)...); + if (should_log(lvl)) + { + log_with_format_(source_loc{}, lvl, fmt.get(), std::forward(args)...); + } } template, typename... Args>