summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Logging/LogManager.cpp5
-rw-r--r--Source/Core/Common/Logging/LogManager.h1
2 files changed, 2 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);
}
diff --git a/Source/Core/Common/Logging/LogManager.h b/Source/Core/Common/Logging/LogManager.h
index 624cd1e697..7e145b0da1 100644
--- a/Source/Core/Common/Logging/LogManager.h
+++ b/Source/Core/Common/Logging/LogManager.h
@@ -75,6 +75,7 @@ public:
void RegisterListener(LogListener::LISTENER id, std::unique_ptr<LogListener> listener);
void EnableListener(LogListener::LISTENER id, bool enable);
bool IsListenerEnabled(LogListener::LISTENER id) const;
+ bool IsAnyListenerEnabled() const { return static_cast<bool>(m_listener_ids); }
void SaveSettings();