mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-16 00:45:48 +08:00
Fix rotation condition when SPDLOG_NO_DATETIME is defined.
When SPDLOG_NO_DATETIME is defined, the rotation was never worked because `msg.time` is always zero.
This commit is contained in:
parent
d8e17111b9
commit
7ffa0766b4
@ -67,8 +67,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void sink_it_(const details::log_msg &msg) override
|
void sink_it_(const details::log_msg &msg) override
|
||||||
{
|
{
|
||||||
|
#ifdef SPDLOG_NO_DATETIME
|
||||||
|
if (log_clock::now() >= rotation_tp_)
|
||||||
|
#else
|
||||||
if (msg.time >= rotation_tp_)
|
if (msg.time >= rotation_tp_)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(msg.time)), truncate_);
|
file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(msg.time)), truncate_);
|
||||||
rotation_tp_ = next_rotation_tp_();
|
rotation_tp_ = next_rotation_tp_();
|
||||||
|
Loading…
Reference in New Issue
Block a user