From e3a66473b217286a5035328ec958e56877ce1faa Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 26 Sep 2018 15:53:54 +0300 Subject: [PATCH] Small cleanup in set_formatter --- include/spdlog/details/logger_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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