00001 #ifndef foodaemonloghfoo
00002 #define foodaemonloghfoo
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <syslog.h>
00025 #include <stdarg.h>
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00038 enum daemon_log_flags {
00039 DAEMON_LOG_SYSLOG = 1,
00040 DAEMON_LOG_STDERR = 2,
00041 DAEMON_LOG_STDOUT = 4,
00042 DAEMON_LOG_AUTO = 8
00045 };
00046
00049 extern enum daemon_log_flags daemon_log_use;
00050
00053 extern const char* daemon_log_ident;
00054
00055 #if defined(__GNUC__) && ! defined(DAEMON_GCC_PRINTF_ATTR)
00056 #define DAEMON_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
00057 #else
00058
00059 #define DAEMON_GCC_PRINTF_ATTR(a,b)
00060 #endif
00061
00066 void daemon_log(int prio, const char* t, ...) DAEMON_GCC_PRINTF_ATTR(2,3);
00067
00072 #define DAEMON_LOGV_AVAILABLE 1
00073
00078 void daemon_logv(int prio, const char* t, va_list ap);
00079
00086 char *daemon_ident_from_argv0(char *argv0);
00087
00092 #define DAEMON_SET_VERBOSITY_AVAILABLE 1
00093
00108 void daemon_set_verbosity(int verbosity_prio);
00109
00110 #ifdef __cplusplus
00111 }
00112 #endif
00113
00114 #endif