Back to index

php5  5.3.10
zlog.h
Go to the documentation of this file.
00001 
00002        /* $Id: zlog.h,v 1.7 2008/05/22 21:08:32 anight Exp $ */
00003        /* (c) 2004-2007 Andrei Nigmatulin */
00004 
00005 #ifndef ZLOG_H
00006 #define ZLOG_H 1
00007 
00008 #define zlog(flags,...) zlog_ex(__func__, __LINE__, flags, __VA_ARGS__)
00009 
00010 struct timeval;
00011 
00012 int zlog_set_fd(int new_fd);
00013 int zlog_set_level(int new_value);
00014 const char *zlog_get_level_name(int log_level);
00015 void zlog_set_launched(void);
00016 
00017 size_t zlog_print_time(struct timeval *tv, char *timebuf, size_t timebuf_len);
00018 
00019 void zlog_ex(const char *function, int line, int flags, const char *fmt, ...)
00020               __attribute__ ((format(printf,4,5)));
00021 
00022 #ifdef HAVE_SYSLOG_H
00023 extern const int syslog_priorities[];
00024 #endif
00025 
00026 enum {
00027        ZLOG_DEBUG                  = 1,
00028        ZLOG_NOTICE                 = 2,
00029        ZLOG_WARNING         = 3,
00030        ZLOG_ERROR                  = 4,
00031        ZLOG_ALERT                  = 5,
00032 };
00033 
00034 #define ZLOG_LEVEL_MASK 7
00035 
00036 #define ZLOG_HAVE_ERRNO 0x100
00037 
00038 #define ZLOG_SYSERROR (ZLOG_ERROR | ZLOG_HAVE_ERRNO)
00039 
00040 #ifdef HAVE_SYSLOG_H
00041 #define ZLOG_SYSLOG -2
00042 #endif
00043 
00044 #endif