1 /* FluidSynth - A Software Synthesizer
3 * Copyright (C) 2003 Peter Hanappe and others.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef _FLUIDSYNTH_LOG_H
22 #define _FLUIDSYNTH_LOG_H
32 * @brief Logging interface
34 * The default logging function of the fluidsynth prints its messages
35 * to the stderr. The synthesizer uses five level of messages: #FLUID_PANIC,
36 * #FLUID_ERR, #FLUID_WARN, #FLUID_INFO, and #FLUID_DBG.
38 * A client application can install a new log function to handle the
39 * messages differently. In the following example, the application
40 * sets a callback function to display #FLUID_PANIC messages in a dialog,
41 * and ignores all other messages by setting the log function to
45 * fluid_set_log_function(FLUID_PANIC, show_dialog, (void*) root_window);
46 * fluid_set_log_function(FLUID_ERR, NULL, NULL);
47 * fluid_set_log_function(FLUID_WARN, NULL, NULL);
48 * fluid_set_log_function(FLUID_DBG, NULL, NULL);
53 * FluidSynth log levels.
57 FLUID_PANIC
, /**< The synth can't function correctly any more */
58 FLUID_ERR
, /**< Serious error occurred */
59 FLUID_WARN
, /**< Warning */
60 FLUID_INFO
, /**< Verbose informational messages */
61 FLUID_DBG
, /**< Debugging messages */
63 LAST_LOG_LEVEL
/**< @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
68 * Log function handler callback type used by fluid_set_log_function().
69 * @param level Log level (#fluid_log_level)
70 * @param message Log message text
71 * @param data User data pointer supplied to fluid_set_log_function().
73 typedef void (*fluid_log_function_t
)(int level
, const char *message
, void *data
);
76 fluid_log_function_t
fluid_set_log_function(int level
, fluid_log_function_t fun
, void *data
);
78 FLUIDSYNTH_API
void fluid_default_log_function(int level
, const char *message
, void *data
);
80 FLUIDSYNTH_API
int fluid_log(int level
, const char *fmt
, ...);
87 #endif /* _FLUIDSYNTH_LOG_H */