From 5988895d69338d9f3dbec054d2afdda7037da136 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 2 Sep 2019 12:40:47 +0300 Subject: [PATCH] Simplify daily sink filename creation --- include/spdlog/sinks/daily_file_sink.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 7fc0626e..c9101349 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -30,10 +30,7 @@ struct daily_filename_calculator { filename_t basename, ext; std::tie(basename, ext) = details::file_helper::split_by_extension(filename); - std::conditional::value, memory_buf_t, fmt::wmemory_buffer>::type w; - fmt::format_to( - w, SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}{}"), basename, now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday, ext); - return fmt::to_string(w); + return fmt::format(SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}{}"), basename, now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday, ext); } };