Logging Interface#
Logging Interface#
Interface for log for sidewalk SDK. For more details, please see Logging Documentation
Modules#
Functions#
Printf style logging function.
The function returns current logging level.
Flush log function.
String log pushing operation - in the case of JLink RTT logs since these are deferred, they require that a special function be used in order to ensure that strings are copied correctly in order for pushing then at a later time.
Allows for retrival of log buffers from sid_pal_log implementation.
Log raw data bytes.
Macros#
Define the maximum number of bytes per single line of sid_pal_hexdump() logging.
Macro to count the number of arguments in a variadic macro.
Helper macro to count the number of arguments in a variadic macro.
Helper macro to extract the number of arguments.
Macro to define a reverse sequence of numbers from 62 to 0.
Logs a message with the highest severity level.
Logs a message if the severity level is less than or equal to the configured log level.
Dumps a block of data in hexadecimal format.
Flushes the log buffer.
Pushes a string to the log.
Logs an error message with the highest severity level.
Logs a warning message if the severity level is greater than or equal to the warning level.
Logs an informational message if the severity level is greater than or equal to the info level.
Logs a debug message if the severity level is greater than or equal to the debug level.
Logs a trace message with file name, line number, and function name.
Function Documentation#
sid_pal_log#
void sid_pal_log (sid_pal_log_severity_t severity, uint32_t num_args, const char * fmt, ... )
Printf style logging function.
Type | Direction | Argument Name | Description |
---|---|---|---|
sid_pal_log_severity_t | [in] | severity | Severity of the log |
uint32_t | [in] | num_args | Number of arguments to be logged |
const char * | [in] | fmt | Format string to print with variables |
... | N/A |
sid_log_control_get_current_log_level#
sid_pal_log_severity_t sid_log_control_get_current_log_level (void )
The function returns current logging level.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Implemented in sid_log_control
sid_pal_log_flush#
void sid_pal_log_flush (void )
Flush log function.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
The function flushes the log buffers to the output interface
sid_pal_log_push_str#
char const * sid_pal_log_push_str (char * string)
String log pushing operation - in the case of JLink RTT logs since these are deferred, they require that a special function be used in order to ensure that strings are copied correctly in order for pushing then at a later time.
Type | Direction | Argument Name | Description |
---|---|---|---|
char * | [in] | string | Pointer to the string that has to be copied. |
For platforms that do not use deferred logging, this can remain unimplemented.
sid_pal_log_get_log_buffer#
bool sid_pal_log_get_log_buffer (struct sid_pal_log_buffer *const log_buffer)
Allows for retrival of log buffers from sid_pal_log implementation.
Type | Direction | Argument Name | Description |
---|---|---|---|
struct sid_pal_log_buffer *const | [in] | log_buffer | Pointer to log buffer descriptor |
OPTIONAL If business logic wants to send logs over an external connection they can use this api to pull out logs from sid_pal_log implementation if implemented. Internally the implementation can use a circular list of buffers to store the logs as they come.
sid_pal_hexdump#
void sid_pal_hexdump (sid_pal_log_severity_t severity, const void * address, int length)
Log raw data bytes.
Type | Direction | Argument Name | Description |
---|---|---|---|
sid_pal_log_severity_t | [in] | severity | Severity of the log |
const void * | [in] | address | Pointer to data to be logged |
int | [in] | length | The length of data to be logged (in bytes) |