/*
 * log.c
 *
 *  Created on: Dec 16, 2020
 *      Author: bookshiyi
 */
#include "log.h"


void Log(LogLevel_t loglevel,char *format,...)
{
			switch(loglevel){
				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;
				case fatal:{
					printf("[Fatal  ] ") ;
				}break;
			}
			printf("%u | ",osKernelGetTickCount());
	        va_list args;
	        va_start( args, format );
			print(0, format, args );
			printf("\n") ;
}

