better print.

This commit is contained in:
Gatsby Van
2024-01-24 10:52:28 +08:00
parent 78ef83a095
commit 989b9495c6
2 changed files with 13 additions and 14 deletions
+6 -6
View File
@@ -40,24 +40,24 @@
/* Stringify */ /* Stringify */
#define STR(x) #x #define STR(x) #x
// #define _814_DEBUG_LEVEL 3 // #define _DEBUG_LEVEL 3
#if _814_DEBUG_LEVEL > 0 #if _DEBUG_LEVEL > 0
#define DBG_PRINT(...) printf(__VA_ARGS__) #define DBG_PRINT(...) printf(__VA_ARGS__)
#endif #endif
#if _814_DEBUG_LEVEL >= 1 #if _DEBUG_LEVEL >= 1
#define DBG_ERROR(...) __PRINT_BLOCK( \ #define DBG_ERROR(...) __PRINT_BLOCK( \
printf("in"__FILE__ \ printf("in"__FILE__ \
" #%4d [error]\t", \ ":%d [error]\t", \
__LINE__); \ __LINE__); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)
#endif #endif
#if _814_DEBUG_LEVEL >= 2 #if _DEBUG_LEVEL >= 2
#define DBG_WARNING(...) __PRINT_BLOCK( \ #define DBG_WARNING(...) __PRINT_BLOCK( \
printf("[warning]\t"); \ printf("[warning]\t"); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)
#endif #endif
#if _814_DEBUG_LEVEL >= 3 #if _DEBUG_LEVEL >= 3
#define DBG_INFO(...) __PRINT_BLOCK( \ #define DBG_INFO(...) __PRINT_BLOCK( \
printf("[Info]\t"); \ printf("[Info]\t"); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)
+7 -8
View File
@@ -24,7 +24,6 @@
#include <assert.h> #include <assert.h>
#include "util.h" #include "util.h"
#include "error.h" #include "error.h"
#include "../config/app_config.h"
/************************** Constant Definitions *****************************/ /************************** Constant Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/ /***************** Macros (Inline Functions) Definitions *********************/
@@ -40,24 +39,24 @@
/* Stringify */ /* Stringify */
#define STR(x) #x #define STR(x) #x
// #define _814_DEBUG_LEVEL 3 // #define _DEBUG_LEVEL 3
#if _814_DEBUG_LEVEL > 0 #if _DEBUG_LEVEL > 0
#define DBG_PRINT(...) printf(__VA_ARGS__) #define DBG_PRINT(...) printf(__VA_ARGS__)
#endif #endif
#if _814_DEBUG_LEVEL >= 1 #if _DEBUG_LEVEL >= 1
#define DBG_ERROR(...) __PRINT_BLOCK( \ #define DBG_ERROR(...) __PRINT_BLOCK( \
printf("in"__FILE__ \ printf("in "__FILE__ \
" #%4d [error]\t", \ ":%d [error]\t", \
__LINE__); \ __LINE__); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)
#endif #endif
#if _814_DEBUG_LEVEL >= 2 #if _DEBUG_LEVEL >= 2
#define DBG_WARNING(...) __PRINT_BLOCK( \ #define DBG_WARNING(...) __PRINT_BLOCK( \
printf("[warning]\t"); \ printf("[warning]\t"); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)
#endif #endif
#if _814_DEBUG_LEVEL >= 3 #if _DEBUG_LEVEL >= 3
#define DBG_INFO(...) __PRINT_BLOCK( \ #define DBG_INFO(...) __PRINT_BLOCK( \
printf("[Info]\t"); \ printf("[Info]\t"); \
printf(__VA_ARGS__);) printf(__VA_ARGS__);)