From 23ec40d0326c0a87e1a545a000033b4f91d437b5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 23 Sep 2024 00:26:33 +1000 Subject: [PATCH] Settings: Set log level to none if no sinks enabled --- src/core/settings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 08f402654..80df935cc 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -853,8 +853,9 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages) void Settings::UpdateLogSettings() { - Log::SetLogLevel(log_level); - Log::SetLogFilter(log_filter); + const bool any_logs_enabled = (log_to_console || log_to_debug || log_to_window || log_to_file); + Log::SetLogLevel(any_logs_enabled ? log_level : Log::Level::None); + Log::SetLogFilter(any_logs_enabled ? std::string_view(log_filter) : std::string_view()); Log::SetConsoleOutputParams(log_to_console, log_timestamps); Log::SetDebugOutputParams(log_to_debug);