From fbba6dff20b0c04a0694515168914a62161999d7 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 31 Oct 2022 23:23:57 +0200 Subject: [PATCH] Fix #2431 --- include/spdlog/sinks/dist_sink.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/spdlog/sinks/dist_sink.h b/include/spdlog/sinks/dist_sink.h index 8fccb4ee..065048ad 100644 --- a/include/spdlog/sinks/dist_sink.h +++ b/include/spdlog/sinks/dist_sink.h @@ -57,20 +57,20 @@ public: protected: void sink_it_(const details::log_msg &msg) override { - for (auto &sink : sinks_) + for (auto &sub_sink : sinks_) { - if (sink->should_log(msg.level)) + if (sub_sink->should_log(msg.level)) { - sink->log(msg); + sub_sink->log(msg); } } } void flush_() override { - for (auto &sink : sinks_) + for (auto &sub_sink : sinks_) { - sink->flush(); + sub_sink->flush(); } } @@ -82,9 +82,9 @@ protected: void set_formatter_(std::unique_ptr sink_formatter) override { base_sink::formatter_ = std::move(sink_formatter); - for (auto &sink : sinks_) + for (auto &sub_sink : sinks_) { - sink->set_formatter(base_sink::formatter_->clone()); + sub_sink->set_formatter(base_sink::formatter_->clone()); } } std::vector> sinks_;