From 234d82bcd0984052332f2cbd7db3f963245b909f Mon Sep 17 00:00:00 2001 From: Nikola Gamzakov Date: Mon, 14 Jan 2019 16:35:09 +0200 Subject: [PATCH] Added default day format into the filename --- include/spdlog/sinks/rotating_file_sink_extended.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/spdlog/sinks/rotating_file_sink_extended.h b/include/spdlog/sinks/rotating_file_sink_extended.h index 8a651f45..969e9dc8 100644 --- a/include/spdlog/sinks/rotating_file_sink_extended.h +++ b/include/spdlog/sinks/rotating_file_sink_extended.h @@ -13,6 +13,7 @@ #include "spdlog/details/null_mutex.h" #include "spdlog/fmt/fmt.h" #include "spdlog/sinks/base_sink.h" +#include "spdlog/sinks/daily_file_sink.h" #include #include @@ -101,6 +102,11 @@ private: fmt::format_to(wt, SPDLOG_FILENAME_T("{}_{}{}"), basename, formated_time(), ext); filename = fmt::to_string(wt); } + else + { + auto now = log_clock::now(); + filename = daily_filename_calculator::calc_filename(base_filename_, now); + } if (index != 0u) {