diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index f82f4a53..416de65e 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -69,24 +69,16 @@ public: template void log(source_loc loc, level lvl, format_string_t fmt, Args &&...args) { if (should_log(lvl)) { - log_with_format_(loc, lvl, details::to_string_view(fmt), std::forward(args)...); + log_with_format_(loc, lvl, fmt, std::forward(args)...); } } template void log(level lvl, format_string_t fmt, Args &&...args) { if (should_log(lvl)) { - log_with_format_(source_loc{}, lvl, details::to_string_view(fmt), std::forward(args)...); + log_with_format_(source_loc{}, lvl, fmt, std::forward(args)...); } } - - template , typename... Args> - void log(source_loc loc, level lvl, S fmt, Args &&...args) { - if (should_log(lvl)) { - log_with_format_(loc, lvl, fmt, std::forward(args)...); - } - } - // log with no format string, just string message void log(source_loc loc, level lvl, string_view_t msg) { if (should_log(lvl)) { @@ -192,7 +184,7 @@ protected: // common implementation for after templated public api has been resolved to format string and // args template - void log_with_format_(source_loc loc, level lvl, format_string_t fmt, Args &&...args) { + void log_with_format_(source_loc loc, level lvl, const format_string_t &fmt, Args &&...args) { assert(should_log(lvl)); SPDLOG_TRY { #ifdef SPDLOG_USE_STD_FORMAT