API参考
载入中...
搜索中...
未找到
Bsl_log

log module 更多...

Bsl_log 的协作图:

struct  BSL_LOG_BinLogFuncs
 Register the parameter type of the binlog callback function. 更多...

宏定义

#define BSL_LOG_LEVEL_SEC   0U
#define BSL_LOG_LEVEL_FATAL   1U
#define BSL_LOG_LEVEL_ERR   2U
#define BSL_LOG_LEVEL_WARN   3U
#define BSL_LOG_LEVEL_INFO   4U
#define BSL_LOG_LEVEL_DEBUG   5U
#define OPENHITLS_VERSION_S   "openHiTLS 0.2.0 15 May 2025"
#define BSL_LOG_BINLOG_TYPE_RUN   0x01
 Binlog type, other types can be extended.

类型定义

typedef 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.
typedef void(* BSL_LOG_BinLogVarLenFunc) (uint32_t logId, uint32_t logLevel, uint32_t logType, void *format, void *para)
 Callback type for variable-length binlogs.

函数

int32_t BSL_LOG_GetVersion (char *version, uint32_t *versionLen)
 Obtain the openHiTLS version string.
uint64_t BSL_LOG_GetVersionNum (void)
 Obtain the openHiTLS version number.
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.
uint32_t BSL_LOG_GetBinLogLevel (void)
 Obtain the level of binlogs.

详细描述

log module

宏定义说明

◆ BSL_LOG_LEVEL_DEBUG

#define BSL_LOG_LEVEL_DEBUG   5U

Debug log level

◆ BSL_LOG_LEVEL_ERR

#define BSL_LOG_LEVEL_ERR   2U

Error log level

◆ BSL_LOG_LEVEL_FATAL

#define BSL_LOG_LEVEL_FATAL   1U

Emergency log level

◆ BSL_LOG_LEVEL_INFO

#define BSL_LOG_LEVEL_INFO   4U

Information log level

◆ BSL_LOG_LEVEL_SEC

#define BSL_LOG_LEVEL_SEC   0U

Audit log level

◆ BSL_LOG_LEVEL_WARN

#define BSL_LOG_LEVEL_WARN   3U

Warning log level

◆ OPENHITLS_VERSION_S

#define OPENHITLS_VERSION_S   "openHiTLS 0.2.0 15 May 2025"

HiTLS version string

类型定义说明

◆ BSL_LOG_BinLogFixLenFunc

typedef 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.

The function format of this type cannot contain s, the number of parameters is less than four, add 0s. More than four parameters must be called multiple times.

◆ BSL_LOG_BinLogVarLenFunc

typedef void(* BSL_LOG_BinLogVarLenFunc) (uint32_t logId, uint32_t logLevel, uint32_t logType, void *format, void *para)

Callback type for variable-length binlogs.

This type function format contains only one s, If no s exists, use BSL_LOG_BinLogFixLenFunc type. If there are more than one s, call the interface multiple times.

函数说明

◆ BSL_LOG_GetBinLogLevel()

uint32_t BSL_LOG_GetBinLogLevel ( void )

Obtain the level of binlogs.

返回值
Levelof the binlog. The value can be BSL_LOG_LEVEL_SEC, BSL_LOG_LEVEL_FATAL, BSL_LOG_LEVEL_ERR, BSL_LOG_LEVEL_WARN, BSL_LOG_LEVEL_INFO, BSL_LOG_LEVEL_DEBUG

◆ BSL_LOG_GetVersion()

int32_t BSL_LOG_GetVersion ( char * version,
uint32_t * versionLen )

Obtain the openHiTLS version string.

注意
The length of the received version string must be greater than or equal to HITLS_VERSION_LEN.
参数
version[OUT] openHiTLS current version string.
versionLen[IN/OUT] String length of the current openHiTLS version.
返回值
BSL_SUCCESS,ifsuccess.
#BSL_LOG_ERR_MEMCPY,memorycopy failure.

◆ BSL_LOG_GetVersionNum()

uint64_t BSL_LOG_GetVersionNum ( void )

Obtain the openHiTLS version number.

返回值
openHiTLSversion number.

◆ BSL_LOG_RegBinLogFunc()

int32_t BSL_LOG_RegBinLogFunc ( const BSL_LOG_BinLogFuncs * funcs)

Set the fixed-length and variable-length callback function for binlogs.

注意
The input parameter can be NULL.
参数
funcs[IN] Callback function pointer collection of the binlog. The parameter cannot be null, but the member of the structure can be null.
返回值
#BSL_SUCCESS.

◆ BSL_LOG_SetBinLogLevel()

int32_t BSL_LOG_SetBinLogLevel ( uint32_t level)

Set the level of binlogs.

注意
The level must be valid.
参数
level[IN] Level of the binlogs. The valid values are BSL_LOG_LEVEL_SEC, BSL_LOG_LEVEL_FATAL, BSL_LOG_LEVEL_ERR, BSL_LOG_LEVEL_WARN, BSL_LOG_LEVEL_INFO, BSL_LOG_LEVEL_DEBUG
返回值
#BSL_SUCCESS.
BSL_LOG_ERR_BAD_PARAM,invalidinput parameter.