mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-01 02:49:03 +08:00
Unnecessary backtrace begin/end logs (#2568)
* add empty getter function to tracer * add unit test to check empty tracer Co-authored-by: Gyorgy Katona <gykatona@logmein.com>
This commit is contained in:
@@ -210,7 +210,7 @@ SPDLOG_INLINE void logger::flush_()
|
||||
SPDLOG_INLINE void logger::dump_backtrace_()
|
||||
{
|
||||
using details::log_msg;
|
||||
if (tracer_.enabled())
|
||||
if (tracer_.enabled() && !tracer_.empty())
|
||||
{
|
||||
sink_it_(log_msg{name(), level::info, "****************** Backtrace Start ******************"});
|
||||
tracer_.foreach_pop([this](const log_msg &msg) { this->sink_it_(msg); });
|
||||
|
Reference in New Issue
Block a user