Skip to content

Commit

Permalink
Fix #2431
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Oct 31, 2022
1 parent fdb1f59 commit fbba6df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/spdlog/sinks/dist_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ class dist_sink : public base_sink<Mutex>
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();
}
}

Expand All @@ -82,9 +82,9 @@ class dist_sink : public base_sink<Mutex>
void set_formatter_(std::unique_ptr<spdlog::formatter> sink_formatter) override
{
base_sink<Mutex>::formatter_ = std::move(sink_formatter);
for (auto &sink : sinks_)
for (auto &sub_sink : sinks_)
{
sink->set_formatter(base_sink<Mutex>::formatter_->clone());
sub_sink->set_formatter(base_sink<Mutex>::formatter_->clone());
}
}
std::vector<std::shared_ptr<sink>> sinks_;
Expand Down

0 comments on commit fbba6df

Please sign in to comment.