diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-09-10 18:28:22 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-09-10 18:28:22 +0100 |
commit | 6614dda6bfba2c62ec68ac3952cc0d56ed90edb4 (patch) | |
tree | d4de39394f207891b078acfda77cef579a1f784f /server | |
parent | 2179153d64ce7dfd6b0e90f66d3394fbd46f98ba (diff) |
mc-server: use a TpDebugSender, to log everything over D-Bus if enabled
This isn't in the library, so other things that link
libmissioncontrol-server (mainly osso-mission-control on Maemo) won't
automatically have a TpDebugSender.
Diffstat (limited to 'server')
-rw-r--r-- | server/mc-server.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/mc-server.c b/server/mc-server.c index fa7d813d..22151a27 100644 --- a/server/mc-server.c +++ b/server/mc-server.c @@ -27,9 +27,11 @@ #include <glib.h> #include <telepathy-glib/debug.h> +#include <telepathy-glib/debug-sender.h> #include "mcd-service.h" +static TpDebugSender *debug_sender; static void on_abort (McdService * mcd) @@ -50,6 +52,20 @@ main (int argc, char **argv) g_type_init (); + /* Keep a ref to the default TpDebugSender for the lifetime of the + * McdMaster, so it will persist for the lifetime of MC, and subsequent + * calls to tp_debug_sender_dup() will return it again */ + debug_sender = tp_debug_sender_dup (); + + /* Send all debug messages through the Telepathy infrastructure. + * + * Unlike CMs, we don't have "subdomains" within MC yet, so we don't want + * to exclude any domains. However, telepathy-glib 0.7.36 doesn't handle + * exclude=NULL correctly; use a dummy non-NULL argument until a release + * fixes fd.o#23843. */ + g_log_set_default_handler (tp_debug_sender_log_handler, + "<all the domains please>"); + mcd_debug_init (); tp_debug_set_flags (g_getenv ("MC_TP_DEBUG")); @@ -63,5 +79,10 @@ main (int argc, char **argv) mcd_service_run (MCD_OBJECT (mcd)); + if (debug_sender != NULL) + { + g_object_unref (debug_sender); + } + return 0; } |