libdebian-installer
log.h
1/*
2 * log.h
3 *
4 * Copyright (C) 2003 Bastian Blank <waldi@debian.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef DEBIAN_INSTALLER__LOG_H
21#define DEBIAN_INSTALLER__LOG_H
22
23#include <stdarg.h>
24
33typedef enum
34{
45 DI_LOG_LEVEL_MASK = ~DI_LOG_FLAG_FATAL,
47}
49
50typedef void di_log_handler (di_log_level_flags log_level, const char *message, void *user_data);
51
55#define di_error(format...) di_log (DI_LOG_LEVEL_ERROR, format)
59#define di_warning(format...) di_log (DI_LOG_LEVEL_WARNING, format)
63#define di_info(format...) di_log (DI_LOG_LEVEL_INFO, format)
67#define di_debug(format...) di_log (DI_LOG_LEVEL_DEBUG, format)
68
75void di_log (di_log_level_flags log_level, const char *format, ...) __attribute__ ((format(printf,2,3)));
83void di_vlog (di_log_level_flags log_level, const char *format, va_list args);
84
92unsigned int di_log_set_handler (di_log_level_flags log_levels, di_log_handler *log_func, void *user_data);
93
94di_log_handler
105
107#endif
unsigned int di_log_set_handler(di_log_level_flags log_levels, di_log_handler *log_func, void *user_data)
Definition log.c:189
di_log_handler di_log_handler_default
Definition log.h:99
void void di_vlog(di_log_level_flags log_level, const char *format, va_list args)
Definition log.c:217
void di_log(di_log_level_flags log_level, const char *format,...) __attribute__((format(printf
di_log_handler di_log_handler_syslog
Definition log.h:104
di_log_level_flags
Log levels and other flags.
Definition log.h:34
@ DI_LOG_LEVEL_MASK
Definition log.h:45
@ DI_LOG_LEVEL_WARNING
Definition log.h:39
@ DI_LOG_LEVEL_MESSAGE
Definition log.h:40
@ DI_LOG_FLAG_FATAL
Definition log.h:35
@ DI_LOG_LEVEL_INFO
Definition log.h:41
@ DI_LOG_LEVEL_ERROR
Definition log.h:37
@ DI_LOG_LEVEL_CRITICAL
Definition log.h:38
@ DI_LOG_FATAL_MASK
Definition log.h:46
@ DI_LOG_LEVEL_DEBUG
Definition log.h:42
@ DI_LOG_LEVEL_OUTPUT
Definition log.h:43