diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 7a2bd52d..b9ed7e1f 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -209,7 +209,7 @@ protected: } } virtual void flush_(); - bool should_flush_(const details::log_msg &msg); + [[nodiscard]] bool should_flush_(const details::log_msg &msg) const; // handle errors during logging. // default handler prints the error to stderr at max rate of 1 message/sec. diff --git a/src/logger.cpp b/src/logger.cpp index 66d2265a..4fc320e4 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -81,7 +81,7 @@ void logger::flush_() { } } -bool logger::should_flush_(const details::log_msg &msg) { +bool logger::should_flush_(const details::log_msg &msg) const { auto flush_level = flush_level_.load(std::memory_order_relaxed); return (msg.log_level >= flush_level) && (msg.log_level != level::off); }