From 9e384ed54b6ca7348d798177d7b17c514937766d Mon Sep 17 00:00:00 2001
From: Nikita Strygin <nikita6@bk.ru>
Date: Thu, 16 Jun 2022 23:07:09 +0300
Subject: [PATCH] Make yuzu-cmd respect log_filter setting

Because logging infrastructure initializes before the loading of the
config, it reads the default setting for log_filter and ignores the one
set in config. To change log_filter after logging initialization some
additional calls need to be made.
---
 src/yuzu_cmd/yuzu.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 0dce5e274..e840732e2 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -138,6 +138,12 @@ int main(int argc, char** argv) {
 
     Config config{config_path};
 
+    // apply the log_filter setting
+    // the logger was initialized before and doesn't pick up the filter on its own
+    Common::Log::Filter filter;
+    filter.ParseFilterString(Settings::values.log_filter.GetValue());
+    Common::Log::SetGlobalFilter(filter);
+
     if (!program_args.empty()) {
         Settings::values.program_args = program_args;
     }