From 271f0f3b14cd3266fd0f52c636fe3527d3c8beb2 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Mon, 9 Sep 2024 15:54:03 +0200 Subject: [PATCH] Add info about max_files in the docstrings of hourly/daily file sinks (#3170) --- include/spdlog/sinks/daily_file_sink.h | 3 +++ include/spdlog/sinks/hourly_file_sink.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 1b1dc44a..884145fd 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -62,6 +62,9 @@ struct daily_filename_format_calculator { * Rotating file sink based on date. * If truncate != false , the created file will be truncated. * If max_files > 0, retain only the last max_files and delete previous. + * If max_files > 0, retain only the last max_files and delete previous. + * Note that old log files from previous executions will not be deleted by this class, + * rotation and deletion is only applied while the program is running. */ template class daily_file_sink final : public base_sink { diff --git a/include/spdlog/sinks/hourly_file_sink.h b/include/spdlog/sinks/hourly_file_sink.h index 1f138925..3e618725 100644 --- a/include/spdlog/sinks/hourly_file_sink.h +++ b/include/spdlog/sinks/hourly_file_sink.h @@ -39,6 +39,8 @@ struct hourly_filename_calculator { * Rotating file sink based on time. * If truncate != false , the created file will be truncated. * If max_files > 0, retain only the last max_files and delete previous. + * Note that old log files from previous executions will not be deleted by this class, + * rotation and deletion is only applied while the program is running. */ template class hourly_file_sink final : public base_sink {