comparison src/core/ngx_log.c @ 257:70e1c7d2b83d

nginx-0.0.2-2004-02-11-20:08:49 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 11 Feb 2004 17:08:49 +0000
parents 2a0540287298
children 5238e93961a1
comparison
equal deleted inserted replaced
256:8e39cab6abd5 257:70e1c7d2b83d
40 "stderr", "emerg", "alert", "crit", "error", 40 "stderr", "emerg", "alert", "crit", "error",
41 "warn", "notice", "info", "debug" 41 "warn", "notice", "info", "debug"
42 }; 42 };
43 43
44 static const char *debug_levels[] = { 44 static const char *debug_levels[] = {
45 "debug", "debug_core", "debug_alloc", "debug_event", "debug_http" 45 "debug_core", "debug_alloc", "debug_event", "debug_http"
46 }; 46 };
47 47
48 48
49 #if (HAVE_VARIADIC_MACROS) 49 #if (HAVE_VARIADIC_MACROS)
50 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err, 50 void ngx_log_error_core(int level, ngx_log_t *log, ngx_err_t err,
79 79
80 /* pid#tid */ 80 /* pid#tid */
81 len += ngx_snprintf(errstr + len, max - len, 81 len += ngx_snprintf(errstr + len, max - len,
82 PID_T_FMT "#%d: ", ngx_pid, /* STUB */ 0); 82 PID_T_FMT "#%d: ", ngx_pid, /* STUB */ 0);
83 83
84 if (log->data) { 84 if (log->data && *(int *) log->data != -1) {
85 len += ngx_snprintf(errstr + len, max - len, 85 len += ngx_snprintf(errstr + len, max - len,
86 "*%u ", * (u_int *) log->data); 86 "*%u ", *(u_int *) log->data);
87 } 87 }
88 88
89 #if (HAVE_VARIADIC_MACROS) 89 #if (HAVE_VARIADIC_MACROS)
90 90
91 va_start(args, fmt); 91 va_start(args, fmt);
330 330
331 value = cf->args->elts; 331 value = cf->args->elts;
332 332
333 for (i = 2; i < cf->args->nelts; i++) { 333 for (i = 2; i < cf->args->nelts; i++) {
334 334
335 for (n = 1; n < NGX_LOG_DEBUG; n++) { 335 for (n = 1; n <= NGX_LOG_DEBUG; n++) {
336 if (ngx_strcmp(value[i].data, err_levels[n]) == 0) { 336 if (ngx_strcmp(value[i].data, err_levels[n]) == 0) {
337 337
338 if (log->log_level != 0) { 338 if (log->log_level != 0) {
339 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 339 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
340 "invalid log level \"%s\"", 340 "invalid log level \"%s\"",
366 "invalid log level \"%s\"", value[i].data); 366 "invalid log level \"%s\"", value[i].data);
367 return NGX_CONF_ERROR; 367 return NGX_CONF_ERROR;
368 } 368 }
369 } 369 }
370 370
371 if (log->log_level == NGX_LOG_DEBUG) {
372 log->log_level = NGX_LOG_DEBUG_ALL;
373 }
374
371 return NGX_CONF_OK; 375 return NGX_CONF_OK;
372 } 376 }