Events: fixed logging.

This commit is contained in:
Sergey Kandaurov 2016-03-31 02:33:55 +03:00
parent c622ff3b44
commit 53fec2c414
2 changed files with 19 additions and 12 deletions

View File

@ -526,18 +526,18 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"eventport: fd:%d, ev:%04Xd",
event_list[i].portev_object, revents);
(int) event_list[i].portev_object, revents);
if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"port_getn() error fd:%d ev:%04Xd",
event_list[i].portev_object, revents);
(int) event_list[i].portev_object, revents);
}
if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"strange port_getn() events fd:%d ev:%04Xd",
event_list[i].portev_object, revents);
(int) event_list[i].portev_object, revents);
}
if ((revents & (POLLERR|POLLHUP|POLLNVAL))
@ -615,7 +615,7 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
default:
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"unexpected eventport object %d",
event_list[i].portev_object);
(int) event_list[i].portev_object);
continue;
}
}

View File

@ -579,7 +579,7 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
if (event_list[i].flags & EV_ERROR) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, event_list[i].data,
"kevent() error on %d filter:%d flags:%04Xd",
event_list[i].ident, event_list[i].filter,
(int) event_list[i].ident, event_list[i].filter,
event_list[i].flags);
continue;
}
@ -676,13 +676,20 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
static ngx_inline void
ngx_kqueue_dump_event(ngx_log_t *log, struct kevent *kev)
{
ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
(kev->ident > 0x8000000 && kev->ident != (unsigned) -1) ?
"kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p":
"kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
kev->ident, kev->filter,
kev->flags, kev->fflags,
kev->data, kev->udata);
if (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) {
ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
"kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
(void *) kev->ident, kev->filter,
kev->flags, kev->fflags,
(int) kev->data, kev->udata);
} else {
ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
"kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
(int) kev->ident, kev->filter,
kev->flags, kev->fflags,
(int) kev->data, kev->udata);
}
}