Main Page   Data Structures   File List   Data Fields   Globals  

include/fluidsynth/log.h File Reference

Logging interface. More...

Go to the source code of this file.

Typedefs

typedef void(* fluid_log_function_t )(int level, 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
}
 FluidSynth log levels. More...


Functions

FLUIDSYNTH_API 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...

FLUIDSYNTH_API void fluid_default_log_function (int level, char *message, void *data)
 Default log function which prints to the stderr. More...

FLUIDSYNTH_API int fluid_log (int level, char *fmt,...)
 Print a message to the log. More...


Detailed Description

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:

DOCME (formatting) fluid_set_log_function(FLUID_PANIC, show_dialog, (void*) root_window); fluid_set_log_function(FLUID_ERR, NULL, NULL); fluid_set_log_function(FLUID_WARN, NULL, NULL); fluid_set_log_function(FLUID_DBG, NULL, NULL);

Definition in file log.h.


Typedef Documentation

typedef void(* fluid_log_function_t)(int level, char* message, void* data)
 

Log function handler callback type used by fluid_set_log_function().

Parameters:
level  Log level (fluid_log_level)
message  Log message text
data  User data pointer supplied to fluid_set_log_function().

Definition at line 69 of file log.h.


Enumeration Type Documentation

enum fluid_log_level
 

FluidSynth log levels.

Enumeration values:
FLUID_PANIC  The synth can't function correctly any more.
FLUID_ERR  Serious error occurred.
FLUID_WARN  Warning.
FLUID_INFO  Verbose informational messages.
FLUID_DBG  Debugging messages.

Definition at line 54 of file log.h.


Function Documentation

FLUIDSYNTH_API 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.

Parameters:
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
Returns:
The previously installed function.

Definition at line 73 of file fluid_sys.c.

FLUIDSYNTH_API void fluid_default_log_function int    level,
char *    message,
void *    data
 

Default log function which prints to the stderr.

Parameters:
level  Log level
message  Log message
data  User supplied data (not used)

Definition at line 92 of file fluid_sys.c.

FLUIDSYNTH_API int fluid_log int    level,
char *    fmt,
...   
 

Print a message to the log.

Parameters:
level  Log level (fluid_log_level).
fmt  Printf style format string for log message
...  Arguments for printf 'fmt' message string
Returns:
Always returns -1

Definition at line 171 of file fluid_sys.c.


Generated on Tue Aug 26 12:20:27 2008 for libfluidsynth by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001