From c8ee635861507e1df75e9f542003e8806ef0a75d Mon Sep 17 00:00:00 2001 From: guoqi Date: Wed, 28 Jul 2021 17:18:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=87=BD=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=8A=E8=A1=8C=E5=8F=B7=E5=BE=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=EF=BC=88=E4=BE=BF=E4=BA=8Evscode=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=B7=B3=E8=BD=AC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easylogger/src/elog.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/easylogger/src/elog.c b/easylogger/src/elog.c index 7ae5de6..d566143 100755 --- a/easylogger/src/elog.c +++ b/easylogger/src/elog.c @@ -632,26 +632,27 @@ void elog_output(uint8_t level, const char *tag, const char *file, const char *f /* package file directory and name, function name and line number info */ if (get_fmt_enabled(level, ELOG_FMT_DIR | ELOG_FMT_FUNC | ELOG_FMT_LINE)) { log_len += elog_strcpy(log_len, log_buf + log_len, "("); - /* package time info */ + /* package file info */ if (get_fmt_enabled(level, ELOG_FMT_DIR)) { log_len += elog_strcpy(log_len, log_buf + log_len, file); if (get_fmt_enabled(level, ELOG_FMT_FUNC)) { - log_len += elog_strcpy(log_len, log_buf + log_len, " "); + log_len += elog_strcpy(log_len, log_buf + log_len, ":"); } else if (get_fmt_enabled(level, ELOG_FMT_LINE)) { - log_len += elog_strcpy(log_len, log_buf + log_len, ":"); + log_len += elog_strcpy(log_len, log_buf + log_len, " "); } } - /* package process info */ - if (get_fmt_enabled(level, ELOG_FMT_FUNC)) { - log_len += elog_strcpy(log_len, log_buf + log_len, func); - if (get_fmt_enabled(level, ELOG_FMT_LINE)) { - log_len += elog_strcpy(log_len, log_buf + log_len, ":"); - } - } - /* package thread info */ + /* package line info */ if (get_fmt_enabled(level, ELOG_FMT_LINE)) { snprintf(line_num, ELOG_LINE_NUM_MAX_LEN, "%ld", line); log_len += elog_strcpy(log_len, log_buf + log_len, line_num); + if (get_fmt_enabled(level, ELOG_FMT_FUNC)) { + log_len += elog_strcpy(log_len, log_buf + log_len, " "); + } + } + /* package func info */ + if (get_fmt_enabled(level, ELOG_FMT_FUNC)) { + log_len += elog_strcpy(log_len, log_buf + log_len, func); + } log_len += elog_strcpy(log_len, log_buf + log_len, ")"); }