Logging
XWOS Logging
Categories:
less than a minute
Overview
XWOS provides a logging framework where users can output logs with levels:
- VERBOSE, Level 1, verbose
- DEBUG, Level 2, debug
- INFO, Level 3, informational
- NOTICE, Level 4, notice
- WARNING, Level 5, warning
- ERR, Level 6, error
- CRIT, Level 7, critical
- EMERG, Level 8, emergency
Users can control whether logs of various levels are output by configuring XWLIBCFG_XWLOG_LEVEL:
- Only logs with a level greater than or equal to
XWLIBCFG_XWLOG_LEVELwill be output. - When
XWLIBCFG_XWLOG_LEVELis configured as0, all logs are disabled.
The XWOS logging framework requires the user to provide a backend driver interface in the BSP to determine whether logs are ultimately output to a serial port, SD card, or other device:
- When
SOCCFG_LOGis configured as1, the BSP needs to provide the functionsoc_log_write(); - When
BRDCFG_LOGis configured as1, the BSP needs to provide the functionboard_log_write(); - When both
SOCCFG_LOGandBRDCFG_LOGare configured as1,SOCCFG_LOGhas higher priority;