From 54e44ab477802f3e5cc24226ba7fc7307e3265c0 Mon Sep 17 00:00:00 2001 From: Shintaro Seki Date: Mon, 1 Jul 2019 19:00:30 +0900 Subject: [PATCH] Fix one more `msg.time`. --- include/spdlog/sinks/daily_file_sink.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 91809e90..a0798bee 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -68,12 +68,13 @@ protected: void sink_it_(const details::log_msg &msg) override { #ifdef SPDLOG_NO_DATETIME - if (log_clock::now() >= rotation_tp_) + auto time = log_clock::now(); #else - if (msg.time >= rotation_tp_) + auto time = msg.time; #endif + if (time >= rotation_tp_) { - file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(msg.time)), truncate_); + file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(time)), truncate_); rotation_tp_ = next_rotation_tp_(); } fmt::memory_buffer formatted;