diff 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
line wrap: on
line diff
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -42,7 +42,7 @@ static const char *err_levels[] = {
 };
 
 static const char *debug_levels[] = {
-    "debug", "debug_core", "debug_alloc", "debug_event", "debug_http"
+    "debug_core", "debug_alloc", "debug_event", "debug_http"
 };
 
 
@@ -81,9 +81,9 @@ void ngx_log_error_core(int level, ngx_l
     len += ngx_snprintf(errstr + len, max - len,
                         PID_T_FMT "#%d: ", ngx_pid, /* STUB */ 0);
 
-    if (log->data) {
+    if (log->data && *(int *) log->data != -1) {
         len += ngx_snprintf(errstr + len, max - len,
-                            "*%u ", * (u_int *) log->data);
+                            "*%u ", *(u_int *) log->data);
     }
 
 #if (HAVE_VARIADIC_MACROS)
@@ -332,7 +332,7 @@ char *ngx_set_error_log_levels(ngx_conf_
 
     for (i = 2; i < cf->args->nelts; i++) {
 
-        for (n = 1; n < NGX_LOG_DEBUG; n++) {
+        for (n = 1; n <= NGX_LOG_DEBUG; n++) {
             if (ngx_strcmp(value[i].data, err_levels[n]) == 0) {
 
                 if (log->log_level != 0) {
@@ -368,5 +368,9 @@ char *ngx_set_error_log_levels(ngx_conf_
         }
     }
 
+    if (log->log_level == NGX_LOG_DEBUG) {
+        log->log_level = NGX_LOG_DEBUG_ALL;
+    }
+
     return NGX_CONF_OK;
 }