diff options
Diffstat (limited to 'src/core/ngx_log.h')
-rw-r--r-- | src/core/ngx_log.h | 71 |
1 files changed, 13 insertions, 58 deletions
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h index 46fbf12ce..375acae73 100644 --- a/src/core/ngx_log.h +++ b/src/core/ngx_log.h @@ -126,130 +126,85 @@ void ngx_assert_core(ngx_log_t *log, const char *fmt, ...); /*********************************/ +#if (NGX_DEBUG) + #if (HAVE_VARIADIC_MACROS) -#if (NGX_DEBUG) #define ngx_log_debug0(level, log, err, fmt) \ if (log->log_level & level) \ ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt) -#else -#define ngx_log_debug0(level, log, err, fmt) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug1(level, log, err, fmt, arg1) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6) -#endif - -/*********************************/ #else /* NO VARIADIC MACROS */ -#if (NGX_DEBUG) #define ngx_log_debug0(level, log, err, fmt) \ if (log->log_level & level) \ ngx_log_debug_core(log, err, fmt) -#else -#define ngx_log_debug0(level, log, err, fmt) -#endif -#if (NGX_DEBUG) #define ngx_log_debug1(level, log, err, fmt, arg1) \ if (log->log_level & level) \ ngx_log_debug_core(log, err, fmt, arg1) -#else -#define ngx_log_debug1(level, log, err, fmt, arg1) -#endif -#if (NGX_DEBUG) #define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \ if (log->log_level & level) \ ngx_log_debug_core(log, err, fmt, arg1, arg2) -#else -#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) -#endif -#if (NGX_DEBUG) #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) -#else -#define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6) -#endif #endif +#else /* NO NGX_DEBUG */ + +#define ngx_log_debug0(level, log, err, fmt) +#define ngx_log_debug1(level, log, err, fmt, arg1) +#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) +#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) +#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) +#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) +#define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6) + +#endif /*********************************/ |