about summary refs log tree commit diff stats
path: root/src/include/debug.h
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-02-20 22:25:14 +0800
committerGitHub <noreply@github.com>2025-02-20 15:25:14 +0100
commitbb8559933f4e2745b6114e270548301ad081878a (patch)
treed064e60293fc6bc303b9d49e7b01298c2af1cb79 /src/include/debug.h
parentc2cb333261e31caedc2cf3ca2a13405c660c30b1 (diff)
downloadbox64-bb8559933f4e2745b6114e270548301ad081878a.tar.gz
box64-bb8559933f4e2745b6114e270548301ad081878a.zip
Made error logs prefix has red color (#2396)
Diffstat (limited to 'src/include/debug.h')
-rw-r--r--src/include/debug.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/debug.h b/src/include/debug.h
index d5786ae1..631e35d7 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -70,9 +70,9 @@ extern int box64_tcmalloc_minimal;  // when using tcmalloc_minimal
 
 void printf_ftrace(int prefix, const char* fmt, ...);
 
-#define printf_log_prefix(prefix, L, ...)                                 \
-    do {                                                                  \
-        if ((L) <= BOX64ENV(log)) { printf_ftrace(prefix, __VA_ARGS__); } \
+#define printf_log_prefix(prefix, L, ...)                                                               \
+    do {                                                                                                \
+        if ((L) <= BOX64ENV(log)) { printf_ftrace(prefix + (prefix && (L) == LOG_NONE), __VA_ARGS__); } \
     } while (0)
 
 #define printf_log(L, ...) printf_log_prefix(1, L, __VA_ARGS__)