xref: /PHP-7.1/sapi/fpm/fpm/zlog.h (revision 03f3b847)
1 	/* $Id: zlog.h,v 1.7 2008/05/22 21:08:32 anight Exp $ */
2 	/* (c) 2004-2007 Andrei Nigmatulin */
3 
4 #ifndef ZLOG_H
5 #define ZLOG_H 1
6 
7 #include <stdarg.h>
8 
9 #define zlog(flags,...) zlog_ex(__func__, __LINE__, flags, __VA_ARGS__)
10 
11 struct timeval;
12 
13 void zlog_set_external_logger(void (*logger)(int, char *, size_t));
14 int zlog_set_fd(int new_fd);
15 int zlog_set_level(int new_value);
16 const char *zlog_get_level_name(int log_level);
17 void zlog_set_launched(void);
18 
19 size_t zlog_print_time(struct timeval *tv, char *timebuf, size_t timebuf_len);
20 
21 void vzlog(const char *function, int line, int flags, const char *fmt, va_list args);
22 void zlog_ex(const char *function, int line, int flags, const char *fmt, ...)
23 		__attribute__ ((format(printf,4,5)));
24 
25 #ifdef HAVE_SYSLOG_H
26 extern const int syslog_priorities[];
27 #endif
28 
29 /* keep this same as FCGI_ERROR */
30 enum {
31 	ZLOG_DEBUG			= 1,
32 	ZLOG_NOTICE			= 2,
33 	ZLOG_WARNING		= 3,
34 	ZLOG_ERROR			= 4,
35 	ZLOG_ALERT			= 5,
36 };
37 
38 #define ZLOG_LEVEL_MASK 7
39 
40 #define ZLOG_HAVE_ERRNO 0x100
41 
42 #define ZLOG_SYSERROR (ZLOG_ERROR | ZLOG_HAVE_ERRNO)
43 
44 #ifdef HAVE_SYSLOG_H
45 #define ZLOG_SYSLOG -2
46 #endif
47 
48 #endif
49