diff --git a/include/spdlog/sinks/dist_sink.h b/include/spdlog/sinks/dist_sink.h index b3e2e525..721a9abd 100644 --- a/include/spdlog/sinks/dist_sink.h +++ b/include/spdlog/sinks/dist_sink.h @@ -62,7 +62,25 @@ protected: void flush_() override { for (auto &sink : sinks_) + { sink->flush(); + } + } + + + void set_pattern_(const std::string &pattern) override + { + set_formatter_(spdlog::make_unique(pattern)); + } + + + void set_formatter_(std::unique_ptr sink_formatter) override + { + base_sink::formatter_ = std::move(sink_formatter); + for (auto &sink : sinks_) + { + sink->set_formatter(base_sink::formatter_ ->clone()); + } } std::vector> sinks_; };