JZsdk_Logger.h
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
********************************************************************
* @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 USER_LOG_DEBUG(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_LOG_INFO(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_LOG_WARN(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_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******/