Mercurial > hg > nginx
comparison src/core/ngx_cycle.c @ 5250:3bb51e5afa9e
Core: moved initialization of log level.
The cycle->new_log->log_level should only be initialized by ngx_init_cycle()
if no error logs were found in the configuration. This move allows to get rid
of extra initialization in ngx_error_log().
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Thu, 13 Jun 2013 14:50:10 +0400 |
parents | d8af1005e886 |
children | e088695737c3 |
comparison
equal
deleted
inserted
replaced
5249:725fb71ab1a6 | 5250:3bb51e5afa9e |
---|---|
82 return NULL; | 82 return NULL; |
83 } | 83 } |
84 | 84 |
85 cycle->pool = pool; | 85 cycle->pool = pool; |
86 cycle->log = log; | 86 cycle->log = log; |
87 cycle->new_log.log_level = NGX_LOG_ERR; | |
88 cycle->old_cycle = old_cycle; | 87 cycle->old_cycle = old_cycle; |
89 | 88 |
90 cycle->conf_prefix.len = old_cycle->conf_prefix.len; | 89 cycle->conf_prefix.len = old_cycle->conf_prefix.len; |
91 cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix); | 90 cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix); |
92 if (cycle->conf_prefix.data == NULL) { | 91 if (cycle->conf_prefix.data == NULL) { |
342 if (cycle->new_log.file == NULL) { | 341 if (cycle->new_log.file == NULL) { |
343 cycle->new_log.file = ngx_conf_open_file(cycle, &error_log); | 342 cycle->new_log.file = ngx_conf_open_file(cycle, &error_log); |
344 if (cycle->new_log.file == NULL) { | 343 if (cycle->new_log.file == NULL) { |
345 goto failed; | 344 goto failed; |
346 } | 345 } |
346 | |
347 cycle->new_log.log_level = NGX_LOG_ERR; | |
347 } | 348 } |
348 | 349 |
349 /* open the new files */ | 350 /* open the new files */ |
350 | 351 |
351 part = &cycle->open_files.part; | 352 part = &cycle->open_files.part; |