Motion_EC_Stm32_archived/Middlewares/Log/log.c

33 lines
547 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){
case debug:{
printf("[Debug ] ") ;
}break;
case info:{
printf("[Info ] ") ;
}break;
case warning:{
printf("[Warning] ") ;
}break;
case error:{
printf("[Error ] ") ;
}break;
}
printf("%u | ",osKernelGetTickCount());
va_list args;
va_start( args, format );
print(0, format, args );
printf("\n") ;
}