summaryrefslogtreecommitdiff
path: root/src/log.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-15 09:48:58 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-20 23:45:01 +0800
commit28ad3d86ecd2ed6212ec4febd0bb90bd55c152c3 (patch)
tree3bd8cf8509ef9742b5ce3938fea702de5365ee7d /src/log.hpp
parent649965ec50eb2028c08a8cb6bfa77a62891f1797 (diff)
debug: only run hooks that is for debug purposes in debug builds
log: only log TRACE in debug builds
Diffstat (limited to 'src/log.hpp')
-rw-r--r--src/log.hpp8
1 files changed, 8 insertions, 0 deletions
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 <unistd.h>
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 <typename... Args>
void log(FILE *_stream, eFormatType type, std::format_string<Args...> fmt, Args &&...args) {
+#ifndef DEBUG
+ if (type == TRACE)
+ return;
+#endif
std::println(_stream, "{}", NFormatter::fmt(type, fmt, std::forward<Args>(args)...));
}