/*
 * Log.h
 *
 *  Created on: 2020Äê12ÔÂ11ÈÕ
 *      Author: zhou_l4
 */

#ifndef APP_LOG_LOG_H_
#define APP_LOG_LOG_H_

enum LOGGER_LEVEL
{
    JPCC_LOG_LEVEL_ERROR    = 0x00      /* serious, memory allocaton failed, run time NULL pointer, etc... */
   ,JPCC_LOG_LEVEL_WARNING  = 0x01      /* warning */
   ,JPCC_LOG_LEVEL_INFO     = 0x02      /* normal debug infomation */
   ,JPCC_LOG_LEVEL_DEBUG    = 0x03      /* debug */
   ,JPCC_LOG_LEVEL_DLT    	= 0x04      /* log_dlt */
   ,JPCC_LOG_LEVEL_MAX 					/* MAX add by sunbingyue */
};
/*********************************************************************************
 *                      Defien                                                   *
**********************************************************************************/

#define JPCC_LOG_MASK_LEVEL     0x03
#define JPCC_LOG_MAX_LEVEL      JPCC_LOG_LEVEL_INFO

void LoggerPrintf(char *fmt, ... );
void Log_Init(void);

#define JPCC_DEBUG  DEBUG_LOG
#define DEBUG_LOG(LOGGER_LEVEL, MSG, ARGUS...)   do { \
													if (LOGGER_LEVEL == JPCC_LOG_LEVEL_ERROR || \
														LOGGER_LEVEL == JPCC_LOG_LEVEL_WARNING || \
														LOGGER_LEVEL == JPCC_LOG_LEVEL_DLT) \
													{ \
														if(LOGGER_LEVEL != JPCC_LOG_LEVEL_DLT) \
														{ \
															LoggerPrintf((char *)MSG, ##ARGUS); \
														} \
													} \
                                                } while(0)

#endif /* APP_LOG_LOG_H_ */
