diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 7291e631..a2a3342d 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -49,7 +49,8 @@ inline void spdlog::logger::set_formatter(std::unique_ptr f) inline void spdlog::logger::set_pattern(std::string pattern, pattern_time_type time_type) { - set_formatter(std::unique_ptr(new pattern_formatter(std::move(pattern), time_type))); + auto new_formatter = spdlog::make_unique(std::move(pattern), time_type); + set_formatter(std::move(new_formatter)); } template