From 28ad3d86ecd2ed6212ec4febd0bb90bd55c152c3 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 15 Mar 2025 09:48:58 +0800 Subject: debug: only run hooks that is for debug purposes in debug builds log: only log TRACE in debug builds --- src/log.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/log.hpp') diff --git a/src/log.hpp b/src/log.hpp index 8e7f0c1..996b6bc 100644 --- a/src/log.hpp +++ b/src/log.hpp @@ -6,11 +6,19 @@ #include inline void log(FILE *_stream, eFormatType type, std::string str) { +#ifndef DEBUG + if (type == TRACE) + return; +#endif std::println(_stream, "{}", NFormatter::fmt(type, str)); } template void log(FILE *_stream, eFormatType type, std::format_string fmt, Args &&...args) { +#ifndef DEBUG + if (type == TRACE) + return; +#endif std::println(_stream, "{}", NFormatter::fmt(type, fmt, std::forward(args)...)); } -- cgit v1.2.3