From 497b81558e2543f3b42e4267d8ea9acc40bdf03b Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sat, 14 Jul 2018 12:47:14 -0600 Subject: Logging: Dump all logs in the queue on close in debug mode --- src/common/logging/filter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/common/logging/filter.cpp') diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 4e783a577..6ed087beb 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -94,4 +94,11 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin, bool Filter::CheckMessage(Class log_class, Level level) const { return static_cast(level) >= static_cast(class_levels[static_cast(log_class)]); } + +bool Filter::IsDebug() const { + return std::any_of(class_levels.begin(), class_levels.end(), [](const Level& l) { + return static_cast(l) <= static_cast(Level::Debug); + }); +} + } // namespace Log -- cgit v1.2.3