Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers

The logging functionality that allows for logging messages at different log levels. More...

Collaboration diagram for Logging:

Macros

#define CA821X_API_INCLUDE_CA821X_LOG_H_
 

Typedefs

typedef enum ca_loglevel ca_loglevel
 Cascoda loglevel type. More...
 

Enumerations

enum  ca_loglevel {
  CA_LOGLEVEL_CRIT = 1 , CA_LOGLEVEL_WARN = 2 , CA_LOGLEVEL_NOTE = 3 , CA_LOGLEVEL_INFO = 4 ,
  CA_LOGLEVEL_DEBG = 5
}
 Cascoda loglevel type. More...
 

Functions

void ca_log (ca_loglevel loglevel, const char *format, va_list argp)
 Function to process logs depending on platform. More...
 
STATIC void ca_log_crit (const char *format,...)
 Print a log message with log level CRIT (Will always be displayed) More...
 
STATIC void ca_log_warn (const char *format,...)
 Print a log message with log level WARN (Will be displayed if log level is equal or higher, see ca_loglevel) More...
 
STATIC void ca_log_note (const char *format,...)
 Print a log message with log level NOTE (Will be displayed if log level is equal or higher, see ca_loglevel) More...
 
STATIC void ca_log_info (const char *format,...)
 Print a log message with log level INFO (Will be displayed if log level is equal or higher, see ca_loglevel) More...
 
STATIC void ca_log_debg (const char *format,...)
 Print a log message with log level DEBG (Will be displayed if log level is equal or higher, see ca_loglevel) More...
 

Detailed Description

The logging functionality that allows for logging messages at different log levels.

They can also be disabled using CMake cache variable CASCODA_LOG_LEVEL.

Macro Definition Documentation

◆ CA821X_API_INCLUDE_CA821X_LOG_H_

#define CA821X_API_INCLUDE_CA821X_LOG_H_

Typedef Documentation

◆ ca_loglevel

typedef enum ca_loglevel ca_loglevel

Cascoda loglevel type.

Enumeration Type Documentation

◆ ca_loglevel

Cascoda loglevel type.

Enumerator
CA_LOGLEVEL_CRIT 

Critical warnings that should always be displayed.

CA_LOGLEVEL_WARN 

Warnings that something has gone wrong.

CA_LOGLEVEL_NOTE 

Low-frequency notes that may be of interest.

CA_LOGLEVEL_INFO 

Semi-Regular information that may be more frequent.

CA_LOGLEVEL_DEBG 

High Frequency debug logs, data dumps, or unimportant information.

Function Documentation

◆ ca_log()

void ca_log ( ca_loglevel  loglevel,
const char *  format,
va_list  argp 
)

Function to process logs depending on platform.

This function should not be used by applications, and the ca_log_crit, ca_log_warn etc functions should be used instead.

Parameters
loglevelThe ca_loglevel log level.
formatA pointer to the format string.
argpArguments for the format specification.

◆ ca_log_crit()

STATIC void ca_log_crit ( const char *  format,
  ... 
)
inline

Print a log message with log level CRIT (Will always be displayed)

Parameters
formatprintf-style format string, followed by printf-style arguments

◆ ca_log_debg()

STATIC void ca_log_debg ( const char *  format,
  ... 
)
inline

Print a log message with log level DEBG (Will be displayed if log level is equal or higher, see ca_loglevel)

Parameters
formatprintf-style format string, followed by printf-style arguments

◆ ca_log_info()

STATIC void ca_log_info ( const char *  format,
  ... 
)
inline

Print a log message with log level INFO (Will be displayed if log level is equal or higher, see ca_loglevel)

Parameters
formatprintf-style format string, followed by printf-style arguments

◆ ca_log_note()

STATIC void ca_log_note ( const char *  format,
  ... 
)
inline

Print a log message with log level NOTE (Will be displayed if log level is equal or higher, see ca_loglevel)

Parameters
formatprintf-style format string, followed by printf-style arguments

◆ ca_log_warn()

STATIC void ca_log_warn ( const char *  format,
  ... 
)
inline

Print a log message with log level WARN (Will be displayed if log level is equal or higher, see ca_loglevel)

Parameters
formatprintf-style format string, followed by printf-style arguments