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>