aboutsummaryrefslogtreecommitdiff
path: root/src/common/logging/filter.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-15 12:58:52 -0700
committerGitHub <noreply@github.com>2018-07-15 12:58:52 -0700
commit04b9cde4f5a59e55ae7daac20f79121f8c7e0386 (patch)
tree64528e1b2ced65cf0f9a1a22ffaedabb069fa13d /src/common/logging/filter.cpp
parent98762e9601abf64d37774a7ade6eb0cf640b6852 (diff)
parent497b81558e2543f3b42e4267d8ea9acc40bdf03b (diff)
Merge pull request #664 from jroweboy/logging-stuff
Minor logging improvements
Diffstat (limited to 'src/common/logging/filter.cpp')
-rw-r--r--src/common/logging/filter.cpp7
1 files changed, 7 insertions, 0 deletions
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<u8>(level) >= static_cast<u8>(class_levels[static_cast<size_t>(log_class)]);
}
+
+bool Filter::IsDebug() const {
+ return std::any_of(class_levels.begin(), class_levels.end(), [](const Level& l) {
+ return static_cast<u8>(l) <= static_cast<u8>(Level::Debug);
+ });
+}
+
} // namespace Log