Update daily_rotating_file_sink.h

Fix bug when rotates
pull/862/head
Ryan Hsu 7 years ago committed by GitHub
parent ee2a5dbbc0
commit 96ff1337bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,10 +61,9 @@ public:
protected: protected:
void sink_it_(const details::log_msg &msg) override void sink_it_(const details::log_msg &msg) override
{ {
today_filename_ = calc_filename(base_filename_, now_tm(msg.time));
if (msg.time >= rotation_tp_) if (msg.time >= rotation_tp_)
{ {
today_filename_ = calc_filename(base_filename_, now_tm(msg.time));
file_helper_.open(today_filename_, truncate_); file_helper_.open(today_filename_, truncate_);
rotation_tp_ = next_rotation_tp_(); rotation_tp_ = next_rotation_tp_();
} }

Loading…
Cancel
Save