Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabi Melman <gmelman1@gmail.com>2018-06-21 17:22:18 +0300
committerGitHub <noreply@github.com>2018-06-21 17:22:18 +0300
commitc639483db04814998e9ef4c19109b7059db12f41 (patch)
tree9665b191e571cf01fb167974e86eb4a3746c71c2
parent032035e72f73b232e2fa087dc6021a3732c9f6ae (diff)
parentb3881b9c15d9a4529c4a57b17b88c3faeba01255 (diff)
Merge pull request #735 from jwnimmer-tri/dist_sink_reset
add remove_all_sinks method to dist_sink
-rw-r--r--include/spdlog/sinks/dist_sink.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/spdlog/sinks/dist_sink.h b/include/spdlog/sinks/dist_sink.h
index 1265cc7e..b4a7b6a1 100644
--- a/include/spdlog/sinks/dist_sink.h
+++ b/include/spdlog/sinks/dist_sink.h
@@ -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>;