33
44extern void printf (char * , ...);
55extern int threadid ();
6- extern void shutdown ( );
6+ extern void dummy ( int , ... );
77
88#if defined(LOG_LEVEL_ERROR )
99
@@ -61,7 +61,7 @@ enum LOG_COLOR {
6161 ##__VA_ARGS__); \
6262 } while (0)
6363#else
64- #define errorf (fmt , ...)
64+ #define errorf (fmt , ...) dummy(0, ##__VA_ARGS__)
6565#endif // USE_LOG_ERROR
6666
6767#if defined(USE_LOG_WARN )
@@ -72,7 +72,7 @@ enum LOG_COLOR {
7272 ##__VA_ARGS__); \
7373 } while (0)
7474#else
75- #define warnf (fmt , ...)
75+ #define warnf (fmt , ...) dummy(0, ##__VA_ARGS__)
7676#endif // USE_LOG_WARN
7777
7878#if defined(USE_LOG_INFO )
@@ -83,7 +83,7 @@ enum LOG_COLOR {
8383 ##__VA_ARGS__); \
8484 } while (0)
8585#else
86- #define infof (fmt , ...)
86+ #define infof (fmt , ...) dummy(0, ##__VA_ARGS__)
8787#endif // USE_LOG_INFO
8888
8989#if defined(USE_LOG_DEBUG )
@@ -94,7 +94,7 @@ enum LOG_COLOR {
9494 ##__VA_ARGS__); \
9595 } while (0)
9696#else
97- #define debugf (fmt , ...)
97+ #define debugf (fmt , ...) dummy(0, ##__VA_ARGS__)
9898#endif // USE_LOG_DEBUG
9999
100100#if defined(USE_LOG_TRACE )
@@ -105,16 +105,14 @@ enum LOG_COLOR {
105105 ##__VA_ARGS__); \
106106 } while (0)
107107#else
108- #define tracef (fmt , ...)
108+ #define tracef (fmt , ...) dummy(0, ##__VA_ARGS__)
109109#endif // USE_LOG_TRACE
110110
111111#define panic (fmt , ...) \
112112 do { \
113113 int tid = threadid(); \
114114 printf("\x1b[%dm[%s %d] %s:%d: " fmt "\x1b[0m\n", RED, \
115115 "PANIC", tid, __FILE__, __LINE__, ##__VA_ARGS__); \
116- shutdown(); \
117- \
118116 } while (0)
119117
120118#endif //! LOG_H
0 commit comments