diff --git a/jabber.c b/jabber.c index 4c9d65fe..a19fce42 100644 --- a/jabber.c +++ b/jabber.c @@ -12,6 +12,22 @@ static xmpp_log_t *_log; static xmpp_ctx_t *_ctx; static xmpp_conn_t *_conn; +void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level, + const char * const area, const char * const msg); + +static const xmpp_log_t file_log = { &xmpp_file_logger, XMPP_LEVEL_DEBUG }; + +xmpp_log_t *xmpp_get_file_logger() +{ + return (xmpp_log_t*) &file_log; +} + +void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level, + const char * const area, const char * const msg) +{ + log_msg(area, msg); +} + // private XMPP handlers static void _jabber_conn_handler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, const int error, diff --git a/log.c b/log.c index 94489bea..d38d9bec 100644 --- a/log.c +++ b/log.c @@ -1,26 +1,9 @@ #include -#include #include "log.h" extern FILE *logp; -void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level, - const char * const area, const char * const msg); - -static const xmpp_log_t file_log = { &xmpp_file_logger, XMPP_LEVEL_DEBUG }; - -xmpp_log_t *xmpp_get_file_logger() -{ - return (xmpp_log_t*) &file_log; -} - -void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level, - const char * const area, const char * const msg) -{ - log_msg(area, msg); -} - void log_msg(const char * const area, const char * const msg) { fprintf(logp, "%s DEBUG: %s\n", area, msg); diff --git a/log.h b/log.h index 1aad4872..df105296 100644 --- a/log.h +++ b/log.h @@ -12,7 +12,6 @@ // file log FILE *logp; -xmpp_log_t *xmpp_get_file_logger(); void log_init(void); void log_msg(const char * const area, const char * const msg); void log_close(void);