comparison src/core/ngx_log.c @ 2722:ffa8e2451457

show -t results on stderr
author Igor Sysoev <igor@sysoev.ru>
date Sun, 19 Apr 2009 16:06:09 +0000
parents dbd02ee65df4
children d43d73277c5c
comparison
equal deleted inserted replaced
2721:8e720b7fe6d2 2722:ffa8e2451457
188 { 188 {
189 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err, text, param); 189 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err, text, param);
190 } 190 }
191 191
192 192
193 void ngx_cdecl
194 ngx_log_stderr(const char *fmt, ...)
195 {
196 u_char *p;
197 va_list args;
198 u_char errstr[NGX_MAX_ERROR_STR];
199
200 va_start(args, fmt);
201 p = ngx_vsnprintf(errstr, NGX_MAX_ERROR_STR, fmt, args);
202 va_end(args);
203
204 if (p > errstr + NGX_MAX_ERROR_STR - NGX_LINEFEED_SIZE) {
205 p = errstr + NGX_MAX_ERROR_STR - NGX_LINEFEED_SIZE;
206 }
207
208 ngx_linefeed(p);
209
210 (void) ngx_write_fd(ngx_stderr_fileno, errstr, p - errstr);
211 }
212
213
193 ngx_log_t * 214 ngx_log_t *
194 ngx_log_init(void) 215 ngx_log_init(void)
195 { 216 {
196 ngx_log.file = &ngx_stderr; 217 ngx_log.file = &ngx_stderr;
197 ngx_log.log_level = NGX_LOG_NOTICE; 218 ngx_log.log_level = NGX_LOG_NOTICE;