comparison src/core/ngx_log.c @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents f0b350454894
children 46833bd150cb
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
55 "debug_core", "debug_alloc", "debug_mutex", "debug_event", 55 "debug_core", "debug_alloc", "debug_mutex", "debug_event",
56 "debug_http", "debug_imap" 56 "debug_http", "debug_imap"
57 }; 57 };
58 58
59 59
60 #if (HAVE_VARIADIC_MACROS) 60 #if (NGX_HAVE_VARIADIC_MACROS)
61 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 61 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
62 const char *fmt, ...) 62 const char *fmt, ...)
63 #else 63 #else
64 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 64 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
65 const char *fmt, va_list args) 65 const char *fmt, va_list args)
66 #endif 66 #endif
67 { 67 {
68 char errstr[MAX_ERROR_STR]; 68 char errstr[MAX_ERROR_STR];
69 size_t len, max; 69 size_t len, max;
70 #if (HAVE_VARIADIC_MACROS) 70 #if (NGX_HAVE_VARIADIC_MACROS)
71 va_list args; 71 va_list args;
72 #endif 72 #endif
73 73
74 if (log->file->fd == NGX_INVALID_FILE) { 74 if (log->file->fd == NGX_INVALID_FILE) {
75 return; 75 return;
95 if (log->data && *(int *) log->data != -1) { 95 if (log->data && *(int *) log->data != -1) {
96 len += ngx_snprintf(errstr + len, max - len, 96 len += ngx_snprintf(errstr + len, max - len,
97 "*%u ", *(u_int *) log->data); 97 "*%u ", *(u_int *) log->data);
98 } 98 }
99 99
100 #if (HAVE_VARIADIC_MACROS) 100 #if (NGX_HAVE_VARIADIC_MACROS)
101 101
102 va_start(args, fmt); 102 va_start(args, fmt);
103 len += ngx_vsnprintf(errstr + len, max - len, fmt, args); 103 len += ngx_vsnprintf(errstr + len, max - len, fmt, args);
104 va_end(args); 104 va_end(args);
105 105
185 185
186 #endif 186 #endif
187 } 187 }
188 188
189 189
190 #if !(HAVE_VARIADIC_MACROS) 190 #if !(NGX_HAVE_VARIADIC_MACROS)
191 191
192 void ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 192 void ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
193 const char *fmt, ...) 193 const char *fmt, ...)
194 { 194 {
195 va_list args; 195 va_list args;
251 ngx_stderr.fd = STDERR_FILENO; 251 ngx_stderr.fd = STDERR_FILENO;
252 252
253 #endif 253 #endif
254 254
255 ngx_log.file = &ngx_stderr; 255 ngx_log.file = &ngx_stderr;
256 ngx_log.log_level = NGX_LOG_ERR; 256 ngx_log.log_level = NGX_LOG_NOTICE;
257 257
258 return &ngx_log; 258 return &ngx_log;
259 } 259 }
260 260
261 261