send libevent's warning messages to our logging framework instead of to the console
This commit is contained in:
parent
b0919dca34
commit
e19ecccae8
|
@ -115,6 +115,23 @@ readFromPipe( int fd, short eventType UNUSED, void * unused UNUSED )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
logFunc( int severity, const char * message )
|
||||||
|
{
|
||||||
|
switch( severity )
|
||||||
|
{
|
||||||
|
case _EVENT_LOG_DEBUG:
|
||||||
|
tr_dbg( "%s", message );
|
||||||
|
break;
|
||||||
|
case _EVENT_LOG_ERR:
|
||||||
|
tr_err( "%s", message );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tr_inf( "%s", message );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
libeventThreadFunc( void * veh )
|
libeventThreadFunc( void * veh )
|
||||||
{
|
{
|
||||||
|
@ -122,6 +139,7 @@ libeventThreadFunc( void * veh )
|
||||||
tr_dbg( "libevent thread starting" );
|
tr_dbg( "libevent thread starting" );
|
||||||
|
|
||||||
event_init( );
|
event_init( );
|
||||||
|
event_set_log_callback( logFunc );
|
||||||
|
|
||||||
/* listen to the pipe's read fd */
|
/* listen to the pipe's read fd */
|
||||||
event_set( &eh->pipeEvent, eh->fds[0], EV_READ|EV_PERSIST, readFromPipe, NULL );
|
event_set( &eh->pipeEvent, eh->fds[0], EV_READ|EV_PERSIST, readFromPipe, NULL );
|
||||||
|
|
Loading…
Reference in New Issue