Fix bug with NULL log handlers. Also, default log handler is NULL

always.
This commit is contained in:
Jack Moffitt
2005-06-15 18:15:08 +00:00
parent 34f2f10294
commit 64aba297a2

View File

@@ -73,12 +73,7 @@ void xmpp_default_logger(void * const userdata,
fprintf(stderr, "%s %s %s\n", area, xmpp_log_level_name[level], msg); fprintf(stderr, "%s %s %s\n", area, xmpp_log_level_name[level], msg);
} }
#ifdef _WIN32
static xmpp_log_t xmpp_default_log = { NULL, NULL }; static xmpp_log_t xmpp_default_log = { NULL, NULL };
#else
static xmpp_log_t xmpp_default_log = { xmpp_default_logger, NULL };
#endif
/** convenience functions for accessing the context **/ /** convenience functions for accessing the context **/
@@ -114,6 +109,7 @@ void xmpp_log(const xmpp_ctx_t * const ctx,
vsnprintf(buf, 1023, fmt, ap); vsnprintf(buf, 1023, fmt, ap);
if (ctx->log->handler)
ctx->log->handler(ctx->log->userdata, level, area, buf); ctx->log->handler(ctx->log->userdata, level, area, buf);
} }