mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "spdlog/sinks/ansicolor_sink.h"
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/pattern_formatter.h"
|
||||
#include "spdlog/details/os.h"
|
||||
|
||||
namespace spdlog {
|
||||
@@ -132,4 +133,4 @@ SPDLOG_INLINE ansicolor_stderr_sink<ConsoleMutex>::ansicolor_stderr_sink(color_m
|
||||
{}
|
||||
|
||||
} // namespace sinks
|
||||
} // namespace spdlog
|
||||
} // namespace spdlog
|
||||
|
@@ -67,10 +67,14 @@ public:
|
||||
protected:
|
||||
void sink_it_(const details::log_msg &msg) override
|
||||
{
|
||||
|
||||
if (msg.time >= rotation_tp_)
|
||||
#ifdef SPDLOG_NO_DATETIME
|
||||
auto time = log_clock::now();
|
||||
#else
|
||||
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;
|
||||
|
Reference in New Issue
Block a user