dlog.h

Go to the documentation of this file.
00001 #ifndef foodaemonloghfoo
00002 #define foodaemonloghfoo
00003 
00004 /***
00005   This file is part of libdaemon.
00006 
00007   Copyright 2003-2008 Lennart Poettering
00008 
00009   libdaemon is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU Lesser General Public License as
00011   published by the Free Software Foundation, either version 2.1 of the
00012   License, or (at your option) any later version.
00013 
00014   libdaemon is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017   Lesser General Public License for more details.
00018 
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with libdaemon. If not, see
00021   <http://www.gnu.org/licenses/>.
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 
00048 extern enum daemon_log_flags daemon_log_use;
00049 
00052 extern const char* daemon_log_ident;
00053 
00054 #if defined(__GNUC__) && ! defined(DAEMON_GCC_PRINTF_ATTR)
00055 
00056 #define DAEMON_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
00057 #else
00058 #define DAEMON_GCC_PRINTF_ATTR(a,b)
00059 #endif
00060 
00065 void daemon_log(int prio, const char* t, ...) DAEMON_GCC_PRINTF_ATTR(2,3);
00066 
00068 #define DAEMON_LOGV_AVAILABLE 1
00069 
00074 void daemon_logv(int prio, const char* t, va_list ap);
00075 
00082 char *daemon_ident_from_argv0(char *argv0);
00083 
00084 #ifdef __cplusplus
00085 }
00086 #endif
00087 
00088 #endif

Generated on Fri Mar 27 11:42:57 2009 for libdaemon by  doxygen 1.5.1