logging.h

Go to the documentation of this file.
00001 /*
00002     $Id: logging_8h-source.html,v 1.19 2006/10/27 11:16:41 rocky Exp $
00003 
00004     Copyright (C) 2000, Herbert Valerio Riedel <hvr@gnu.org>
00005     Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 */
00021 
00026 
00027 #ifndef __LOGGING_H__
00028 #define __LOGGING_H__
00029 
00030 #include <cdio/types.h>
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00039 typedef enum {
00040   CDIO_LOG_DEBUG = 1, 
00041   CDIO_LOG_INFO,      
00043   CDIO_LOG_WARN,      
00044   CDIO_LOG_ERROR,     
00045   CDIO_LOG_ASSERT     
00046 } cdio_log_level_t;
00047 
00053 extern cdio_log_level_t cdio_loglevel_default;
00054 
00066 typedef void (*cdio_log_handler_t) (cdio_log_level_t level, 
00067                                     const char message[]);
00068 
00079 cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);
00080 
00093 void cdio_log (cdio_log_level_t level, 
00094                const char format[], ...) GNUC_PRINTF(2, 3);
00095     
00101 void cdio_debug (const char format[], ...) GNUC_PRINTF(1,2);
00102 
00108 void cdio_info (const char format[], ...) GNUC_PRINTF(1,2);
00109 
00115 void cdio_warn (const char format[], ...) GNUC_PRINTF(1,2);
00116 
00122 void cdio_error (const char format[], ...) GNUC_PRINTF(1,2);
00123 
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127 
00128 #endif /* __LOGGING_H__ */
00129 
00130 
00131 /* 
00132  * Local variables:
00133  *  c-file-style: "gnu"
00134  *  tab-width: 8
00135  *  indent-tabs-mode: nil
00136  * End:
00137  */

Generated on Fri Oct 27 06:38:08 2006 for libcdio by  doxygen 1.4.6