Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x

This commit is contained in:
gabime
2019-07-05 10:45:24 +03:00
23 changed files with 270 additions and 272 deletions

View File

@@ -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

View File

@@ -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;