From 06580c8333f81f0cd700bf95de1e7c41ede782c4 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Apr 2018 22:15:50 +0500 Subject: [PATCH] Update file_sinks.h --- include/spdlog/sinks/file_sinks.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/spdlog/sinks/file_sinks.h b/include/spdlog/sinks/file_sinks.h index 407c5b83..13282789 100644 --- a/include/spdlog/sinks/file_sinks.h +++ b/include/spdlog/sinks/file_sinks.h @@ -286,6 +286,11 @@ public: _file_helper.open(_current_filename); _current_size = _file_helper.size(); // expensive. called only once } + + ~step_file_sink() + { + close_current_file(); + } protected: void _sink_it(const details::log_msg &msg) override @@ -306,7 +311,6 @@ protected: void _flush() override { _file_helper.flush(); - close_current_file(); } private: