Motion_EC_Stm32_archived/Middlewares/Log/log.c

39 lines
661 B
C
Raw Normal View History

/*
* log.c
*
* Created on: Dec 16, 2020
* Author: bookshiyi
*/
#include "log.h"
void Log(LogLevel_t loglevel,char *format,...)
{
switch(loglevel){
2021-01-05 14:46:47 +08:00
case trace:{
printf("[Trace ] ") ;
}break;
case debug:{
printf("[Debug ] ") ;
}break;
case info:{
printf("[Info ] ") ;
}break;
case warning:{
printf("[Warning] ") ;
}break;
case error:{
printf("[Error ] ") ;
}break;
2021-01-05 14:46:47 +08:00
case fatal:{
printf("[Fatal ] ") ;
}break;
}
printf("%u | ",osKernelGetTickCount());
va_list args;
va_start( args, format );
print(0, format, args );
printf("\n") ;
}