From ad264f0df6c768937411711e628bf80c2059fea5 Mon Sep 17 00:00:00 2001 From: Riggin Date: Wed, 28 Jun 2023 17:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20elog=5Fraw()=20=E7=9A=84?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=97=A0=E6=B3=95=E7=94=B1=20ELOG=5FOUTPUT?= =?UTF-8?q?=5FENABLE=E6=80=BB=E5=BC=80=E5=85=B3=20=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easylogger/inc/elog.h | 4 +++- easylogger/src/elog.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/easylogger/inc/elog.h b/easylogger/inc/elog.h index 719f4fb..978dbc4 100755 --- a/easylogger/inc/elog.h +++ b/easylogger/inc/elog.h @@ -73,6 +73,7 @@ extern "C" { #endif #ifndef ELOG_OUTPUT_ENABLE + #define elog_raw(...) #define elog_assert(tag, ...) #define elog_error(tag, ...) #define elog_warn(tag, ...) @@ -80,6 +81,7 @@ extern "C" { #define elog_debug(tag, ...) #define elog_verbose(tag, ...) #else /* ELOG_OUTPUT_ENABLE */ + #define elog_raw(...) elog_raw_output(__VA_ARGS__) #if ELOG_OUTPUT_LVL >= ELOG_LVL_ASSERT #define elog_assert(tag, ...) \ elog_output(ELOG_LVL_ASSERT, tag, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__) @@ -191,7 +193,7 @@ void elog_set_filter_tag(const char *tag); void elog_set_filter_kw(const char *keyword); void elog_set_filter_tag_lvl(const char *tag, uint8_t level); uint8_t elog_get_filter_tag_lvl(const char *tag); -void elog_raw(const char *format, ...); +void elog_raw_output(const char *format, ...); void elog_output(uint8_t level, const char *tag, const char *file, const char *func, const long line, const char *format, ...); void elog_output_lock_enabled(bool enabled); diff --git a/easylogger/src/elog.c b/easylogger/src/elog.c index 1bc3b88..421a110 100755 --- a/easylogger/src/elog.c +++ b/easylogger/src/elog.c @@ -503,7 +503,7 @@ uint8_t elog_get_filter_tag_lvl(const char *tag) * @param format output format * @param ... args */ -void elog_raw(const char *format, ...) { +void elog_raw_output(const char *format, ...) { va_list args; size_t log_len = 0; int fmt_result; @@ -915,7 +915,7 @@ void elog_hexdump(const char *name, uint8_t width, const void *buf, uint16_t siz elog_async_output(ELOG_LVL_DEBUG, log_buf, log_len); #elif defined(ELOG_BUF_OUTPUT_ENABLE) extern void elog_buf_output(const char *log, size_t size); - elog_buf_output(log_buf, log_len); + elog_buf_output(log_buf, log_len); #else elog_port_output(log_buf, log_len); #endif