API参考
载入中...
搜索中...
未找到
bsl_log.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
21
22#ifndef BSL_LOG_H
23#define BSL_LOG_H
24
25#include <stdint.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
36#define BSL_LOG_LEVEL_SEC 0U
37
43#define BSL_LOG_LEVEL_FATAL 1U
44
50#define BSL_LOG_LEVEL_ERR 2U
51
57#define BSL_LOG_LEVEL_WARN 3U
58
64#define BSL_LOG_LEVEL_INFO 4U
65
71#define BSL_LOG_LEVEL_DEBUG 5U
72
78#ifndef OPENHITLS_VERSION_S
79#define OPENHITLS_VERSION_S "openHiTLS 0.2.0 15 May 2025"
80#endif
81
82#ifndef OPENHITLS_VERSION_I
83#define OPENHITLS_VERSION_I 0x00200000ULL
84#endif
85
86#define HITLS_VERSION_LEN 150
87
98int32_t BSL_LOG_GetVersion(char *version, uint32_t *versionLen);
99
107
112#define BSL_LOG_BINLOG_TYPE_RUN 0x01
113
121typedef void (*BSL_LOG_BinLogFixLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType,
122 void *format, void *para1, void *para2, void *para3, void *para4);
123
131typedef void (*BSL_LOG_BinLogVarLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType,
132 void *format, void *para);
133
142
153
164int32_t BSL_LOG_SetBinLogLevel(uint32_t level);
165
174
175#ifdef __cplusplus
176}
177#endif
178
179#endif // BSL_LOG_H
void(* BSL_LOG_BinLogFixLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType, void *format, void *para1, void *para2, void *para3, void *para4)
Fixed-length callback type of binlogs.
定义 bsl_log.h:121
int32_t BSL_LOG_RegBinLogFunc(const BSL_LOG_BinLogFuncs *funcs)
Set the fixed-length and variable-length callback function for binlogs.
int32_t BSL_LOG_SetBinLogLevel(uint32_t level)
Set the level of binlogs.
uint64_t BSL_LOG_GetVersionNum(void)
Obtain the openHiTLS version number.
int32_t BSL_LOG_GetVersion(char *version, uint32_t *versionLen)
Obtain the openHiTLS version string.
uint32_t BSL_LOG_GetBinLogLevel(void)
Obtain the level of binlogs.
void(* BSL_LOG_BinLogVarLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType, void *format, void *para)
Callback type for variable-length binlogs.
定义 bsl_log.h:131
Register the parameter type of the binlog callback function.
定义 bsl_log.h:138
BSL_LOG_BinLogVarLenFunc varLenFunc
定义 bsl_log.h:140
BSL_LOG_BinLogFixLenFunc fixLenFunc
定义 bsl_log.h:139