|
libfluidsynth
2.5.2
|
Logging interface. More...
Typedefs | |
| typedef void(* | fluid_log_function_t) (int level, const char *message, void *data) |
| Log function handler callback type used by fluid_set_log_function(). More... | |
Enumerations | |
| enum | fluid_log_level { FLUID_PANIC , FLUID_ERR , FLUID_WARN , FLUID_INFO , FLUID_DBG , LAST_LOG_LEVEL } |
| FluidSynth log levels. More... | |
Functions | |
| void | fluid_default_log_function (int level, const char *message, void *data) |
| Default log function which prints to the stderr. More... | |
| int | fluid_log (int level, const char *fmt,...) |
| Print a message to the log. More... | |
| fluid_log_function_t | fluid_set_log_function (int level, fluid_log_function_t fun, void *data) |
| Installs a new log function for a specified log level. More... | |
Logging interface.
The default logging function of the fluidsynth prints its messages to the stderr. The synthesizer uses five level of messages: FLUID_PANIC, FLUID_ERR, FLUID_WARN, FLUID_INFO, and FLUID_DBG.
A client application can install a new log function to handle the messages differently. In the following example, the application sets a callback function to display FLUID_PANIC messages in a dialog, and ignores all other messages by setting the log function to NULL:
| typedef void(* fluid_log_function_t) (int level, const char *message, void *data) |
Log function handler callback type used by fluid_set_log_function().
| level | Log level (fluid_log_level) |
| message | Log message text |
| data | User data pointer supplied to fluid_set_log_function(). |
| enum fluid_log_level |
| void fluid_default_log_function | ( | int | level, |
| const char * | message, | ||
| void * | data | ||
| ) |
Default log function which prints to the stderr.
| level | Log level |
| message | Log message |
| data | User supplied data (not used) |
| int fluid_log | ( | int | level, |
| const char * | fmt, | ||
| ... | |||
| ) |
Print a message to the log.
| level | Log level (fluid_log_level). |
| fmt | Printf style format string for log message |
| ... | Arguments for printf 'fmt' message string |
| fluid_log_function_t fluid_set_log_function | ( | int | level, |
| fluid_log_function_t | fun, | ||
| void * | data | ||
| ) |
Installs a new log function for a specified log level.
| level | Log level to install handler for. |
| fun | Callback function handler to call for logged messages |
| data | User supplied data pointer to pass to log function |