summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Logging/LogManager.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2026-11-04 18:58:44 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2026-11-08 13:08:09 -0600
commitd02fc5f4bb1733a0cfd45ee00b4a8e3ff2a53ca3 (patch)
treeac573056dc0f8e5e992d7d41e2014be511c2da52 /Source/Core/Common/Logging/LogManager.cpp
parent5c3b7f75e1a5e40a8e9761863d7022b3003c252f (diff)
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.
Diffstat (limited to 'Source/Core/Common/Logging/LogManager.cpp')
-rw-r--r--Source/Core/Common/Logging/LogManager.cpp5
1 files changed, 1 insertions, 4 deletions
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<bool>(m_listener_ids))
- return;
-
LogWithFullPath(level, type, file + GetPathCutOffPoint(), line, message);
}