XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_log_config_internel.h
浏览该文件的文档.
1
12#ifndef __XF_LOG_CONFIG_INTERNEL_H__
13#define __XF_LOG_CONFIG_INTERNEL_H__
14
15/* ==================== [Includes] ========================================== */
16
17#include "xf_log_config.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* ==================== [Defines] =========================================== */
24
25// 打开彩色打印,xf_log_config.h 中如果定义 XF_LOG_COLORS_ENABLE 为 0 则关闭
26#if !defined(XF_LOG_COLORS_ENABLE) || XF_LOG_COLORS_ENABLE
27#define XF_LOG_COLORS_IS_ENABLE (1)
28#else
29#define XF_LOG_COLORS_IS_ENABLE (0)
30#endif
31
32// 打开过滤器,xf_log_config.h 中如果定义 XF_LOG_FILTER_ENABLE 为 0 则关闭
33#if !defined(XF_LOG_FILTER_ENABLE) || XF_LOG_FILTER_ENABLE
34#define XF_LOG_FILTER_IS_ENABLE (1)
35#else
36#define XF_LOG_FILTER_IS_ENABLE (0)
37#endif
38
39// ctype.h头文件的支持,如果关闭则启用内部宏实现 isdigit 函数
40#if !defined(XF_LOG_CTYPE_ENABLE) || XF_LOG_CTYPE_ENABLE
41#define XF_LOG_CTYPE_IS_ENABLE (1)
42#else
43#define XF_LOG_CTYPE_IS_ENABLE (0)
44#endif
45
46// stddef.h头文件的支持,如果关闭则启用内部实现 size_t 类型
47#if !defined(XF_LOG_STDDEF_ENABLE) || XF_LOG_STDDEF_ENABLE
48#define XF_LOG_STDDEF_IS_ENABLE (1)
49#else
50#define XF_LOG_STDDEF_IS_ENABLE (0)
51#endif
52
53// stdint.h头文件的支持,如果关闭则启用内部实现 uint32_t uint8_t 类型
54#if !defined(XF_LOG_STDINT_ENABLE) || XF_LOG_STDINT_ENABLE
55#define XF_LOG_STDINT_IS_ENABLE (1)
56#else
57#define XF_LOG_STDINT_IS_ENABLE (0)
58#endif
59
60// string.h头文件的支持,如果关闭则需要手动实现 xf_log_strlen(s) 函数
61#if !defined(XF_LOG_STRLEN_ENABLE) || XF_LOG_STRLEN_ENABLE
62#define XF_LOG_STRLEN_IS_ENABLE (1)
63#else
64#define XF_LOG_STRLEN_IS_ENABLE (0)
65#endif
66
67#if !XF_LOG_STRLEN_IS_ENABLE && !defined(xf_log_strlen)
68#error "xf_log_strlen(s) must be defined when XF_LOG_STRLEN_IS_ENABLE is 0"
69#endif
70
71// stdio.h头文件的支持,如果关闭则需要手动实现 xf_log_vsprintf(buffer, maxlen, fmt, args) 函数
72#if !defined(XF_LOG_VSNPRINTF_ENABLE) || XF_LOG_VSNPRINTF_ENABLE
73#define XF_LOG_VSNPRINTF_IS_ENABLE (1)
74#else
75#define XF_LOG_VSNPRINTF_IS_ENABLE (0)
76#endif
77
78#if !XF_LOG_VSNPRINTF_IS_ENABLE && !defined(xf_log_vsprintf)
79#error "xf_log_vsprintf(buffer, maxlen, fmt, args) must be defined when XF_LOG_VSNPRINTF_IS_ENABLE is 0"
80#endif
81
82// 后端对接的输出对象数目,默认为一个对象
83#ifndef XF_LOG_OBJ_NUM
84#define XF_LOG_OBJ_NUM (1)
85#endif
86
87// xf_log_level结束的换行符
88#ifndef XF_LOG_NEWLINE
89#define XF_LOG_NEWLINE "\n"
90#endif
91
92// 格式化标志长度
93#ifndef XF_FORMAT_FLAG_SIZE
94#define XF_FORMAT_FLAG_SIZE 8
95#endif
96
97// 格式化结果缓冲区
98#ifndef XF_FORMAT_BUFFER_SIZE
99#define XF_FORMAT_BUFFER_SIZE 32
100#endif
101
102/* ==================== [Typedefs] ========================================== */
103
104/* ==================== [Global Prototypes] ================================= */
105
106/* ==================== [Macros] ============================================ */
107
108#ifdef __cplusplus
109} /* extern "C" */
110#endif
111
112#endif // __XF_LOG_CONFIG_INTERNEL_H__