Browse Source

【主线待合】这里之前是因为GBA平台下不支持vprintf,现在为了方便看打印按裁剪宏区分

master
Lizongdi 1 week ago
parent
commit
08bdab84b9
  1. 10
      library/common/common.c

10
library/common/common.c

@ -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, ...)
{ {
#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); RD_PRINTF("[%u/%s] [%s] (%s:%ld) %s\r\n", level, tag, func, file, line, format);
#endif
} }
/** /**

Loading…
Cancel
Save