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, ")"); }