33 lines
547 B
C
33 lines
547 B
C
|
/*
|
||
|
* 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") ;
|
||
|
}
|
||
|
|