libcdio  0.90
logging.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2003, 2004, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
00003     Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00023 
00024 #ifndef CDIO_LOGGING_H_
00025 #define CDIO_LOGGING_H_
00026 
00027 #include <cdio/types.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00036 typedef enum {
00037   CDIO_LOG_DEBUG = 1, 
00038   CDIO_LOG_INFO,      
00040   CDIO_LOG_WARN,      
00041   CDIO_LOG_ERROR,     
00042   CDIO_LOG_ASSERT     
00043 } cdio_log_level_t;
00044 
00050 extern cdio_log_level_t cdio_loglevel_default;
00051 
00063 typedef void (*cdio_log_handler_t) (cdio_log_level_t level, 
00064                                     const char message[]);
00065 
00076 cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);
00077 
00090 void cdio_log (cdio_log_level_t level, 
00091                const char format[], ...) GNUC_PRINTF(2, 3);
00092     
00098 void cdio_debug (const char format[], ...) GNUC_PRINTF(1,2);
00099 
00105 void cdio_info (const char format[], ...) GNUC_PRINTF(1,2);
00106 
00112 void cdio_warn (const char format[], ...) GNUC_PRINTF(1,2);
00113 
00119 void cdio_error (const char format[], ...) GNUC_PRINTF(1,2);
00120 
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124 
00125 #endif /* CDIO_LOGGING_H_ */
00126 
00127 
00128 /* 
00129  * Local variables:
00130  *  c-file-style: "gnu"
00131  *  tab-width: 8
00132  *  indent-tabs-mode: nil
00133  * End:
00134  */