openHiTLS API openHiTLS 0.1.0-Alpha1
bsl_log.h
浏览该文件的文档.
1/*---------------------------------------------------------------------------------------------
2 * This file is part of the openHiTLS project.
3 * Copyright © 2023 Huawei Technologies Co.,Ltd. All rights reserved.
4 * Licensed under the openHiTLS Software license agreement 1.0. See LICENSE in the project root
5 * for license information.
6 *---------------------------------------------------------------------------------------------
7 */
8
15#ifndef BSL_LOG_H
16#define BSL_LOG_H
17
18#include <stdint.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
29#define BSL_LOG_LEVEL_SEC 0U
30
36#define BSL_LOG_LEVEL_FATAL 1U
37
43#define BSL_LOG_LEVEL_ERR 2U
44
50#define BSL_LOG_LEVEL_WARN 3U
51
57#define BSL_LOG_LEVEL_INFO 4U
58
64#define BSL_LOG_LEVEL_DEBUG 5U
65
71#ifndef OPENHITLS_VERSION_S
72#define OPENHITLS_VERSION_S "openHiTLS 0.1.0 25 12 2023"
73#endif
74
75#ifndef OPENHITLS_VERSION_I
76#define OPENHITLS_VERSION_I 0x00001000U
77#endif
78
79#define HITLS_VERSION_LEN 150
80
91int32_t BSL_LOG_GetVersion(char *version, uint32_t *versionLen);
92
99uint32_t BSL_LOG_GetVersionNum(void);
100
105#define BSL_LOG_BINLOG_TYPE_RUN 0x01
106
114typedef void (*BSL_LOG_BinLogFixLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType,
115 void *format, void *para1, void *para2, void *para3, void *para4);
116
124typedef void (*BSL_LOG_BinLogVarLenFunc)(uint32_t logId, uint32_t logLevel, uint32_t logType,
125 void *format, void *para);
126
131typedef struct {
135
146
157int32_t BSL_LOG_SetBinLogLevel(uint32_t level);
158
167
168#ifdef __cplusplus
169}
170#endif
171
172#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.
Definition bsl_log.h:114
int32_t BSL_LOG_RegBinLogFunc(const BSL_LOG_BinLogFuncs *funcs)
Set the fixed-length and variable-length callback function for binlogs.
uint32_t BSL_LOG_GetVersionNum(void)
Obtain the openHiTLS version number.
int32_t BSL_LOG_SetBinLogLevel(uint32_t level)
Set the level of binlogs.
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.
Definition bsl_log.h:124
BSL_LOG_BinLogFixLenFunc fixLenFunc
Definition bsl_log.h:132
BSL_LOG_BinLogVarLenFunc varLenFunc
Definition bsl_log.h:133
Register the parameter type of the binlog callback function.
Definition bsl_log.h:131