From 08bdab84b9b9966a00c808b2a43920d14efd6f21 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Thu, 23 Jul 2026 13:28:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=BB=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E8=BF=99=E9=87=8C=E4=B9=8B=E5=89=8D=E6=98=AF=E5=9B=A0?= =?UTF-8?q?=E4=B8=BAGBA=E5=B9=B3=E5=8F=B0=E4=B8=8B=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81vprintf=EF=BC=8C=E7=8E=B0=E5=9C=A8=E4=B8=BA=E4=BA=86?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E7=9C=8B=E6=89=93=E5=8D=B0=E6=8C=89=E8=A3=81?= =?UTF-8?q?=E5=89=AA=E5=AE=8F=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/common/common.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/library/common/common.c b/library/common/common.c index 22e9543..68e0e9a 100644 --- a/library/common/common.c +++ b/library/common/common.c @@ -2,10 +2,20 @@ #include #include #include "common.h" +#include // 必须包含此头文件以使用变参宏 WEAK void elog_output(uint8_t level, const char *tag, const char *file, const char *func, long line, const char *format, ...) { - RD_PRINTF("[%u/%s] [%s] (%s:%ld) %s\r\n", level, tag, func, file, line, format); +#ifdef BUILD_COMMON + va_list args; + RD_PRINTF("[%u/%s] [%s] (%s:%ld) ", level, tag, func, file, line); + va_start(args, format); + vprintf(format, args); + va_end(args); + RD_PRINTF("\r\n"); +#else + RD_PRINTF("[%u/%s] [%s] (%s:%ld) %s\r\n", level, tag, func, file, line, format); +#endif } /**