From cc30f32033504ff56de2acbb8f457f1d2d4d87c5 Mon Sep 17 00:00:00 2001 From: F00 <1565438246@qq.com> Date: Sat, 13 Apr 2024 09:53:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A7=A3=E5=86=B3=E6=9C=89=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E8=BE=93=E5=87=BA=E5=90=8E=EF=BC=8CLetter=20shell?= =?UTF-8?q?=E5=92=8C=E6=AD=A3=E5=B8=B8=E7=9A=84print=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E8=A2=AB=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2、解决当LOG_TIME_STAMP为64位数据的时候,出现输出异常、死机的情况; --- extensions/log/log.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/extensions/log/log.h b/extensions/log/log.h index 4c4075e..5a86f65 100644 --- a/extensions/log/log.h +++ b/extensions/log/log.h @@ -74,17 +74,19 @@ extern "C" { * log级别字符(包含颜色) */ #if LOG_USING_COLOR == 1 -#define ERROR_TEXT CSI(31) "E(%d) %s:" CSI(39) /**< 错误标签 */ -#define WARNING_TEXT CSI(33) "W(%d) %s:" CSI(39) /**< 警告标签 */ -#define INFO_TEXT CSI(32) "I(%d) %s:" CSI(39) /**< 信息标签 */ -#define DEBUG_TEXT CSI(34) "D(%d) %s:" CSI(39) /**< 调试标签 */ -#define VERBOSE_TEXT CSI(36) "V(%d) %s:" CSI(39) /**< 冗余信息标签 */ +#define ERROR_TEXT CSI(31) "E(%lld) %s:" CSI(39) /**< 错误标签 */ +#define WARNING_TEXT CSI(33) "W(%lld) %s:" CSI(39) /**< 警告标签 */ +#define INFO_TEXT CSI(32) "I(%lld) %s:" CSI(39) /**< 信息标签 */ +#define DEBUG_TEXT CSI(34) "D(%lld) %s:" CSI(39) /**< 调试标签 */ +#define VERBOSE_TEXT CSI(36) "V(%lld) %s:" CSI(39) /**< 冗余信息标签 */ +#define DEFAULT_TEXT CSI(39) /**< 颜色输出后恢复原色 */ #else -#define ERROR_TEXT "E(%d) %s:" -#define WARNING_TEXT "W(%d) %s:" -#define INFO_TEXT "I(%d) %s:" -#define DEBUG_TEXT "D(%d) %s:" -#define VERBOSE_TEXT "V(%d) %s:" +#define ERROR_TEXT "E(%lld) %s:" +#define WARNING_TEXT "W(%lld) %s:" +#define INFO_TEXT "I(%lld) %s:" +#define DEBUG_TEXT "D(%lld) %s:" +#define VERBOSE_TEXT "V(%lld) %s:" +#define DEFAULT_TEXT "" #endif @@ -142,7 +144,7 @@ typedef struct log_def */ #define logFormat(text, level, fmt, ...) \ if (LOG_ENABLE) {\ - logWrite(LOG_ALL_OBJ, level, text " " fmt "" LOG_END, \ + logWrite(LOG_ALL_OBJ, level, text " " fmt "" LOG_END DEFAULT_TEXT, \ LOG_TIME_STAMP, LOG_TAG, ##__VA_ARGS__); } /**