libdaemon  0.14
dlog.h
Go to the documentation of this file.
1 #ifndef foodaemonloghfoo
2 #define foodaemonloghfoo
3 
4 /***
5  This file is part of libdaemon.
6 
7  Copyright 2003-2008 Lennart Poettering
8 
9  libdaemon is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as
11  published by the Free Software Foundation, either version 2.1 of the
12  License, or (at your option) any later version.
13 
14  libdaemon is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with libdaemon. If not, see
21  <http://www.gnu.org/licenses/>.
22 ***/
23 
24 #include <syslog.h>
25 #include <stdarg.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
45 };
46 
50 
53 extern const char* daemon_log_ident;
54 
55 #if defined(__GNUC__) && ! defined(DAEMON_GCC_PRINTF_ATTR)
56 #define DAEMON_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
57 #else
58 
59 #define DAEMON_GCC_PRINTF_ATTR(a,b)
60 #endif
61 
66 void daemon_log(int prio, const char* t, ...) DAEMON_GCC_PRINTF_ATTR(2,3);
67 
72 #define DAEMON_LOGV_AVAILABLE 1
73 
78 void daemon_logv(int prio, const char* t, va_list ap);
79 
86 char *daemon_ident_from_argv0(char *argv0);
87 
92 #define DAEMON_SET_VERBOSITY_AVAILABLE 1
93 
108 void daemon_set_verbosity(int verbosity_prio);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif