aubio
0.4.9
|
Logging features. More...
Go to the source code of this file.
Typedefs | |
typedef void(* | aubio_log_function_t) (sint_t level, const char_t *message, void *data) |
Logging function prototype, to be passed to aubio_log_set_function. More... | |
Enumerations | |
enum | aubio_log_level { AUBIO_LOG_ERR, AUBIO_LOG_INF, AUBIO_LOG_MSG, AUBIO_LOG_DBG, AUBIO_LOG_WRN, AUBIO_LOG_LAST_LEVEL } |
list of logging levels More... | |
Functions | |
void | aubio_log_set_function (aubio_log_function_t fun, void *data) |
Set logging function for all levels. More... | |
aubio_log_function_t | aubio_log_set_level_function (sint_t level, aubio_log_function_t fun, void *data) |
Set logging function for a given level. More... | |
void | aubio_log_reset (void) |
Reset all logging functions to the default one. More... | |
Logging features.
This file specifies aubio_log_set_function and aubio_log_set_level_function, which let you define one or several custom logging functions to redirect warnings and errors from aubio to your application. The custom function should have the prototype defined in aubio_log_function_t.
After a call to aubio_log_set_level_function, aubio_log_reset can be used to reset each logging functions to the default ones.
Definition in file log.h.
Logging function prototype, to be passed to aubio_log_set_function.
level | log level |
message | text to log |
data | optional closure used by the callback |
See utils/test-log.c for an example of logging function.
enum aubio_log_level |
void aubio_log_reset | ( | void | ) |
Reset all logging functions to the default one.
After calling this function, the default logging function will be used to print error, warning, normal, and debug messages to stdout
or stderr
.
void aubio_log_set_function | ( | aubio_log_function_t | fun, |
void * | data | ||
) |
Set logging function for all levels.
fun | the function to be used to log, of type aubio_log_function_t |
data | optional closure to be passed to the function (can be NULL if nothing to pass) |
aubio_log_function_t aubio_log_set_level_function | ( | sint_t | level, |
aubio_log_function_t | fun, | ||
void * | data | ||
) |
Set logging function for a given level.
level | the level for which to set the logging function |
fun | the function to be used to log, of type aubio_log_function_t |
data | optional closure to be passed to the function (can be NULL if nothing to pass) |