logger

API documentation for logger.c.

Typedefs

typedef void (*log_callback_t)(const char *message)

A function pointer type for log callback functions.

This type defines a function pointer for callback functions that handle log messages. The callback function takes a single parameter, which is a constant character pointer to the log message.

Initially sets the callback function to NULL. If the callback function is NULL, then log message defaults to logging all messages prefaced by “libwoden logger: “ to stdout.

Param message:

[in] A constant character pointer to the log message.

Functions

void set_log_callback(log_callback_t callback)

Sets the callback function for logging.

This function allows you to set a custom callback function that will be used for logging messages. The callback function should match the signature defined by log_callback_t. Can be used from Python to redirect logging to a Python logger.

Parameters:

callback – The callback function to be used for logging.

void log_message(const char *message)

Logs a message to the logging system.

This function takes a string message as input and logs it to the appropriate logging system. The exact behavior of the logging if controlled by set_log_callback.

Parameters:

message – The message to be logged. It should be a null-terminated string.