Mercurial > hg > nginx
diff src/core/ngx_log.c @ 234:cd71b95716b4
nginx-0.0.1-2004-01-20-23:40:08 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 20 Jan 2004 20:40:08 +0000 |
parents | 03c54b6d7a6f |
children | 6bd5d25b6744 |
line wrap: on
line diff
--- a/src/core/ngx_log.c Mon Jan 19 18:09:14 2004 +0000 +++ b/src/core/ngx_log.c Tue Jan 20 20:40:08 2004 +0000 @@ -275,7 +275,6 @@ static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_int_t i, n, d; ngx_str_t *value; value = cf->args->elts; @@ -287,19 +286,30 @@ cf->cycle->log->file->name = value[1]; } + return ngx_set_error_log_levels(cf, cf->cycle->log); +} + + +char *ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log) +{ + ngx_int_t i, n, d; + ngx_str_t *value; + + value = cf->args->elts; + for (i = 2; i < cf->args->nelts; i++) { for (n = 1; n < NGX_LOG_DEBUG; n++) { if (ngx_strcmp(value[i].data, err_levels[n]) == 0) { - if (cf->cycle->log->log_level != 0) { + if (log->log_level != 0) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid log level \"%s\"", value[i].data); return NGX_CONF_ERROR; } - cf->cycle->log->log_level = n; + log->log_level = n; continue; } } @@ -307,21 +317,21 @@ d = NGX_LOG_DEBUG_FIRST; for (n = 0; n < /* STUB */ 4; n++) { if (ngx_strcmp(value[i].data, debug_levels[n]) == 0) { - if (cf->cycle->log->log_level & ~NGX_LOG_DEBUG_ALL) { + if (log->log_level & ~NGX_LOG_DEBUG_ALL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid log level \"%s\"", value[i].data); return NGX_CONF_ERROR; } - cf->cycle->log->log_level |= d; + log->log_level |= d; } d <<= 1; } - if (cf->cycle->log->log_level == 0) { + if (log->log_level == 0) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid log level \"%s\"", value[i].data); return NGX_CONF_ERROR;