From 25b10dc26469762d27517829b9d61d42199d901c Mon Sep 17 00:00:00 2001 From: dominicpoeschko <45942148+dominicpoeschko@users.noreply.github.com> Date: Sat, 8 Feb 2020 11:11:04 +0100 Subject: [PATCH] additional log overload calling log with a string_view as msg called ``` template void log(source_loc loc, level::level_enum lvl, string_view_t fmt, const Args &... args) ``` instead of ``` template::value, T>::type * = nullptr> void log(source_loc loc, level::level_enum lvl, const T &msg) ``` which lead to an unnecessary call to fmt::format --- include/spdlog/logger.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 43f39600..ed7d2361 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -143,6 +143,11 @@ public: // T can be statically converted to string_view template::value, T>::type * = nullptr> void log(source_loc loc, level::level_enum lvl, const T &msg) + { + log(loc,lvl, string_view_t{msg}); + } + + void log(source_loc loc, level::level_enum lvl, string_view_t msg) { bool log_enabled = should_log(lvl); bool traceback_enabled = tracer_.enabled();