2020-12-17 18:22:19 +08:00
|
|
|
/*
|
|
|
|
* 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;
|
2020-12-17 18:22:19 +08:00
|
|
|
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;
|
2020-12-17 18:22:19 +08:00
|
|
|
}
|
|
|
|
printf("%u | ",osKernelGetTickCount());
|
|
|
|
va_list args;
|
|
|
|
va_start( args, format );
|
|
|
|
print(0, format, args );
|
|
|
|
printf("\n") ;
|
|
|
|
}
|
|
|
|
|