From 34cc3419fa67d38f0a4918b40351c2d7e260c804 Mon Sep 17 00:00:00 2001 From: weiy Date: Sun, 19 Jan 2020 13:52:01 +0800 Subject: [PATCH] add max files for rotating days --- include/spdlog/sinks/daily_file_sink.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index de673932..294c81ac 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -105,14 +105,15 @@ protected: private: void init_filenames_q() { - using details::os::file_exists; + using details::os::path_exists; + filenames_q_ = details::circular_q(static_cast(max_files_)); std::vector filenames; auto now = log_clock::now(); while (filenames.size() < max_files_) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); - if (!file_exists(filename)) + if (!path_exists(filename)) { break; }