diff --git a/include/aidge/utils/Log.hpp b/include/aidge/utils/Log.hpp index ca16018db472b7daa6d6ff5f248420b6ab1f14e9..394d65906d1b616f8b68e7ecf7d06a5f7f26c555 100644 --- a/include/aidge/utils/Log.hpp +++ b/include/aidge/utils/Log.hpp @@ -108,15 +108,15 @@ public: * @param args Format string and arguments for the message * @note Debug messages are only compiled in debug builds */ -#ifdef NDEBUG +#ifndef NDEBUG template <typename... Args> - static void debug(Args&&... /*args*/) { - // Debug logging disabled in release builds + static void debug(Args&&... args) { + log(Debug, fmt::format(std::forward<Args>(args)...)); } #else template <typename... Args> - static void debug(Args&&... args) { - log(Debug, fmt::format(std::forward<Args>(args)...)); + static void debug(Args&&... /*args*/) { + // Debug logging disabled in release builds } #endif diff --git a/src/utils/Log.cpp b/src/utils/Log.cpp index b2aad14c9ed9f21b9f262d72939abbed0488d830..45f03a7ae32a8727a67924ae5d28643aeb63e3c6 100644 --- a/src/utils/Log.cpp +++ b/src/utils/Log.cpp @@ -26,7 +26,7 @@ namespace Aidge { * Log::Level::Notice. */ Log::Level Log::mConsoleLevel = []() { -#ifdef NDEBUG +#ifndef NDEBUG constexpr Level defaultLevel = Level::Debug; #else constexpr Log::Level defaultLevel = Level::Notice; @@ -57,7 +57,7 @@ bool Log::mConsoleColor = []() { * then the default level is Log::Level::Debug, else it is Log::Level::Notice. */ Log::Level Log::mFileLevel = []() { -#ifdef NDEBUG +#ifndef NDEBUG constexpr Level defaultLevel = Level::Debug; #else constexpr Log::Level defaultLevel = Level::Notice;