Mercurial > hg > nginx-quic
annotate src/core/ngx_log.h @ 6794:93b294c5d581
Upstream: avoid holding a cache node with upgraded connections.
Holding a cache node lock doesn't make sense as we can't use caching
anyway, and results in "ignore long locked inactive cache entry" alerts
if a node is locked for a long time.
The same is done for unbuffered connections, as they can be alive for
a long time as well.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 03 Nov 2016 17:09:32 +0300 |
parents | 4b420f9c4c5d |
children | f18db38a9826 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
7 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_LOG_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_LOG_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
12 #include <ngx_config.h> |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
13 #include <ngx_core.h> |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
14 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
307
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
16 #define NGX_LOG_STDERR 0 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
17 #define NGX_LOG_EMERG 1 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
18 #define NGX_LOG_ALERT 2 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
19 #define NGX_LOG_CRIT 3 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
20 #define NGX_LOG_ERR 4 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
21 #define NGX_LOG_WARN 5 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
22 #define NGX_LOG_NOTICE 6 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
23 #define NGX_LOG_INFO 7 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
24 #define NGX_LOG_DEBUG 8 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
25 |
379
73688d5d7fc3
nginx-0.0.7-2004-07-06-20:12:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
26 #define NGX_LOG_DEBUG_CORE 0x010 |
73688d5d7fc3
nginx-0.0.7-2004-07-06-20:12:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
27 #define NGX_LOG_DEBUG_ALLOC 0x020 |
73688d5d7fc3
nginx-0.0.7-2004-07-06-20:12:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
28 #define NGX_LOG_DEBUG_MUTEX 0x040 |
73688d5d7fc3
nginx-0.0.7-2004-07-06-20:12:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
29 #define NGX_LOG_DEBUG_EVENT 0x080 |
73688d5d7fc3
nginx-0.0.7-2004-07-06-20:12:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
30 #define NGX_LOG_DEBUG_HTTP 0x100 |
1136 | 31 #define NGX_LOG_DEBUG_MAIL 0x200 |
6484
4b420f9c4c5d
Removed the prototype mysql module.
Ruslan Ermilov <ru@nginx.com>
parents:
6186
diff
changeset
|
32 #define NGX_LOG_DEBUG_STREAM 0x400 |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
389
diff
changeset
|
33 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
389
diff
changeset
|
34 /* |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
35 * do not forget to update debug_levels[] in src/core/ngx_log.c |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
36 * after the adding a new debug level |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
389
diff
changeset
|
37 */ |
208
0b67be7d4489
nginx-0.0.1-2003-12-08-23:48:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
201
diff
changeset
|
38 |
307
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
39 #define NGX_LOG_DEBUG_FIRST NGX_LOG_DEBUG_CORE |
6115 | 40 #define NGX_LOG_DEBUG_LAST NGX_LOG_DEBUG_STREAM |
307
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
41 #define NGX_LOG_DEBUG_CONNECTION 0x80000000 |
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
42 #define NGX_LOG_DEBUG_ALL 0x7ffffff0 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
44 |
483 | 45 typedef u_char *(*ngx_log_handler_pt) (ngx_log_t *log, u_char *buf, size_t len); |
5702
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
46 typedef void (*ngx_log_writer_pt) (ngx_log_t *log, ngx_uint_t level, |
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
47 u_char *buf, size_t len); |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
48 |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
49 |
191
71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
50 struct ngx_log_s { |
257
70e1c7d2b83d
nginx-0.0.2-2004-02-11-20:08:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
234
diff
changeset
|
51 ngx_uint_t log_level; |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
52 ngx_open_file_t *file; |
483 | 53 |
495 | 54 ngx_atomic_uint_t connection; |
483 | 55 |
5962
727177743c3c
Core: added disk_full_time checks to error log.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5763
diff
changeset
|
56 time_t disk_full_time; |
727177743c3c
Core: added disk_full_time checks to error log.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5763
diff
changeset
|
57 |
483 | 58 ngx_log_handler_pt handler; |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
59 void *data; |
483 | 60 |
5702
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
61 ngx_log_writer_pt writer; |
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
62 void *wdata; |
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
63 |
483 | 64 /* |
65 * we declare "action" as "char *" because the actions are usually | |
66 * the static strings and in the "u_char *" case we have to override | |
67 * their types all the time | |
68 */ | |
69 | |
70 char *action; | |
5254
7ecaa9e4bf1b
Core: support several "error_log" directives.
Vladimir Homutov <vl@nginx.com>
parents:
4412
diff
changeset
|
71 |
7ecaa9e4bf1b
Core: support several "error_log" directives.
Vladimir Homutov <vl@nginx.com>
parents:
4412
diff
changeset
|
72 ngx_log_t *next; |
191
71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
73 }; |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
74 |
461 | 75 |
76 #define NGX_MAX_ERROR_STR 2048 | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
79 /*********************************/ |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
80 |
3673
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
81 #if (NGX_HAVE_C99_VARIADIC_MACROS) |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
82 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
83 #define NGX_HAVE_VARIADIC_MACROS 1 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
84 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
85 #define ngx_log_error(level, log, ...) \ |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
86 if ((log)->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__) |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
87 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
88 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
89 const char *fmt, ...); |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
90 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
91 #define ngx_log_debug(level, log, ...) \ |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
92 if ((log)->log_level & level) \ |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
93 ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__) |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
94 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
95 /*********************************/ |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
96 |
e27070fb6c6b
try to use C99 variadic macros first:
Igor Sysoev <igor@sysoev.ru>
parents:
2785
diff
changeset
|
97 #elif (NGX_HAVE_GCC_VARIADIC_MACROS) |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
98 |
455 | 99 #define NGX_HAVE_VARIADIC_MACROS 1 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
100 |
483 | 101 #define ngx_log_error(level, log, args...) \ |
543 | 102 if ((log)->log_level >= level) ngx_log_error_core(level, log, args) |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
103 |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
277
diff
changeset
|
104 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, |
499 | 105 const char *fmt, ...); |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
106 |
483 | 107 #define ngx_log_debug(level, log, args...) \ |
543 | 108 if ((log)->log_level & level) \ |
483 | 109 ngx_log_error_core(NGX_LOG_DEBUG, log, args) |
110 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
111 /*********************************/ |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
112 |
6161
e034af368274
Fixed bullying style of comments.
Ruslan Ermilov <ru@nginx.com>
parents:
6115
diff
changeset
|
113 #else /* no variadic macros */ |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
114 |
455 | 115 #define NGX_HAVE_VARIADIC_MACROS 0 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
116 |
503 | 117 void ngx_cdecl ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, |
499 | 118 const char *fmt, ...); |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
277
diff
changeset
|
119 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, |
499 | 120 const char *fmt, va_list args); |
503 | 121 void ngx_cdecl ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, |
122 const char *fmt, ...); | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
123 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
124 |
6161
e034af368274
Fixed bullying style of comments.
Ruslan Ermilov <ru@nginx.com>
parents:
6115
diff
changeset
|
125 #endif /* variadic macros */ |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
126 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
127 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
128 /*********************************/ |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
129 |
277
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
130 #if (NGX_DEBUG) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
131 |
455 | 132 #if (NGX_HAVE_VARIADIC_MACROS) |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
133 |
4397
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
134 #define ngx_log_debug0(level, log, err, fmt) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
135 ngx_log_debug(level, log, err, fmt) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
136 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
137 #define ngx_log_debug1(level, log, err, fmt, arg1) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
138 ngx_log_debug(level, log, err, fmt, arg1) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
139 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
140 #define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
141 ngx_log_debug(level, log, err, fmt, arg1, arg2) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
142 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
143 #define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
144 ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
145 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
146 #define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
147 ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
148 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
149 #define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
150 ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
151 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
152 #define ngx_log_debug6(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
153 arg1, arg2, arg3, arg4, arg5, arg6) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
154 ngx_log_debug(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
155 arg1, arg2, arg3, arg4, arg5, arg6) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
156 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
157 #define ngx_log_debug7(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
158 arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
159 ngx_log_debug(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
160 arg1, arg2, arg3, arg4, arg5, arg6, arg7) |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
161 |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
162 #define ngx_log_debug8(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
163 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
164 ngx_log_debug(level, log, err, fmt, \ |
d3000365ac65
Changed ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov <ru@nginx.com>
parents:
4283
diff
changeset
|
165 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) |
389
537de4dca8ca
nginx-0.0.7-2004-07-13-21:59:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
379
diff
changeset
|
166 |
515 | 167 |
6161
e034af368274
Fixed bullying style of comments.
Ruslan Ermilov <ru@nginx.com>
parents:
6115
diff
changeset
|
168 #else /* no variadic macros */ |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
169 |
483 | 170 #define ngx_log_debug0(level, log, err, fmt) \ |
543 | 171 if ((log)->log_level & level) \ |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
172 ngx_log_debug_core(log, err, fmt) |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
173 |
483 | 174 #define ngx_log_debug1(level, log, err, fmt, arg1) \ |
543 | 175 if ((log)->log_level & level) \ |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
176 ngx_log_debug_core(log, err, fmt, arg1) |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
208
diff
changeset
|
177 |
483 | 178 #define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \ |
543 | 179 if ((log)->log_level & level) \ |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
208
diff
changeset
|
180 ngx_log_debug_core(log, err, fmt, arg1, arg2) |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
208
diff
changeset
|
181 |
483 | 182 #define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \ |
543 | 183 if ((log)->log_level & level) \ |
213
f536f91e8e99
nginx-0.0.1-2003-12-19-15:45:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
184 ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3) |
f536f91e8e99
nginx-0.0.1-2003-12-19-15:45:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
185 |
483 | 186 #define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \ |
543 | 187 if ((log)->log_level & level) \ |
214
e0c502f15852
nginx-0.0.1-2003-12-22-12:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
213
diff
changeset
|
188 ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4) |
e0c502f15852
nginx-0.0.1-2003-12-22-12:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
213
diff
changeset
|
189 |
483 | 190 #define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \ |
543 | 191 if ((log)->log_level & level) \ |
214
e0c502f15852
nginx-0.0.1-2003-12-22-12:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
213
diff
changeset
|
192 ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5) |
e0c502f15852
nginx-0.0.1-2003-12-22-12:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
213
diff
changeset
|
193 |
483 | 194 #define ngx_log_debug6(level, log, err, fmt, \ |
195 arg1, arg2, arg3, arg4, arg5, arg6) \ | |
543 | 196 if ((log)->log_level & level) \ |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
208
diff
changeset
|
197 ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6) |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
208
diff
changeset
|
198 |
483 | 199 #define ngx_log_debug7(level, log, err, fmt, \ |
200 arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ | |
543 | 201 if ((log)->log_level & level) \ |
483 | 202 ngx_log_debug_core(log, err, fmt, \ |
389
537de4dca8ca
nginx-0.0.7-2004-07-13-21:59:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
379
diff
changeset
|
203 arg1, arg2, arg3, arg4, arg5, arg6, arg7) |
537de4dca8ca
nginx-0.0.7-2004-07-13-21:59:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
379
diff
changeset
|
204 |
483 | 205 #define ngx_log_debug8(level, log, err, fmt, \ |
206 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ | |
543 | 207 if ((log)->log_level & level) \ |
483 | 208 ngx_log_debug_core(log, err, fmt, \ |
209 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) | |
210 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
211 #endif |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
212 |
6161
e034af368274
Fixed bullying style of comments.
Ruslan Ermilov <ru@nginx.com>
parents:
6115
diff
changeset
|
213 #else /* !NGX_DEBUG */ |
277
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
214 |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
215 #define ngx_log_debug0(level, log, err, fmt) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
216 #define ngx_log_debug1(level, log, err, fmt, arg1) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
217 #define ngx_log_debug2(level, log, err, fmt, arg1, arg2) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
218 #define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
219 #define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
220 #define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
221 #define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6) |
426
3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
222 #define ngx_log_debug7(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \ |
3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
223 arg6, arg7) |
483 | 224 #define ngx_log_debug8(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \ |
225 arg6, arg7, arg8) | |
277
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
226 |
e91499541410
nginx-0.0.2-2004-03-03-19:14:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
227 #endif |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
228 |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
229 /*********************************/ |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
191
diff
changeset
|
230 |
2758 | 231 ngx_log_t *ngx_log_init(u_char *prefix); |
2752
2d82d3cfbfa0
change ngx_log_abort() interface
Igor Sysoev <igor@sysoev.ru>
parents:
2749
diff
changeset
|
232 void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...); |
2743
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2722
diff
changeset
|
233 void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...); |
2765 | 234 u_char *ngx_log_errno(u_char *buf, u_char *last, ngx_err_t err); |
5260
e088695737c3
Core: consolidated log-related code.
Vladimir Homutov <vl@nginx.com>
parents:
5254
diff
changeset
|
235 ngx_int_t ngx_log_open_default(ngx_cycle_t *cycle); |
e088695737c3
Core: consolidated log-related code.
Vladimir Homutov <vl@nginx.com>
parents:
5254
diff
changeset
|
236 ngx_int_t ngx_log_redirect_stderr(ngx_cycle_t *cycle); |
5702
777202558122
Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
5260
diff
changeset
|
237 ngx_log_t *ngx_log_get_file_log(ngx_log_t *head); |
5254
7ecaa9e4bf1b
Core: support several "error_log" directives.
Vladimir Homutov <vl@nginx.com>
parents:
4412
diff
changeset
|
238 char *ngx_log_set_log(ngx_conf_t *cf, ngx_log_t **head); |
234
cd71b95716b4
nginx-0.0.1-2004-01-20-23:40:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
218
diff
changeset
|
239 |
109
a9bc21d63fe4
nginx-0.0.1-2003-07-02-18:41:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
106
diff
changeset
|
240 |
4283
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
241 /* |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
242 * ngx_write_stderr() cannot be implemented as macro, since |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
243 * MSVC does not allow to use #ifdef inside macro parameters. |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
244 * |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
245 * ngx_write_fd() is used instead of ngx_write_console(), since |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
246 * CharToOemBuff() inside ngx_write_console() cannot be used with |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
247 * read only buffer as destination and CharToOemBuff() is not needed |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
248 * for ngx_write_stderr() anyway. |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
249 */ |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
250 static ngx_inline void |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
251 ngx_write_stderr(char *text) |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
252 { |
5763
09e734739e46
Style: use ngx_strlen() instead of strlen().
Tatsuhiko Kubo <cubicdaiya@gmail.com>
parents:
5702
diff
changeset
|
253 (void) ngx_write_fd(ngx_stderr, text, ngx_strlen(text)); |
4283
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
254 } |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
255 |
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3673
diff
changeset
|
256 |
6186
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
257 static ngx_inline void |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
258 ngx_write_stdout(char *text) |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
259 { |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
260 (void) ngx_write_fd(ngx_stdout, text, ngx_strlen(text)); |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
261 } |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
262 |
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
6161
diff
changeset
|
263 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
264 extern ngx_module_t ngx_errlog_module; |
2743
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2722
diff
changeset
|
265 extern ngx_uint_t ngx_use_stderr; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
266 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
267 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
268 #endif /* _NGX_LOG_H_INCLUDED_ */ |