Mercurial > hg > nginx
comparison src/core/ngx_log.h @ 4:c5f071d376e5
nginx-0.0.1-2002-08-22-19:24:03 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 22 Aug 2002 15:24:03 +0000 |
parents | 34a521b1a148 |
children | 669801705ab1 |
comparison
equal
deleted
inserted
replaced
3:34a521b1a148 | 4:c5f071d376e5 |
---|---|
15 NGX_LOG_DEBUG | 15 NGX_LOG_DEBUG |
16 } ngx_log_e; | 16 } ngx_log_e; |
17 | 17 |
18 /* | 18 /* |
19 "[%time] [%level] %pid#%tid: %message:(%errno)%errstr, while %action" | 19 "[%time] [%level] %pid#%tid: %message:(%errno)%errstr, while %action" |
20 " %peer and processing %context" | 20 " %peer and while processing %context" |
21 | 21 |
22 ---- | |
22 message = "recv() failed"; | 23 message = "recv() failed"; |
23 errno = 32; | 24 errno = 32; |
24 action = "reading request headers from client"; | 25 action = "reading request headers from client"; |
25 peer = "192.168.1.1"; | 26 peer = "192.168.1.1"; |
26 context = "URL /" | 27 context = "URL /" |
27 | 28 |
28 "[2002/08/20 12:00:00] [error] 412#3: recv() failed:(32)Broken pipe," | 29 "[2002/08/20 12:00:00] [error] 412#3: recv() failed (32: Broken pipe)" |
29 " while reading request headers from client 192.168.1.1" | 30 " while reading request headers from client 192.168.1.1" |
30 " and processing URL /" | 31 " and while processing URL /" |
32 | |
33 ---- | |
34 message = "recv() failed"; | |
35 errno = 32; | |
36 ngx_http_proxy_error_context_t: | |
37 action = "reading headers from server %s for client %s and " | |
38 "while processing %s" | |
39 backend = "127.0.0.1"; | |
40 peer = "192.168.1.1"; | |
41 context = "URL /" | |
42 | |
43 "[2002/08/20 12:00:00] [error] 412#3: recv() failed (32: Broken pipe)" | |
44 " while reading headers from backend 127.0.0.1" | |
45 " for client 192.168.1.1 and while processing URL /" | |
46 | |
47 ---- | |
48 "[alert] 412#3: ngx_alloc: malloc() 102400 bytes failed (12: Cannot " | |
49 "allocate memory) while reading request headers from client 192.168.1.1" | |
50 " and while processing URL /" | |
31 | 51 |
32 | 52 |
33 OLD: | 53 OLD: |
34 "... while ", action = "reading client request headers" | 54 "... while ", action = "reading client request headers" |
35 "... while reading client request headers" | 55 "... while reading client request headers" |
40 | 60 |
41 typedef struct { | 61 typedef struct { |
42 int log_level; | 62 int log_level; |
43 char *action; | 63 char *action; |
44 char *context; | 64 char *context; |
45 /* char *func(ngx_log_t *log); */ | 65 #if 0 |
66 void *data; /* i.e. ngx_http_proxy_error_context_t */ | |
67 char *func(ngx_log_t *log); | |
68 #endif | |
46 } ngx_log_t; | 69 } ngx_log_t; |
47 | 70 |
48 #define MAX_ERROR_STR 2048 | 71 #define MAX_ERROR_STR 2048 |
49 | 72 |
50 #define _ , | 73 #define _ , |
55 #define HAVE_VARIADIC_MACROS 1 | 78 #define HAVE_VARIADIC_MACROS 1 |
56 | 79 |
57 #define ngx_log_error(level, log, args...) \ | 80 #define ngx_log_error(level, log, args...) \ |
58 if (log->log_level >= level) ngx_log_error_core(level, log, args) | 81 if (log->log_level >= level) ngx_log_error_core(level, log, args) |
59 | 82 |
60 #ifdef NGX_DEBUG | 83 #if (NGX_DEBUG) |
61 #define ngx_log_debug(log, args...) \ | 84 #define ngx_log_debug(log, args...) \ |
62 if (log->log_level == NGX_LOG_DEBUG) \ | 85 if (log->log_level == NGX_LOG_DEBUG) \ |
63 ngx_log_error_core(NGX_LOG_DEBUG, log, 0, args) | 86 ngx_log_error_core(NGX_LOG_DEBUG, log, 0, args) |
64 #else | 87 #else |
65 #define ngx_log_debug(log, args...) | 88 #define ngx_log_debug(log, args...) |
80 #define HAVE_VARIADIC_MACROS 1 | 103 #define HAVE_VARIADIC_MACROS 1 |
81 | 104 |
82 #define ngx_log_error(level, log, ...) \ | 105 #define ngx_log_error(level, log, ...) \ |
83 if (log->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__) | 106 if (log->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__) |
84 | 107 |
85 #ifdef NGX_DEBUG | 108 #if (NGX_DEBUG) |
86 #define ngx_log_debug(log, ...) \ | 109 #define ngx_log_debug(log, ...) \ |
87 if (log->log_level == NGX_LOG_DEBUG) \ | 110 if (log->log_level == NGX_LOG_DEBUG) \ |
88 ngx_log_error_core(NGX_LOG_DEBUG, log, 0, __VA_ARGS__) | 111 ngx_log_error_core(NGX_LOG_DEBUG, log, 0, __VA_ARGS__) |
89 #else | 112 #else |
90 #define ngx_log_debug(log, ...) | 113 #define ngx_log_debug(log, ...) |
102 | 125 |
103 #else /* NO VARIADIC MACROS */ | 126 #else /* NO VARIADIC MACROS */ |
104 | 127 |
105 #include <stdarg.h> | 128 #include <stdarg.h> |
106 | 129 |
107 #ifdef NGX_DEBUG | 130 #if (NGX_DEBUG) |
108 #define ngx_log_debug(log, text) \ | 131 #define ngx_log_debug(log, text) \ |
109 if (log->log_level == NGX_LOG_DEBUG) \ | 132 if (log->log_level == NGX_LOG_DEBUG) \ |
110 ngx_log_debug_core(log, text) | 133 ngx_log_debug_core(log, text) |
111 #else | 134 #else |
112 #define ngx_log_debug(log, text) | 135 #define ngx_log_debug(log, text) |