WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
Printf
Printf 的协作图:

宏定义

#define LOS_EMG_LEVEL   0
 
#define LOS_COMMOM_LEVEL   (LOS_EMG_LEVEL + 1)
 
#define LOS_ERR_LEVEL   (LOS_COMMOM_LEVEL + 1)
 
#define LOS_WARN_LEVEL   (LOS_ERR_LEVEL + 1)
 
#define LOS_INFO_LEVEL   (LOS_WARN_LEVEL + 1)
 
#define LOS_DEBUG_LEVEL   (LOS_INFO_LEVEL + 1)
 
#define PRINT_LEVEL   LOS_ERR_LEVEL
 
#define PRINT_DEBUG(fmt, ...)
 Format and print debug log.
 
#define PRINT_INFO(fmt, ...)
 Format and print information log.
 
#define PRINT_WARN(fmt, ...)
 Format and print warning log.
 
#define PRINT_ERR(fmt, ...)
 Format and print error log.
 
#define PRINTK(fmt, ...)   dprintf(fmt, ##__VA_ARGS__)
 Format and print common log.
 
#define PRINT_EMG(fmt, ...)
 Format and print emergency log.
 
#define PRINT_RELEASE(fmt, ...)   dprintf(fmt, ##__VA_ARGS__)
 Format and print log.
 

函数

void LOS_Printf (const CHAR *fmt,...)
 Format and print data.
 

详细描述

宏定义说明

◆ LOS_COMMOM_LEVEL

#define LOS_COMMOM_LEVEL   (LOS_EMG_LEVEL + 1)

log print level definition, LOS_COMMOM_LEVEL is set to 1, it means the log is common.

◆ LOS_DEBUG_LEVEL

#define LOS_DEBUG_LEVEL   (LOS_INFO_LEVEL + 1)

log print level definition, LOS_DEBUG_LEVEL is set to 5, it means it is a debug log.

◆ LOS_EMG_LEVEL

#define LOS_EMG_LEVEL   0

log print level definition, LOS_EMG_LEVEL is set to 0, it means the log is emergency.

◆ LOS_ERR_LEVEL

#define LOS_ERR_LEVEL   (LOS_COMMOM_LEVEL + 1)

log print level definition, LOS_ERR_LEVEL is set to 2, it means it is a error log.

◆ LOS_INFO_LEVEL

#define LOS_INFO_LEVEL   (LOS_WARN_LEVEL + 1)

log print level definition, LOS_INFO_LEVEL is set to 4, it means the log is an information.

◆ LOS_WARN_LEVEL

#define LOS_WARN_LEVEL   (LOS_ERR_LEVEL + 1)

log print level definition, LOS_WARN_LEVEL is set to 3, it means it is a warning log.

◆ PRINT_DEBUG

#define PRINT_DEBUG (   fmt,
  ... 
)

Format and print debug log.

Description:
Define function macros PRINT_DEBUG. The Function can print debug log according to fmt when the PRINT_LEVEL is set to LOS_DEBUG_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINT_EMG

#define PRINT_EMG (   fmt,
  ... 
)
值:
do { \
(dprintf("[EMG] "), dprintf(fmt, ##__VA_ARGS__)); \
} while (0)

Format and print emergency log.

Description:
Define function macros PRINT_EMG. The Function can print emergency log according to fmt when the PRINT_LEVEL is greater than or equal to LOS_EMG_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINT_ERR

#define PRINT_ERR (   fmt,
  ... 
)
值:
do { \
(dprintf("[ERR] "), dprintf(fmt, ##__VA_ARGS__)); \
} while (0)

Format and print error log.

Description:
Define function macros PRINT_ERR. The Function can print error log according to fmt when the PRINT_LEVEL is greater than or equal to LOS_ERR_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINT_INFO

#define PRINT_INFO (   fmt,
  ... 
)

Format and print information log.

Description:
Define function macros PRINT_INFO. The Function can print information log according to fmt when the PRINT_LEVEL is greater than or equal to LOS_INFO_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINT_LEVEL

#define PRINT_LEVEL   LOS_ERR_LEVEL

The default log print level. PRINT_LEVEL is set to debug log level if LOSCFG_SHELL_LK is defined, otherwise PRINT_LEVEL is set to error log level. The default log print level means only print the log which its level value is lower than or equal to the PRINT_LEVEL.

◆ PRINT_RELEASE

#define PRINT_RELEASE (   fmt,
  ... 
)    dprintf(fmt, ##__VA_ARGS__)

Format and print log.

Description:
Define function macros PRINT_RELEASE. The Function can print argument(s) according to fmt. It is same with dprintf function.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINT_WARN

#define PRINT_WARN (   fmt,
  ... 
)

Format and print warning log.

Description:
Define function macros PRINT_WARN. The Function can print warning log according to fmt when the PRINT_LEVEL is greater than or equal to LOS_WARN_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

◆ PRINTK

#define PRINTK (   fmt,
  ... 
)    dprintf(fmt, ##__VA_ARGS__)

Format and print common log.

Description:
Define function macros PRINTK. The Function can print common log according to fmt when the PRINT_LEVEL is greater than or equal to LOS_COMMOM_LEVEL.
注意
None.
参数
fmt[IN] Type: const CHAR *. It controls the output format as in C printf.
args[IN] It point to the variable parameters.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
dprintf
自从
Huawei LiteOS V100R001C00

函数说明

◆ LOS_Printf()

void LOS_Printf ( const CHAR fmt,
  ... 
)
extern

Format and print data.

Description:
Print argument(s) according to fmt.
注意
None.
参数
fmt[IN] Type char*. It controls the output format as in C printf.
返回值
None.
Dependency:
  • los_printf.h: the header file that contains the API declaration.
参见
printf
自从
Huawei LiteOS V100R001C00