This commit is contained in:
zogodo
2019-12-10 21:26:45 +08:00
parent f348760ac4
commit 7af1aebf12
4 changed files with 34 additions and 12 deletions

View File

@@ -7,12 +7,16 @@ typedef struct
char* logs[LOG_NUM];
} LogRecord;
extern LogRecord log_record;
extern char* LOG_TMP;
void SetLogRecord(LogRecord* lr, char* log);
char* GetLogRecord(int idx);
#define os_log(format, ...) \
char* log = (char*)malloc(sizeof(char)*LOG_LEN); \
snprintf(log, LOG_LEN, format, ##__VA_ARGS__); \
SetLogRecord(log_record, log); \
custom_log("WIFI", format, ##__VA_ARGS__) \
#define os_log(format, ...) \
LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \
snprintf(LOG_TMP, LOG_LEN, format, ##__VA_ARGS__); \
SetLogRecord(&log_record, LOG_TMP); \
custom_log("WIFI", format, ##__VA_ARGS__) \