mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-26 07:29:03 +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_)
|
if (backtrace_sink_)
|
||||||
{
|
{
|
||||||
auto tracer = static_cast<sinks::backtrace_sink_mt *>(backtrace_sink_.get());
|
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_;
|
return filter_level_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_backtrace()
|
void dump_backtrace(string_view_t logger_name)
|
||||||
{
|
{
|
||||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
|
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
|
||||||
dump_backtrace_();
|
dump_backtrace_(logger_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -61,13 +61,12 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_backtrace_()
|
void dump_backtrace_(string_view_t logger_name)
|
||||||
{
|
{
|
||||||
if (traceback_msgs_.empty())
|
if (traceback_msgs_.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char *logger_name = "??????";
|
|
||||||
dist_sink<Mutex>::sink_it_(
|
dist_sink<Mutex>::sink_it_(
|
||||||
details::log_msg{logger_name, level::info, "********************* Backtrace Start *********************"});
|
details::log_msg{logger_name, level::info, "********************* Backtrace Start *********************"});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user