Index: trunk/spreadlogd.c =================================================================== --- trunk/spreadlogd.c (revision 41) +++ trunk/spreadlogd.c (revision 42) @@ -201,8 +201,11 @@ } +static void stderr_debug(int s, const char *m) { + fprintf(stderr, "[%d] %s\n", s, m); +} int main(int argc, char **argv) { char *configfile = default_configfile; struct event signal_hup, signal_term, reconn; - int getoption, debug = 0; + int getoption, debug = 0, rv; struct timeval tv; @@ -249,4 +252,5 @@ if(!debug) daemonize(); + else event_set_log_callback(stderr_debug); /* SIGHUP and SIGTERM */ @@ -264,5 +268,6 @@ establish_spread_connections(); - event_dispatch(); + rv = event_dispatch(); + printf("event_dispatch -> %d [%d]\n", rv, errno); config_cleanup(); return 0;