From 0aa44e238db7a72f4fb8b347168ec76c3ce48ad5 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 6 Mar 2015 19:15:02 +0100 Subject: Logging: check for filter before sending to the queue, to skip all heavy formatting on the other thread. --- src/common/logging/text_formatter.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/common/logging/text_formatter.cpp') diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index ef5739d8..36c91c4f 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -11,7 +11,6 @@ #endif #include "common/logging/backend.h" -#include "common/logging/filter.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" @@ -116,7 +115,7 @@ void PrintColoredMessage(const Entry& entry) { #endif } -void TextLoggingLoop(std::shared_ptr logger, const Filter* filter) { +void TextLoggingLoop(std::shared_ptr logger) { std::array entry_buffer; while (true) { @@ -126,9 +125,7 @@ void TextLoggingLoop(std::shared_ptr logger, const Filter* filter) { } for (size_t i = 0; i < num_entries; ++i) { const Entry& entry = entry_buffer[i]; - if (filter->CheckMessage(entry.log_class, entry.log_level)) { - PrintColoredMessage(entry); - } + PrintColoredMessage(entry); } } } -- cgit v1.2.3