From 66b08294cad7cf06e5972dcf2b3a980377ea2698 Mon Sep 17 00:00:00 2001 From: Therenall Date: Sat, 24 Sep 2016 15:14:05 -0400 Subject: [PATCH] Exposed logger sinks. --- include/spdlog/details/logger_impl.h | 5 +++++ include/spdlog/logger.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index a337b359..2b27f105 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -291,3 +291,8 @@ inline bool spdlog::logger::_should_flush_on(const details::log_msg &msg) const auto flush_level = _flush_level.load(std::memory_order_relaxed); return (msg.level >= flush_level) && (msg.level != level::off); } + +inline const std::vector& spdlog::logger::sinks() const +{ + return _sinks; +} diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index e998999e..ca0b4b2d 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -68,6 +68,8 @@ public: virtual void flush(); + const std::vector& sinks() const; + protected: virtual void _sink_it(details::log_msg&); virtual void _set_pattern(const std::string&); @@ -90,5 +92,3 @@ protected: } #include - -