diff options
author | defanor <defanor@uberspace.net> | 2021-02-12 20:11:20 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-02-12 20:11:20 +0300 |
commit | d0d568f9bc39f9e35b6d39ecf21b5e425ea91c85 (patch) | |
tree | 1cb5e728bb80005707244038f2eacbdce01dbbf6 /src/rexmpp.c | |
parent | 3b5806a16e4fd0a6f292050508790fc0c3f6b36f (diff) |
Set log_function on initialisation
rexmpp_init may write logs itself, so a logging function should be set
for that.
Diffstat (limited to 'src/rexmpp.c')
-rw-r--r-- | src/rexmpp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c index 3064f3f..dde85f1 100644 --- a/src/rexmpp.c +++ b/src/rexmpp.c @@ -359,7 +359,9 @@ int rexmpp_sasl_cb (Gsasl *ctx, Gsasl_session *sctx, Gsasl_property prop) { return s->sasl_property_cb(s, prop); } -rexmpp_err_t rexmpp_init (rexmpp_t *s, const char *jid) +rexmpp_err_t rexmpp_init (rexmpp_t *s, + const char *jid, + log_function_t log_func) { int err; xmlSAXHandler sax = { @@ -421,7 +423,7 @@ rexmpp_err_t rexmpp_init (rexmpp_t *s, const char *jid) s->stanza_queue_size = 1024; s->send_queue_size = 1024; s->iq_queue_size = 1024; - s->log_function = NULL; + s->log_function = log_func; s->sasl_property_cb = NULL; s->xml_in_cb = NULL; s->xml_out_cb = NULL; |