mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
add remove_all_sinks method to dist_sink
This allows users to set exactly the sinks they want, even if other unknown application code has added bespoke sinks in the meantime.
This commit is contained in:
parent
032035e72f
commit
b3881b9c15
@ -62,6 +62,12 @@ public:
|
||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
|
||||
_sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end());
|
||||
}
|
||||
|
||||
void remove_all_sinks()
|
||||
{
|
||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
|
||||
_sinks.clear();
|
||||
}
|
||||
};
|
||||
|
||||
using dist_sink_mt = dist_sink<std::mutex>;
|
||||
|
Loading…
Reference in New Issue
Block a user