aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_log.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-01-25 12:27:35 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-01-25 12:27:35 +0000
commite5a222c6fef26b51d956c35530178837c60bf8c4 (patch)
tree65dafe2f85fe2b09b82d3efd2abe2b43720a1f4e /src/core/ngx_log.h
parent4f06a9709164123e7d8ccbd6fa723da387a9a86c (diff)
downloadnginx-release-0.1.16.tar.gz
nginx-release-0.1.16.zip
nginx-0.1.16-RELEASE importrelease-0.1.16
*) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; the bug had appeared in 0.1.14.
Diffstat (limited to 'src/core/ngx_log.h')
-rw-r--r--src/core/ngx_log.h118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
index c54c18723..588837fff 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -40,14 +40,25 @@
#define NGX_LOG_DEBUG_ALL 0x7ffffff0
-typedef u_char *(*ngx_log_handler_pt) (void *ctx, u_char *buf, size_t len);
+typedef u_char *(*ngx_log_handler_pt) (ngx_log_t *log, u_char *buf, size_t len);
struct ngx_log_s {
ngx_uint_t log_level;
ngx_open_file_t *file;
- void *data;
+
+ ngx_uint_t connection;
+
ngx_log_handler_pt handler;
+ void *data;
+
+ /*
+ * we declare "action" as "char *" because the actions are usually
+ * the static strings and in the "u_char *" case we have to override
+ * their types all the time
+ */
+
+ char *action;
};
@@ -60,24 +71,32 @@ struct ngx_log_s {
#define NGX_HAVE_VARIADIC_MACROS 1
-#define ngx_log_error(level, log, args...) \
+#define ngx_log_error(level, log, args...) \
if (log->log_level >= level) ngx_log_error_core(level, log, args)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
const char *fmt, ...);
+#define ngx_log_debug(level, log, args...) \
+ if (log->log_level & level) \
+ ngx_log_error_core(NGX_LOG_DEBUG, log, args)
+
/*********************************/
#elif (NGX_HAVE_C99_VARIADIC_MACROS)
#define NGX_HAVE_VARIADIC_MACROS 1
-#define ngx_log_error(level, log, ...) \
+#define ngx_log_error(level, log, ...) \
if (log->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
const char *fmt, ...);
+#define ngx_log_debug(level, log, ...) \
+ if (log->log_level & level) \
+ ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
+
/*********************************/
#else /* NO VARIADIC MACROS */
@@ -100,80 +119,59 @@ void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...);
#if (NGX_HAVE_VARIADIC_MACROS)
-#define ngx_log_debug0(level, log, err, fmt) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt)
-
-#define ngx_log_debug1(level, log, err, fmt, arg1) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1)
-
-#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2)
-
-#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2, arg3)
-
-#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2, arg3, arg4)
-
-#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5)
-
-#define ngx_log_debug6(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6)
-
-#define ngx_log_debug7(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+#define ngx_log_debug0 ngx_log_debug
+#define ngx_log_debug1 ngx_log_debug
+#define ngx_log_debug2 ngx_log_debug
+#define ngx_log_debug3 ngx_log_debug
+#define ngx_log_debug4 ngx_log_debug
+#define ngx_log_debug5 ngx_log_debug
+#define ngx_log_debug6 ngx_log_debug
+#define ngx_log_debug7 ngx_log_debug
+#define ngx_log_debug8 ngx_log_debug
#else /* NO VARIADIC MACROS */
-#define ngx_log_debug0(level, log, err, fmt) \
- if (log->log_level & level) \
+#define ngx_log_debug0(level, log, err, fmt) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt)
-#define ngx_log_debug1(level, log, err, fmt, arg1) \
- if (log->log_level & level) \
+#define ngx_log_debug1(level, log, err, fmt, arg1) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1)
-#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
- if (log->log_level & level) \
+#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2)
-#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
- if (log->log_level & level) \
+#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3)
-#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
- if (log->log_level & level) \
+#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4)
-#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
- if (log->log_level & level) \
+#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5)
-#define ngx_log_debug6(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6) \
- if (log->log_level & level) \
+#define ngx_log_debug6(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
-#define ngx_log_debug7(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
- if (log->log_level & level) \
- ngx_log_debug_core(log, err, fmt, \
+#define ngx_log_debug7(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+ if (log->log_level & level) \
+ ngx_log_debug_core(log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+#define ngx_log_debug8(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
+ if (log->log_level & level) \
+ ngx_log_debug_core(log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
+
#endif
#else /* NO NGX_DEBUG */
@@ -187,6 +185,8 @@ void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...);
#define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define ngx_log_debug7(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \
arg6, arg7)
+#define ngx_log_debug8(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \
+ arg6, arg7, arg8)
#endif