Logging

XWOS Logging

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_LEVEL will be output.
  • When XWLIBCFG_XWLOG_LEVEL is configured as 0, 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_LOG is configured as 1, the BSP needs to provide the function soc_log_write();
  • When BRDCFG_LOG is configured as 1, the BSP needs to provide the function board_log_write();
  • When both SOCCFG_LOG and BRDCFG_LOG are configured as 1, SOCCFG_LOG has higher priority;

API Reference