Function apply_all

Synopsis

#include <include/spdlog/spdlog.h>

SPDLOG_INLINE void apply_all(const std::function< void(std::shared_ptr< logger >)> &fun)

Description

Apply a user defined function on all registered loggers Example: spdlog::apply_all([&](std::shared_ptr<spdlog::logger> l) {l->flush();});

Source

Lines 85-88 in include/spdlog/spdlog-inl.h. Line 95 in include/spdlog/spdlog.h.

SPDLOG_INLINE void apply_all(const std::function<void(std::shared_ptr<logger>)> &fun)
{
    details::registry::instance().apply_all(fun);
}





Add Discussion

Log in to comment