From 15fcde8ee3b881afc8c53cef458705d732765ed7 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 3d30d8c4..2e9dfde3 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -59,6 +59,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 66a7e216..963a054b 100644 --- a/include/spdlog/sinks/hourly_file_sink.h +++ b/include/spdlog/sinks/hourly_file_sink.h @@ -38,6 +38,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 {