OCT 1. 更正16进制日志打印宏定义

This commit is contained in:
黄昕 2023-05-15 17:39:00 +08:00
parent 664ba3505f
commit 84ab5cf3de
1 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@ typedef enum {
fatal = ZLOG_LEVEL_FATAL
} ZLOG_LV;
#define DEF_ZLOG_MOD(ZLOG_MOD) \
#define DEF_ZLOG_MOD(ZLOG_MOD) \
ZLOG_MOD(ZLOG_MOD_MAIN, ZLOG_LEVEL_INFO, "MAIN") \
ZLOG_MOD(ZLOG_MOD_TASK, ZLOG_LEVEL_INFO, "TASK") \
ZLOG_MOD(ZLOG_MOD_INIT, ZLOG_LEVEL_INFO, "INIT") \
@ -36,8 +36,8 @@ typedef enum {
ZLOG_MOD(ZLOG_MOD_CRYPTO, ZLOG_LEVEL_INFO, "CRYPTO") \
ZLOG_MOD(ZLOG_MOD_MQ, ZLOG_LEVEL_INFO, "MQ") \
ZLOG_MOD(ZLOG_MOD_PROTO, ZLOG_LEVEL_INFO, "PROTO") \
ZLOG_MOD(ZLOG_MOD_HTTPD, ZLOG_LEVEL_INFO, "HTTPD") \
ZLOG_MOD(ZLOG_MOD_JSCHEM, ZLOG_LEVEL_INFO, "JSCHEM") \
ZLOG_MOD(ZLOG_MOD_HTTPD, ZLOG_LEVEL_INFO, "HTTPD") \
ZLOG_MOD(ZLOG_MOD_JSCHEM, ZLOG_LEVEL_INFO, "JSCHEM") \
ZLOG_MOD(ZLOG_MOD_USER, ZLOG_LEVEL_INFO, "USER") \
ZLOG_MOD(ZLOG_MOD_PPPOE, ZLOG_LEVEL_INFO, "PPPOE") \
ZLOG_MOD(ZLOG_MOD_VXLAN, ZLOG_LEVEL_INFO, "VXLAN") \
@ -63,8 +63,8 @@ typedef enum {
zlog(cat, __FILE__, sizeof(__FILE__) - 1, __func__, sizeof(__func__) - 1, __LINE__, ZLOG_LEVEL_TRACE, format, \
##__VA_ARGS__)
#define LOG_MSG(level, format, ...) LOG_MOD(level, ZLOG_MOD_MAIN, format, ##__VA_ARGS__)
#define LOG_MSG_HEX(level, format, ...) LOG_MOD_HEX(level, ZLOG_MOD_MAIN, format, ##__VA_ARGS__)
#define LOG_MSG(level, format, ...) LOG_MOD(level, ZLOG_MOD_MAIN, format, ##__VA_ARGS__)
#define LOG_MSG_HEX(level, buf, len) LOG_MOD_HEX(level, ZLOG_MOD_MAIN, (buf), (len))
#define LOG_MOD(level, mod, format, ...) \
do { \
@ -76,15 +76,15 @@ typedef enum {
} \
} while (0)
#define LOG_MOD_HEX(level, mod, format, ...) \
do { \
if (zlog_verify_level(level, mod)) { \
if (zlog_vni_tag_get()) { \
zlog_put_mdc("vni", zlog_vni_tag_get()); \
} \
hzlog_##level(zlog_get_mod_cat((mod)), format, ##__VA_ARGS__); \
printf("\n"); \
} \
#define LOG_MOD_HEX(level, mod, buf, len) \
do { \
if (zlog_verify_level(level, mod)) { \
if (zlog_vni_tag_get()) { \
zlog_put_mdc("vni", zlog_vni_tag_get()); \
} \
hzlog_##level(zlog_get_mod_cat((mod)), (buf), (len)); \
printf("\n"); \
} \
} while (0)
zlog_category_t *zlog_get_mod_cat(ZLOG_MOD_NAME logMod);