about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-12 22:10:30 +0000
committerJames Booth <boothj5@gmail.com>2012-02-12 22:10:30 +0000
commitaf467928711057ef9d13d17f88576d24d44d4ee5 (patch)
tree92793e27f602f2d3fe05dd2d70ab9b4da38d99e7
parent7aa1d931a0e5578b7f7e3cc526b72031a3d8f8eb (diff)
downloadprofani-tty-af467928711057ef9d13d17f88576d24d44d4ee5.tar.gz
Moved XMPP logging to jabber.c
-rw-r--r--jabber.c16
-rw-r--r--log.c17
-rw-r--r--log.h1
3 files changed, 16 insertions, 18 deletions
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 <stdio.h>
-#include <strophe/strophe.h>
 
 #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);