From 9055c98e09ec5353ff4d409ee37f692c685d82d9 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 22 Oct 2022 14:58:27 +0100 Subject: [PATCH] Only enable debug/verbose logs in (rel)debug builds --- app/src/main/cpp/skyline/common/logger.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/cpp/skyline/common/logger.h b/app/src/main/cpp/skyline/common/logger.h index aadfc892..433e7f8f 100644 --- a/app/src/main/cpp/skyline/common/logger.h +++ b/app/src/main/cpp/skyline/common/logger.h @@ -134,38 +134,50 @@ namespace skyline { template static void Debug(FunctionString formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Debug <= configLevel) Write(LogLevel::Debug, util::Format(*formatString, args...)); + #endif } template static void Debug(FunctionString formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Debug <= configLevel) Write(LogLevel::Debug, util::Format(*formatString, args...)); + #endif } template static void DebugNoPrefix(S formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Debug <= configLevel) Write(LogLevel::Debug, util::Format(formatString, args...)); + #endif } template static void Verbose(FunctionString formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Verbose <= configLevel) Write(LogLevel::Verbose, util::Format(*formatString, args...)); + #endif } template static void Verbose(FunctionString formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Verbose <= configLevel) Write(LogLevel::Verbose, util::Format(*formatString, args...)); + #endif } template static void VerboseNoPrefix(S formatString, Args &&... args) { + #ifndef NDEBUG if (LogLevel::Verbose <= configLevel) Write(LogLevel::Verbose, util::Format(formatString, args...)); + #endif } }; }