|
|
@ -2,10 +2,20 @@ |
|
|
#include <stdarg.h> |
|
|
#include <stdarg.h> |
|
|
#include <sys/stat.h> |
|
|
#include <sys/stat.h> |
|
|
#include "common.h" |
|
|
#include "common.h" |
|
|
|
|
|
#include <stdarg.h> // 必须包含此头文件以使用变参宏 |
|
|
|
|
|
|
|
|
WEAK void elog_output(uint8_t level, const char *tag, const char *file, const char *func, long line, const char *format, ...) |
|
|
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 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
|