mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-25 06:59:11 +08:00
Pass logger name to tracer
This commit is contained in:
parent
8280c0d64c
commit
36f253893e
@ -165,7 +165,7 @@ SPDLOG_INLINE void logger::dump_backtrace()
|
||||
if (backtrace_sink_)
|
||||
{
|
||||
auto tracer = static_cast<sinks::backtrace_sink_mt *>(backtrace_sink_.get());
|
||||
tracer->dump_backtrace();
|
||||
tracer->dump_backtrace(name());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ public:
|
||||
return filter_level_;
|
||||
}
|
||||
|
||||
void dump_backtrace()
|
||||
void dump_backtrace(string_view_t logger_name)
|
||||
{
|
||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
|
||||
dump_backtrace_();
|
||||
dump_backtrace_(logger_name);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -61,13 +61,12 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void dump_backtrace_()
|
||||
void dump_backtrace_(string_view_t logger_name)
|
||||
{
|
||||
if (traceback_msgs_.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
const char *logger_name = "??????";
|
||||
dist_sink<Mutex>::sink_it_(
|
||||
details::log_msg{logger_name, level::info, "********************* Backtrace Start *********************"});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user