From f0e084d5307a1e8ac1867471ba69c341f0355b91 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Fri, 27 Sep 2024 14:23:05 +0200 Subject: [PATCH] Log: fix some parts of messages not being discarded early `m_IsNoOp` was introduced to avoid building up log messages that will later be discarded, like debug messages if no debug logging is configured. However, it looks like the template operator<< implemented in the header file was forgotten when adding this feature, all other places writing into `m_Buffer` already have an if guard like added by this commit. --- lib/base/logger.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/base/logger.hpp b/lib/base/logger.hpp index 10e0872ae..7b4758d8b 100644 --- a/lib/base/logger.hpp +++ b/lib/base/logger.hpp @@ -121,7 +121,10 @@ public: template Log& operator<<(const T& val) { - m_Buffer << val; + if (!m_IsNoOp) { + m_Buffer << val; + } + return *this; }