Logging
Errors can be reported by calling SDP_LOG_ERROR
, with a
printf-style format string and arguments.
This automatically adds the required fields needed to comply with the
SKA logging standard.
Include the header “ska-sdp-func/utility/sdp_logging.h” to use these functions.
-
SDP_LOG_CRITICAL(...)
Writes a log message to stderr, with severity “CRITICAL”.
-
SDP_LOG_ERROR(...)
Writes a log message to stderr, with severity “ERROR”.
-
SDP_LOG_WARNING(...)
Writes a log message to stderr, with severity “WARNING”.
-
SDP_LOG_INFO(...)
Writes a log message to stdout, with severity “INFO”.
-
SDP_LOG_DEBUG(...)
Writes a log message to stdout, with severity “DEBUG”.
Log message filtering
Log messages can be suppressed below a specified level by setting the value of the environment variable SKA_SDP_FUNC_LOG_LEVEL. The value should be a string (“DEBUG”, “INFO”, “WARNING”, “ERROR” or “CRITICAL”) to specify the minimum log message level that will be displayed in the terminal.