From d02fc5f4bb1733a0cfd45ee00b4a8e3ff2a53ca3 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 4 Nov 2026 18:58:44 -0600 Subject: Common/Logging/LogManager: Add IsListenerEnabled function to avoid string formatting when log types are enabled but all listeners are disabled. Also eliminate redundant IsEnabled(type, level) check. --- Source/Core/Common/Logging/LogManager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Source/Core/Common/Logging/LogManager.cpp') diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 5a586623cb..ae3ea6a66c 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -65,7 +65,7 @@ void GenericLogFmtImpl(LogLevel level, LogType type, const char* file, int line, if (instance == nullptr) return; - if (!instance->IsEnabled(type, level)) + if (!instance->IsEnabled(type, level) || !instance->IsAnyListenerEnabled()) return; const auto message = fmt::vformat(format, args); @@ -193,9 +193,6 @@ void LogManager::SaveSettings() void LogManager::Log(LogLevel level, LogType type, const char* file, int line, const char* message) { - if (!IsEnabled(type, level) || !static_cast(m_listener_ids)) - return; - LogWithFullPath(level, type, file + GetPathCutOffPoint(), line, message); } -- cgit v1.2.3