summaryrefslogtreecommitdiff
path: root/src/telepathy-rakia.c
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2011-03-04 17:48:49 +0200
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2011-03-04 17:48:49 +0200
commitfab41a3131b35a6ee3f56c587969aa57d225cf2c (patch)
treea14834aed966b315f65cdd5b4d2b6771625afc14 /src/telepathy-rakia.c
parent8ad2d857bb1012048003d24cfe6e5345ba7d82c3 (diff)
Consolidated initialization and shutdown of logging
The initialization and teardown of the debug sender and logging infra is moved to the main function of telepathy-rakia. The Sofia log override is now only exposed as the log handler itself. NOTE: API changes in rakia/debug.h
Diffstat (limited to 'src/telepathy-rakia.c')
-rw-r--r--src/telepathy-rakia.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/telepathy-rakia.c b/src/telepathy-rakia.c
index 76dffe7..e0f3870 100644
--- a/src/telepathy-rakia.c
+++ b/src/telepathy-rakia.c
@@ -31,6 +31,10 @@
#include "sip-connection-manager.h"
#include <telepathy-glib/run.h>
#include <telepathy-glib/debug.h>
+#include <telepathy-glib/debug-sender.h>
+
+#include <rakia/sofia-decls.h>
+#include <sofia-sip/su_log.h>
static TpBaseConnectionManager *
construct_cm (void)
@@ -44,7 +48,7 @@ int
main (int argc, char** argv)
{
int status;
- gpointer logdata;
+ TpDebugSender *debug_sender;
guint fatal_mask;
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
@@ -62,12 +66,17 @@ main (int argc, char** argv)
tp_debug_divert_messages (g_getenv ("TPSIP_LOGFILE"));
- logdata = rakia_sofia_log_init ();
+ debug_sender = tp_debug_sender_dup ();
+ g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN);
+
+ su_log_redirect (NULL, rakia_sofia_log_handler, NULL);
status = tp_run_connection_manager ("telepathy-rakia", VERSION,
construct_cm, argc, argv);
- rakia_sofia_log_finalize (logdata);
+ rakia_debug_free ();
+
+ g_object_unref (debug_sender);
return status;
}