Commit f63df652 authored by gabime's avatar gabime

some cleanup in logger

parent 099137fe
...@@ -138,11 +138,9 @@ SPDLOG_INLINE void logger::enable_backtrace(size_t n_messages) ...@@ -138,11 +138,9 @@ SPDLOG_INLINE void logger::enable_backtrace(size_t n_messages)
{ {
if (!backtrace_sink_) if (!backtrace_sink_)
{ {
auto new_backtrace_sink = new spdlog::sinks::backtrace_sink_mt(std::move(sinks_), level(), n_messages); backtrace_sink_ = std::make_shared<sinks::backtrace_sink_mt>((std::move(sinks_), level(), n_messages));
backtrace_sink_.reset(new_backtrace_sink);
sinks().push_back(backtrace_sink_); sinks().push_back(backtrace_sink_);
assert(sinks().size() == 1); level_.store(level::trace); // pass all messages to the backtrace sink.
level_.store(level::trace);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment