diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 068b5aa6..8f83e81b 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -371,8 +371,7 @@ protected: #ifdef SPDLOG_USE_STD_FORMAT fmt_lib::vformat_to(std::back_inserter(buf), fmt, fmt_lib::make_format_args(std::forward(args)...)); #else - // seems that fmt::detail::vformat_to(buf, ...) is ~20ns faster than fmt::vformat_to(std::back_inserter(buf),..) - fmt::detail::vformat_to(buf, fmt, fmt::make_format_args(std::forward(args)...)); + fmt::vformat_to(fmt::appender(buf), fmt, fmt::make_format_args(std::forward(args)...)); #endif details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size()));