better logging

This commit is contained in:
Eric House 2013-07-17 21:34:27 -07:00
parent 972dcfec81
commit 3737f19548

View file

@ -32,8 +32,8 @@ UdpThreadClosure::logStats()
{ {
time_t now = time( NULL ); time_t now = time( NULL );
if ( 1 < now - m_created ) { if ( 1 < now - m_created ) {
logf( XW_LOGERROR, "packet waited %d s for processing which then took %d s", logf( XW_LOGERROR, "packet %d waited %d s for processing which then took %d s",
m_dequed - m_created, now - m_dequed ); getID(), m_dequed - m_created, now - m_dequed );
} }
} }
@ -199,7 +199,8 @@ UdpQueue::thread_main()
pthread_mutex_unlock( &m_queueMutex ); pthread_mutex_unlock( &m_queueMutex );
utc->noteDequeued(); utc->noteDequeued();
logf( XW_LOGINFO, "%s: dispatching packet %d (socket %d)", __func__, logf( XW_LOGINFO, "%s: dispatching packet %d (socket %d); "
"%d seconds old", __func__,
utc->getID(), utc->addr()->socket() ); utc->getID(), utc->addr()->socket() );
(*utc->cb())( utc ); (*utc->cb())( utc );
utc->logStats(); utc->logStats();