From a732a0dc852eb054060512fe49d85a30d31813b0 Mon Sep 17 00:00:00 2001 From: Surfy Cui Date: Mon, 14 Feb 2022 15:25:55 +0800 Subject: [PATCH] Limit max number of rotating files to 200000, not max size --- include/spdlog/sinks/rotating_file_sink-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index 8ac8cb14..350c2127 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -36,9 +36,9 @@ SPDLOG_INLINE rotating_file_sink::rotating_file_sink( throw_spdlog_ex("rotating sink constructor: max_size arg cannot be zero"); } - if (max_size > 200000) + if (max_files > 200000) { - throw_spdlog_ex("rotating sink constructor: max_size arg cannot exceed 200000"); + throw_spdlog_ex("rotating sink constructor: max_files arg cannot exceed 200000"); } file_helper_.open(calc_filename(base_filename_, 0)); current_size_ = file_helper_.size(); // expensive. called only once