<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libfluidsynth: log.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <script type="text/javascript"> function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function toggleVisibility(linkObj) { var base = linkObj.getAttribute('id'); var summary = document.getElementById(base + '-summary'); var content = document.getElementById(base + '-content'); var trigger = document.getElementById(base + '-trigger'); if ( hasClass(linkObj,'closed') ) { summary.style.display = 'none'; content.style.display = 'block'; trigger.src = 'open.png'; removeClass(linkObj,'closed'); addClass(linkObj,'opened'); } else if ( hasClass(linkObj,'opened') ) { summary.style.display = 'block'; content.style.display = 'none'; trigger.src = 'closed.png'; removeClass(linkObj,'opened'); addClass(linkObj,'closed'); } return false; } </script> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#typedef-members">Typedefs</a> | <a href="#enum-members">Enumerations</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <h1>log.h File Reference</h1> </div> </div> <div class="contents"> <p>Logging interface. <a href="#_details">More...</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a> )(int level, char *message, void *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Log function handler callback type used by <a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function()</a>. <a href="#a94e275985c3b3a179967d8c7fb2f23cb"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="enum-members"></a> Enumerations</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9e">fluid_log_level</a> { <br/> <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a">FLUID_PANIC</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25">FLUID_ERR</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f">FLUID_WARN</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eadfa902517702f2dd8ae849b810175ac4">FLUID_INFO</a>, <br/> <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc">FLUID_DBG</a> <br/> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><p>FluidSynth log levels. </p> <a href="log_8h.html#aa341232c15addd9c336131984840ed9e">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">FLUIDSYNTH_API <a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224">fluid_set_log_function</a> (int level, <a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a> fun, void *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Installs a new log function for a specified log level. <a href="#a73045ac6812fb708625d1ea25e4e5224"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">FLUIDSYNTH_API void </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8h.html#af9512c62588841dc6f797abc202c2541">fluid_default_log_function</a> (int level, char *message, void *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default log function which prints to the stderr. <a href="#af9512c62588841dc6f797abc202c2541"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">FLUIDSYNTH_API int </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8h.html#a4433d077ea131c3e4b542537d65ffd72">fluid_log</a> (int level, const char *fmt,...)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Print a message to the log. <a href="#a4433d077ea131c3e4b542537d65ffd72"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Logging interface. </p> <p>The default logging function of the fluidsynth prints its messages to the stderr. The synthesizer uses five level of messages: <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a" title="The synth can't function correctly any more.">FLUID_PANIC</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25" title="Serious error occurred.">FLUID_ERR</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f" title="Warning.">FLUID_WARN</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eadfa902517702f2dd8ae849b810175ac4" title="Verbose informational messages.">FLUID_INFO</a>, and <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc" title="Debugging messages.">FLUID_DBG</a>.</p> <p>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 <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a" title="The synth can't function correctly any more.">FLUID_PANIC</a> messages in a dialog, and ignores all other messages by setting the log function to NULL:</p> <div class="fragment"><pre class="fragment"> <a class="code" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function</a>(<a class="code" href="log_8h.html#aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a" title="The synth can&#39;t function correctly any more.">FLUID_PANIC</a>, show_dialog, (<span class="keywordtype">void</span>*) root_window); <a class="code" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function</a>(<a class="code" href="log_8h.html#aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25" title="Serious error occurred.">FLUID_ERR</a>, NULL, NULL); <a class="code" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function</a>(<a class="code" href="log_8h.html#aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f" title="Warning.">FLUID_WARN</a>, NULL, NULL); <a class="code" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function</a>(<a class="code" href="log_8h.html#aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc" title="Debugging messages.">FLUID_DBG</a>, NULL, NULL); </pre></div> <hr/><h2>Typedef Documentation</h2> <a class="anchor" id="a94e275985c3b3a179967d8c7fb2f23cb"></a><!-- doxytag: member="log.h::fluid_log_function_t" ref="a94e275985c3b3a179967d8c7fb2f23cb" args=")(int level, char *message, void *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef void(* <a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a>)(int level, char *message, void *data)</td> </tr> </table> </div> <div class="memdoc"> <p>Log function handler callback type used by <a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function()</a>. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Log level (<a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9e" title="FluidSynth log levels.">fluid_log_level</a>) </td></tr> <tr><td valign="top"></td><td valign="top"><em>message</em> </td><td>Log message text </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>User data pointer supplied to <a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224" title="Installs a new log function for a specified log level.">fluid_set_log_function()</a>. </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Enumeration Type Documentation</h2> <a class="anchor" id="aa341232c15addd9c336131984840ed9e"></a><!-- doxytag: member="log.h::fluid_log_level" ref="aa341232c15addd9c336131984840ed9e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9e">fluid_log_level</a></td> </tr> </table> </div> <div class="memdoc"> <p>FluidSynth log levels. </p> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a"></a><!-- doxytag: member="FLUID_PANIC" ref="aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a" args="" -->FLUID_PANIC</em> </td><td> <p>The synth can't function correctly any more. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25"></a><!-- doxytag: member="FLUID_ERR" ref="aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25" args="" -->FLUID_ERR</em> </td><td> <p>Serious error occurred. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f"></a><!-- doxytag: member="FLUID_WARN" ref="aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f" args="" -->FLUID_WARN</em> </td><td> <p>Warning. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="aa341232c15addd9c336131984840ed9eadfa902517702f2dd8ae849b810175ac4"></a><!-- doxytag: member="FLUID_INFO" ref="aa341232c15addd9c336131984840ed9eadfa902517702f2dd8ae849b810175ac4" args="" -->FLUID_INFO</em> </td><td> <p>Verbose informational messages. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc"></a><!-- doxytag: member="FLUID_DBG" ref="aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc" args="" -->FLUID_DBG</em> </td><td> <p>Debugging messages. </p> </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Function Documentation</h2> <a class="anchor" id="a73045ac6812fb708625d1ea25e4e5224"></a><!-- doxytag: member="log.h::fluid_set_log_function" ref="a73045ac6812fb708625d1ea25e4e5224" args="(int level, fluid_log_function_t fun, void *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">FLUIDSYNTH_API <a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a> fluid_set_log_function </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>level</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="log_8h.html#a94e275985c3b3a179967d8c7fb2f23cb">fluid_log_function_t</a> </td> <td class="paramname"> <em>fun</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Installs a new log function for a specified log level. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Log level to install handler for. </td></tr> <tr><td valign="top"></td><td valign="top"><em>fun</em> </td><td>Callback function handler to call for logged messages </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>User supplied data pointer to pass to log function </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The previously installed function. </dd></dl> <p>References <a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224">fluid_set_log_function()</a>.</p> <p>Referenced by <a class="el" href="log_8h.html#a73045ac6812fb708625d1ea25e4e5224">fluid_set_log_function()</a>.</p> </div> </div> <a class="anchor" id="af9512c62588841dc6f797abc202c2541"></a><!-- doxytag: member="log.h::fluid_default_log_function" ref="af9512c62588841dc6f797abc202c2541" args="(int level, char *message, void *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">FLUIDSYNTH_API void fluid_default_log_function </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>level</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>message</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Default log function which prints to the stderr. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Log level </td></tr> <tr><td valign="top"></td><td valign="top"><em>message</em> </td><td>Log message </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>User supplied data (not used) </td></tr> </table> </dd> </dl> <p>References <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea5542b67c606598020b832c31729175fc">FLUID_DBG</a>, <a class="el" href="log_8h.html#af9512c62588841dc6f797abc202c2541">fluid_default_log_function()</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eabc0ff48d192b3b0fc721946ccf095d25">FLUID_ERR</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9eadfa902517702f2dd8ae849b810175ac4">FLUID_INFO</a>, <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea62d9ddd89d0a853606ce38d195daa99a">FLUID_PANIC</a>, and <a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9ea394460be1ec74fce15e1ff683606df0f">FLUID_WARN</a>.</p> <p>Referenced by <a class="el" href="log_8h.html#af9512c62588841dc6f797abc202c2541">fluid_default_log_function()</a>.</p> </div> </div> <a class="anchor" id="a4433d077ea131c3e4b542537d65ffd72"></a><!-- doxytag: member="log.h::fluid_log" ref="a4433d077ea131c3e4b542537d65ffd72" args="(int level, const char *fmt,...)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">FLUIDSYNTH_API int fluid_log </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>level</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>fmt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"> </td> <td class="paramname"> <em>...</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Print a message to the log. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Log level (<a class="el" href="log_8h.html#aa341232c15addd9c336131984840ed9e" title="FluidSynth log levels.">fluid_log_level</a>). </td></tr> <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>Printf style format string for log message </td></tr> <tr><td valign="top"></td><td valign="top"><em>...</em> </td><td>Arguments for printf 'fmt' message string </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Always returns <a class="el" href="misc_8h.html#a90e8bdbc5a507bbfa5c45bac85a63a61" title="Value that indicates failure, used by most libfluidsynth functions.">FLUID_FAILED</a> </dd></dl> <p>References <a class="el" href="log_8h.html#a4433d077ea131c3e4b542537d65ffd72">fluid_log()</a>.</p> <p>Referenced by <a class="el" href="log_8h.html#a4433d077ea131c3e4b542537d65ffd72">fluid_log()</a>, <a class="el" href="seq_8h.html#a749882ab2b9ce51fa6a265db2cd59915">fluid_sequencer_register_client()</a>, <a class="el" href="seqbind_8h.html#a3680e34efa6745fcbe851fcd802cba39">fluid_sequencer_register_fluidsynth()</a>, <a class="el" href="seq_8h.html#aa62f856223ff035fcfca2517facc3205">fluid_sequencer_set_time_scale()</a>, <a class="el" href="event_8h.html#a1d535480f26630b755102415a6d246cb">new_fluid_event()</a>, and <a class="el" href="seq_8h.html#a3c27499606024a92bca0b32dbcf72c44">new_fluid_sequencer2()</a>.</p> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Oct 12 2010 for libfluidsynth by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>