Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef REPORT_H
00021 #define REPORT_H
00022
00023 #ifdef __GNUC__
00024 #define ATTR_NORET __attribute__((noreturn))
00025 #else
00026 #define ATTR_NORET
00027 #endif
00028
00029 enum report_output {
00030 report_console,
00031 report_syslog,
00032 report_none
00033 };
00034
00035 enum report_type {
00036 report_debug,
00037 report_info,
00038 report_warning,
00039 report_error,
00040 report_fatal
00041 };
00042
00043 extern void report_set_output(enum report_output new_output);
00044 extern void report(enum report_type type, char *msg, ...);
00045
00046 #ifndef DEBUG_LOGGING_DISABLED
00047 #define debug(msg, ...) report(report_debug, msg, ##__VA_ARGS__)
00048 #else
00049 #define debug(...)
00050 #endif
00051
00052 #define info(msg, ...) report(report_info, msg, ##__VA_ARGS__)
00053 #define warning(msg, ...) report(report_warning, msg, ##__VA_ARGS__)
00054 #define error(msg, ...) report(report_error, msg, ##__VA_ARGS__)
00055
00056 extern void ATTR_NORET die(int status, char *msg, ...);
00057
00058 #endif
00059