From 53d486f9e041b996ad5ef6432913795730f276bc Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Wed, 16 Sep 2026 10:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=91=E6=97=A5=E5=BF=97=E5=86=99=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/log/elog_port.c | 10 ---------- library/log/include/elog_file.h | 2 -- library/log/include/elog_file_cfg.h | 2 +- library/log/log.c | 8 -------- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/library/log/elog_port.c b/library/log/elog_port.c index 33f76c5..65f0308 100644 --- a/library/log/elog_port.c +++ b/library/log/elog_port.c @@ -35,9 +35,7 @@ #include "rd_time.h" #include "rd_thread.h" -#ifndef DEBUG #include "elog_file.h" -#endif static pthread_mutex_t output_lock; @@ -49,9 +47,7 @@ static pthread_mutex_t output_lock; WEAK ElogErrCode elog_port_init(void) { ElogErrCode result = ELOG_NO_ERR; Rd_MutexInit(&output_lock); -#ifndef DEBUG elog_file_init(); -#endif return result; } @@ -60,9 +56,7 @@ WEAK ElogErrCode elog_port_init(void) { * */ WEAK void elog_port_deinit(void) { -#ifndef DEBUG elog_file_deinit(); -#endif Rd_MutexDestroy(&output_lock); } @@ -73,11 +67,7 @@ WEAK void elog_port_deinit(void) { * @param size log size */ WEAK void elog_port_output(const char *log, size_t size) { -#ifdef DEBUG - RD_PRINTF("%.*s", (int)size, log); -#else elog_file_write(log, size); -#endif } /** diff --git a/library/log/include/elog_file.h b/library/log/include/elog_file.h index 2ec2466..1236bfc 100644 --- a/library/log/include/elog_file.h +++ b/library/log/include/elog_file.h @@ -38,9 +38,7 @@ extern "C" { #endif -#ifndef DEBUG #define ELOG_FILE_ENABLE -#endif /* EasyLogger file log plugin's software version number */ #define ELOG_FILE_SW_VERSION "V1.0.0" diff --git a/library/log/include/elog_file_cfg.h b/library/log/include/elog_file_cfg.h index c545bd5..07c3192 100644 --- a/library/log/include/elog_file_cfg.h +++ b/library/log/include/elog_file_cfg.h @@ -31,7 +31,7 @@ #define _ELOG_FILE_CFG_H_ /* EasyLogger file log plugin's using file name */ -#define ELOG_FILE_NAME "rd.log" +#define ELOG_FILE_NAME "C:rd.log" /* EasyLogger file log plugin's using file max size */ #define ELOG_FILE_MAX_SIZE (1 * 1024 * 1024) diff --git a/library/log/log.c b/library/log/log.c index 0ac22e5..5445bfa 100644 --- a/library/log/log.c +++ b/library/log/log.c @@ -1,18 +1,10 @@ #include #include "elog.h" -void Rd_ElogEnableStrong(void) -{ - // 用于强符号覆盖的锚点 -} - -__attribute__((constructor(101))) void Rd_ElogInit(void) { -#ifndef DEBUG /* close printf buffer */ //setbuf(stdout, NULL); -#endif /* initialize EasyLogger */ elog_init(); /* set EasyLogger log format */