#include "app_log.h" #include static LOG_LEVEL nowLogLevel = LOG_LEVEL_DEBUG; bool App_Log_Initialization(LOG_LEVEL level) { return App_Log_Set_logLevel(level); } bool App_Log_Set_logLevel(LOG_LEVEL level) { if(level > LOG_LEVEL_DEBUG) return false; nowLogLevel = level; return true; } LOG_LEVEL App_Lgo_Get_logLevel(void) { return nowLogLevel; } void App_Log_Prinf(LOG_LEVEL level, const char *func, const char *format, ...) { if(nowLogLevel >= level) { va_list arg; //fprintf(stderr, "[%d][%s] ", millis(), func); fprintf(stderr, "[%d] ", millis()); va_start(arg, format); vfprintf(stderr, format, arg); va_end(arg); } }