Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

log.h

00001 /* 00002 * log.h 00003 * 00004 * Copyright (C) 2003 Bastian Blank <waldi@debian.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 * 00020 * $Id: log.h 11699 2004-03-22 09:35:42Z waldi $ 00021 */ 00022 00023 #ifndef DEBIAN_INSTALLER__LOG_H 00024 #define DEBIAN_INSTALLER__LOG_H 00025 00026 #include <stdarg.h> 00027 00036 typedef enum 00037 { 00038 DI_LOG_FLAG_FATAL = 1 << 1, 00040 DI_LOG_LEVEL_ERROR = 1 << 2, 00041 DI_LOG_LEVEL_CRITICAL = 1 << 3, 00042 DI_LOG_LEVEL_WARNING = 1 << 4, 00043 DI_LOG_LEVEL_MESSAGE = 1 << 5, 00044 DI_LOG_LEVEL_INFO = 1 << 6, 00045 DI_LOG_LEVEL_DEBUG = 1 << 7, 00046 DI_LOG_LEVEL_OUTPUT = 1 << 8, 00048 DI_LOG_LEVEL_MASK = ~DI_LOG_FLAG_FATAL, 00049 DI_LOG_FATAL_MASK = DI_LOG_LEVEL_ERROR, 00050 } 00051 di_log_level_flags; 00052 00053 typedef void di_log_handler (di_log_level_flags log_level, const char *message, void *user_data); 00054 00058 #define di_error(format...) di_log (DI_LOG_LEVEL_ERROR, format) 00059 00062 #define di_warning(format...) di_log (DI_LOG_LEVEL_WARNING, format) 00063 00066 #define di_info(format...) di_log (DI_LOG_LEVEL_INFO, format) 00067 00070 #define di_debug(format...) di_log (DI_LOG_LEVEL_DEBUG, format) 00071 00078 void di_log (di_log_level_flags log_level, const char *format, ...) __attribute__ ((format(printf,2,3))); 00086 void di_vlog (di_log_level_flags log_level, const char *format, va_list args); 00087 00095 unsigned int di_log_set_handler (di_log_level_flags log_levels, di_log_handler *log_func, void *user_data); 00096 00097 di_log_handler 00102 di_log_handler_default, 00107 di_log_handler_syslog; 00108 00110 #endif

Generated on Tue Jun 15 11:44:40 2004 for libdebian-installer by doxygen 1.3.7