Settings: Set log level to none if no sinks enabled

This commit is contained in:
Stenzek 2024-09-23 00:26:33 +10:00
parent cf32774b24
commit 23ec40d032
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -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);