JZsdk_Logger.h 3.4 KB
/**
 ********************************************************************
 * @file   JZsdk_Logger.h
 *          用于给h150s logger显示文件
 *
 *********************************************************************
 */

/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
#ifndef JZSDK_LOGGER_H
#define JZSDK_LOGGER_H

/* Includes ------------------------------------------------------------------*/
#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Exported constants --------------------------------------------------------*/
/* 常亮定义*/


typedef enum {
    JZSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR = 0, /*!< Logger console error level. The method and level of the console are
                                                  associated with each other. If the level of the registered console
                                                  method is lower than this level, the level interface will not be
                                                  printed successfully. */
    JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN = 1, /*!< Logger console warning level.The method and level of the console are
                                                    associated with each other. If the level of the registered console
                                                    method is lower than this level, the level interface will not be
                                                    printed successfully. */
    JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO = 2, /*!< Logger console info level. The method and level of the console are
                                                 associated with each other. If the level of the registered console
                                                 method is lower than this level, the level interface will not be
                                                 printed successfully. */
    JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG = 3, /*!< Logger console debug level. The method and level of the console are
                                                  associated with each other. If the level of the registered console
                                                  method is lower than this level, the level interface will not be
                                                  printed successfully. */
} E_JZsdkConsoleLogLevel;
/* Exported types ------------------------------------------------------------*/


/* Exported functions --------------------------------------------------------*/
void JZsdk_UserLogOutput(E_JZsdkConsoleLogLevel level, const char *fmt, ...);
T_JZsdkReturnCode JZsdk_LoggerInit();

/* Exported constants --------------------------------------------------------*/
#define JZSDK_LOG_DEBUG(fmt, ...)    \
        JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define JZSDK_LOG_INFO(fmt, ...)     \
        JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define JZSDK_LOG_WARN(fmt, ...)     \
        JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define JZSDK_LOG_ERROR(fmt, ...)    \
        JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)


#ifdef __cplusplus
}
#endif

#endif 
/************************ (C) COPYRIGHT JZSDK Innovations *******END OF FILE******/