00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef NUBASE_LOG_HEADER
00024 #define NUBASE_LOG_HEADER
00025
00026 #ifdef HAVE_CONFIG_H
00027 # include "config.h"
00028 #endif
00029 #include <syslog.h>
00030 #include "debug.h"
00031
00038 #define SYSLOG_OPTS \
00039 LOG_CONS||LOG_PID
00040 #define LOG_TO_STD 1
00041 #define LOG_TO_SYSLOG 2
00049 extern int log_engine;
00050
00051 extern int debug_level;
00052 extern int debug_areas;
00054 void init_log_engine(const char* log_id);
00055 void log_printf(debug_level_t priority, char *format, ...)
00056 #ifdef __GNUC__
00057 __attribute__((__format__(printf,2,3)))
00058 #endif
00059 ;
00060
00061 void log_area_printf(debug_area_t area, debug_level_t priority, char *format, ...)
00062 #ifdef __GNUC__
00063 __attribute__((__format__(printf,3,4)))
00064 #endif
00065 ;
00066
00070 #ifdef DEBUG_ENABLE
00071 # define debug_log_printf(area, priority, format, args...) \
00072 log_area_printf(area, priority, format, ##args )
00073 #else
00074 # define debug_log_printf(area, priority, format, ...)
00075 #endif
00076
00077 #endif