mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
added level_t to sink. Improves the flexibility of loggers with multiple sinks
This commit is contained in:
@@ -245,8 +245,11 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons
|
||||
inline void spdlog::logger::_sink_it(details::log_msg& msg)
|
||||
{
|
||||
_formatter->format(msg);
|
||||
for (auto &sink : _sinks)
|
||||
sink->log(msg);
|
||||
for (auto &sink : _sinks){
|
||||
if( sink->should_log( msg.level)){
|
||||
sink->log(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if(_should_flush_on(msg))
|
||||
flush();
|
||||
|
||||
Reference in New Issue
Block a user