|
Udipe 1.0
Solving the riddle of high-throughput UDP
|
#include <log.h>
Data Fields | |
| udipe_log_callback_t | callback |
| void * | context |
| udipe_log_level_t | min_level |
Logging configuration
This data structure controls libudipe's logging behavior. Like other configuration data structures, it is designed such that zero-initializing it should result in sane defaults for many applications.
| udipe_log_callback_t udipe_log_config_s::callback |
User logging callback
This is where you can plug udipe logs into your pre-existing logging infrastructure like syslog etc. If this is left unconfigured (NULL), udipe will print log messages on stderr.
If this pointer is not NULL, then you must ensure that it is valid to call the associated callback at any time, including from multiple threads, until the udipe_context_t is destroyed by udipe_finalize(). And for this entire duration, the associated context , if any, must be valid to use too.
| void* udipe_log_config_s::context |
User logging callback context
This pointer is not used by the udipe implementation, but merely passed down as the first argument to each call to your callback .
You can use it to implement more sophisticated logging that requires some kind of external state. For example, if your log callback is a Rust or C++ lambda, this is where is where its self/this pointer should go.
If you do not specify a callback or if your callback does not need any supplementary state, then you should leave this at NULL.
| udipe_log_level_t udipe_log_config_s::min_level |
Minimal log level/priority to be reported
See UDIPE_DEFAULT_LOG_LEVEL for more information about what happens when you leave this configuration at its default value.