From 3540ba32e9565219ac1e88e242430713c8138a82 Mon Sep 17 00:00:00 2001 From: Sprite Date: Tue, 4 Jan 2022 09:16:20 +0800 Subject: [PATCH] Reset current size if rotated files on open --- include/spdlog/sinks/rotating_file_sink-inl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index 2c003959..7401e4f2 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -36,6 +36,7 @@ SPDLOG_INLINE rotating_file_sink::rotating_file_sink( if (rotate_on_open && current_size_ > 0) { rotate_(); + current_size_ = 0; } }