diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index 8338e172..bc759066 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -70,7 +70,7 @@ SPDLOG_INLINE filename_t rotating_file_sink::filename() { } template -SPDLOG_INLINE void rotating_file_sink::force_rotation() { +SPDLOG_INLINE void rotating_file_sink::rotate_now() { SPDLOG_TRY { rotate_(); } SPDLOG_CATCH_STD } diff --git a/include/spdlog/sinks/rotating_file_sink.h b/include/spdlog/sinks/rotating_file_sink.h index 6e71e1e7..42bd3760 100644 --- a/include/spdlog/sinks/rotating_file_sink.h +++ b/include/spdlog/sinks/rotating_file_sink.h @@ -28,7 +28,7 @@ public: const file_event_handlers &event_handlers = {}); static filename_t calc_filename(const filename_t &filename, std::size_t index); filename_t filename(); - void force_rotation(); + void rotate_now(); protected: void sink_it_(const details::log_msg &msg) override; diff --git a/tests/test_file_logging.cpp b/tests/test_file_logging.cpp index 559a3bd8..477d10e2 100644 --- a/tests/test_file_logging.cpp +++ b/tests/test_file_logging.cpp @@ -102,7 +102,7 @@ TEST_CASE("rotating_file_logger3", "[rotating_logger]") { spdlog::spdlog_ex); } -// test forced rotation of logs +// test on-demand rotation of logs TEST_CASE("rotating_file_logger4", "[rotating_logger]") { prepare_logdir(); size_t max_size = 1024 * 10; @@ -112,7 +112,7 @@ TEST_CASE("rotating_file_logger4", "[rotating_logger]") { logger->info("Test message - pre-rotation"); logger->flush(); - sink->force_rotation(); + sink->rotate_now(); logger->info("Test message - post-rotation"); logger->flush();