00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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