diff options
author | bunnei <bunneidev@gmail.com> | 2015-03-09 20:42:18 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-03-09 20:42:18 +0100 |
commit | 3da94a597b5642c1b586700d72255589cf5a0cdf (patch) | |
tree | 9f73ded034bceaab1f7e41cf19fe987d19b2e083 /src/common/logging/backend.cpp | |
parent | Merge pull request #645 from lioncash/ldm (diff) | |
parent | Logging: check for filter before sending to the queue, to skip all heavy formatting on the other thread. (diff) | |
download | yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar.gz yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar.bz2 yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar.lz yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar.xz yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.tar.zst yuzu-3da94a597b5642c1b586700d72255589cf5a0cdf.zip |
Diffstat (limited to 'src/common/logging/backend.cpp')
-rw-r--r-- | src/common/logging/backend.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 7c1010b22..7b479b569 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -135,9 +135,18 @@ Entry CreateEntry(Class log_class, Level log_level, return std::move(entry); } +static Filter* filter; + +void SetFilter(Filter* new_filter) { + filter = new_filter; +} + void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_nr, const char* function, const char* format, ...) { + if (!filter->CheckMessage(log_class, log_level)) + return; + va_list args; va_start(args, format); Entry entry = CreateEntry(log_class, log_level, |