summaryrefslogtreecommitdiffstats
path: root/src/common/logging/text_formatter.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2014-12-06 23:00:08 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2014-12-13 05:08:06 +0100
commit0e0a007a2503d468391004c8ea2faae305232345 (patch)
tree75feea527bd46aa4c534b77b560c89d538757f7f /src/common/logging/text_formatter.cpp
parentConvert old logging calls to new logging macros (diff)
downloadyuzu-0e0a007a2503d468391004c8ea2faae305232345.tar
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.gz
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.bz2
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.lz
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.xz
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.zst
yuzu-0e0a007a2503d468391004c8ea2faae305232345.zip
Diffstat (limited to 'src/common/logging/text_formatter.cpp')
-rw-r--r--src/common/logging/text_formatter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp
index 88deb150e..3fe435346 100644
--- a/src/common/logging/text_formatter.cpp
+++ b/src/common/logging/text_formatter.cpp
@@ -11,6 +11,7 @@
#endif
#include "common/logging/backend.h"
+#include "common/logging/filter.h"
#include "common/logging/log.h"
#include "common/logging/text_formatter.h"
@@ -105,7 +106,7 @@ void PrintMessage(const Entry& entry) {
fputc('\n', stderr);
}
-void TextLoggingLoop(std::shared_ptr<Logger> logger) {
+void TextLoggingLoop(std::shared_ptr<Logger> logger, const Filter* filter) {
std::array<Entry, 256> entry_buffer;
while (true) {
@@ -114,7 +115,10 @@ void TextLoggingLoop(std::shared_ptr<Logger> logger) {
break;
}
for (size_t i = 0; i < num_entries; ++i) {
- PrintMessage(entry_buffer[i]);
+ const Entry& entry = entry_buffer[i];
+ if (filter->CheckMessage(entry.log_class, entry.log_level)) {
+ PrintMessage(entry);
+ }
}
}
}