comparison src/core/ngx_log.h @ 92:19cc647ecd91

nginx-0.0.1-2003-05-20-19:37:55 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 May 2003 15:37:55 +0000
parents a499e0d1f16e
children 7ebc8b7fb816
comparison
equal deleted inserted replaced
91:637625a2acdb 92:19cc647ecd91
4 4
5 #include <ngx_types.h> 5 #include <ngx_types.h>
6 #include <ngx_errno.h> 6 #include <ngx_errno.h>
7 7
8 typedef enum { 8 typedef enum {
9 NGX_LOG_EMERG = 0, 9 NGX_LOG_STDERR = 0,
10 NGX_LOG_EMERG,
10 NGX_LOG_ALERT, 11 NGX_LOG_ALERT,
11 NGX_LOG_CRIT, 12 NGX_LOG_CRIT,
12 NGX_LOG_ERR, 13 NGX_LOG_ERR,
13 NGX_LOG_WARN, 14 NGX_LOG_WARN,
14 NGX_LOG_NOTICE, 15 NGX_LOG_NOTICE,
15 NGX_LOG_INFO, 16 NGX_LOG_INFO,
16 NGX_LOG_DEBUG 17 NGX_LOG_DEBUG
17 } ngx_log_e; 18 } ngx_log_e;
19
18 20
19 /* 21 /*
20 "[%time] [%level] %pid#%tid: %message:(%errno)%errstr, while %action" 22 "[%time] [%level] %pid#%tid: %message:(%errno)%errstr, while %action"
21 " %peer and while processing %context" 23 " %peer and while processing %context"
22 24
57 "... while ", action = "reading client request headers" 59 "... while ", action = "reading client request headers"
58 context: pop3 user account 60 context: pop3 user account
59 "... while reading client command for 'john_doe'" 61 "... while reading client command for 'john_doe'"
60 */ 62 */
61 63
64
62 typedef struct { 65 typedef struct {
63 int log_level; 66 int log_level;
64 ngx_fd_t fd; 67 ngx_fd_t fd;
65 void *data; 68 void *data;
66 size_t (*handler)(void *ctx, char *buf, size_t len); 69 size_t (*handler)(void *ctx, char *buf, size_t len);
98 } 101 }
99 102
100 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err, 103 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err,
101 const char *fmt, ...); 104 const char *fmt, ...);
102 105
106
103 #elif (HAVE_C99_VARIADIC_MACROS) 107 #elif (HAVE_C99_VARIADIC_MACROS)
104 108
105 #define HAVE_VARIADIC_MACROS 1 109 #define HAVE_VARIADIC_MACROS 1
106 110
107 #define ngx_log_error(level, log, ...) \ 111 #define ngx_log_error(level, log, ...) \
122 fallback; \ 126 fallback; \
123 } 127 }
124 128
125 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err, 129 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err,
126 const char *fmt, ...); 130 const char *fmt, ...);
131
127 132
128 #else /* NO VARIADIC MACROS */ 133 #else /* NO VARIADIC MACROS */
129 134
130 #include <stdarg.h> 135 #include <stdarg.h>
131 136