From 0fdb545d8ca73df45a14d9432b11b2352cd08653 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 26 Jun 2021 17:59:08 +0300 Subject: [PATCH] Fixed clang c++20 compile --- include/spdlog/sinks/daily_file_sink.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 16be821a..00b2fb5d 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -39,18 +39,18 @@ struct daily_filename_calculator /* * Generator of daily log file names with strftime format. - * Usages: + * Usages: * auto sink = std::make_shared("myapp-%Y-%m-%d:%H:%M:%S.log", hour, minute);" * auto logger = spdlog::daily_logger_format_mt("loggername, "myapp-%Y-%m-%d:%X.log", hour, minute)" - * + * */ struct daily_filename_format_calculator { - static filename_t calc_filename (const filename_t &filename, const tm &now_tm) + static filename_t calc_filename(const filename_t &filename, const tm &now_tm) { - // generate fmt datetime format string, e.g. {:%Y-%m-%d}. - filename_t fmt_filename = fmt::format(SPDLOG_FILENAME_T ("{{:{}}}"), filename); - return fmt::format(fmt_filename, now_tm); + // generate fmt datetime format string, e.g. {:%Y-%m-%d}. + filename_t fmt_filename = fmt::format(SPDLOG_FILENAME_T("{{:{}}}"), filename); + return fmt::format(fmt::runtime(fmt_filename), now_tm); } };