From 03d6500250957a9fe5b1afc4fe5a97b46413eab6 Mon Sep 17 00:00:00 2001 From: Stenzek <stenzek@gmail.com> Date: Sat, 13 Jan 2024 14:47:46 +1000 Subject: [PATCH] Log: Skip argument packing when below filter level --- src/common/log.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/log.h b/src/common/log.h index f693c1368..3ff11092f 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -76,7 +76,8 @@ template<typename... T> ALWAYS_INLINE static void WriteFmt(const char* channelName, const char* functionName, LOGLEVEL level, fmt::format_string<T...> fmt, T&&... args) { - return WriteFmtArgs(channelName, functionName, level, fmt, fmt::make_format_args(args...)); + if (level <= GetLogLevel()) + return WriteFmtArgs(channelName, functionName, level, fmt, fmt::make_format_args(args...)); } } // namespace Log