aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-02-17 00:38:21 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-17 01:47:13 +0800
commit37aabc6b1e5b97747da6bb1b3070fa2fdaffa530 (patch)
tree1f37308a4e39967ca2d970f7e7fe5c6b8295d107 /src
parentfd49fd64d74d56ae4e1cf514edfb1aec348832a4 (diff)
downloadgsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar.gz
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar.bz2
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar.lz
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar.xz
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.tar.zst
gsoc2013-empathy-37aabc6b1e5b97747da6bb1b3070fa2fdaffa530.zip
Use TpDebugSender to publish debug messages (#607330)
Diffstat (limited to 'src')
-rw-r--r--src/empathy-debug-window.c27
-rw-r--r--src/empathy.c41
2 files changed, 26 insertions, 42 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index da2c0e079..b8b34b273 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -34,6 +34,7 @@
#include <libempathy-gtk/empathy-geometry.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
#include <telepathy-glib/proxy-subclass.h>
@@ -115,22 +116,22 @@ log_level_to_string (guint level)
{
switch (level)
{
- case EMP_DEBUG_LEVEL_ERROR:
+ case TP_DEBUG_LEVEL_ERROR:
return "Error";
break;
- case EMP_DEBUG_LEVEL_CRITICAL:
+ case TP_DEBUG_LEVEL_CRITICAL:
return "Critical";
break;
- case EMP_DEBUG_LEVEL_WARNING:
+ case TP_DEBUG_LEVEL_WARNING:
return "Warning";
break;
- case EMP_DEBUG_LEVEL_MESSAGE:
+ case TP_DEBUG_LEVEL_MESSAGE:
return "Message";
break;
- case EMP_DEBUG_LEVEL_INFO:
+ case TP_DEBUG_LEVEL_INFO:
return "Info";
break;
- case EMP_DEBUG_LEVEL_DEBUG:
+ case TP_DEBUG_LEVEL_DEBUG:
return "Debug";
break;
default:
@@ -281,7 +282,7 @@ debug_window_set_enabled (EmpathyDebugWindow *debug_window,
val = tp_g_value_slice_new_boolean (enabled);
- tp_cli_dbus_properties_call_set (priv->proxy, -1, EMP_IFACE_DEBUG,
+ tp_cli_dbus_properties_call_set (priv->proxy, -1, TP_IFACE_DEBUG,
"Enabled", val, NULL, NULL, NULL, NULL);
tp_g_value_slice_free (val);
@@ -1297,37 +1298,37 @@ debug_window_constructor (GType type,
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Debug"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_DEBUG,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_DEBUG,
-1);
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Info"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_INFO,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_INFO,
-1);
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Message"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_MESSAGE,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_MESSAGE,
-1);
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Warning"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_WARNING,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_WARNING,
-1);
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Critical"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_CRITICAL,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_CRITICAL,
-1);
gtk_list_store_append (level_store, &iter);
gtk_list_store_set (level_store, &iter,
COL_LEVEL_NAME, _("Error"),
- COL_LEVEL_VALUE, EMP_DEBUG_LEVEL_ERROR,
+ COL_LEVEL_VALUE, TP_DEBUG_LEVEL_ERROR,
-1);
gtk_combo_box_set_active (GTK_COMBO_BOX (priv->level_filter), 0);
diff --git a/src/empathy.c b/src/empathy.c
index be95d6dd0..33c05dc81 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -39,6 +39,7 @@
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/debug-sender.h>
#include <telepathy-glib/util.h>
#include <telepathy-glib/connection-manager.h>
#include <telepathy-glib/interfaces.h>
@@ -50,7 +51,6 @@
#include <libempathy/empathy-account-settings.h>
#include <libempathy/empathy-connectivity.h>
#include <libempathy/empathy-connection-managers.h>
-#include <libempathy/empathy-debugger.h>
#include <libempathy/empathy-dispatcher.h>
#include <libempathy/empathy-dispatch-operation.h>
#include <libempathy/empathy-log-manager.h>
@@ -341,32 +341,6 @@ new_call_handler_cb (EmpathyCallFactory *factory,
gtk_widget_show (GTK_WIDGET (window));
}
-#ifdef ENABLE_DEBUG
-static void
-default_log_handler (const gchar *log_domain,
- GLogLevelFlags log_level,
- const gchar *message,
- gpointer user_data)
-{
- g_log_default_handler (log_domain, log_level, message, NULL);
-
- /* G_LOG_DOMAIN = "empathy". No need to send empathy messages to the
- * debugger as they already have in empathy_debug. */
- if (log_level != G_LOG_LEVEL_DEBUG
- || tp_strdiff (log_domain, G_LOG_DOMAIN))
- {
- EmpathyDebugger *dbg;
- GTimeVal now;
-
- dbg = empathy_debugger_get_singleton ();
- g_get_current_time (&now);
-
- empathy_debugger_add_message (dbg, &now, log_domain,
- log_level, message);
- }
-}
-#endif /* ENABLE_DEBUG */
-
static void
account_manager_ready_cb (GObject *source_object,
GAsyncResult *result,
@@ -598,6 +572,10 @@ main (int argc, char *argv[])
UniqueApp *unique_app;
gboolean chatroom_manager_ready;
+#ifdef ENABLE_DEBUG
+ TpDebugSender *debug_sender;
+#endif
+
GOptionContext *optcontext;
GOptionEntry options[] = {
{ "no-connect", 'n',
@@ -647,8 +625,9 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
#ifdef ENABLE_DEBUG
- /* Set up debugger */
- g_log_set_default_handler (default_log_handler, NULL);
+ /* Set up debug sender */
+ debug_sender = tp_debug_sender_dup ();
+ g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN);
#endif
unique_app = unique_app_new_with_commands ("org.gnome.Empathy",
@@ -763,6 +742,10 @@ main (int argc, char *argv[])
empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
+#ifdef ENABLE_DEBUG
+ g_object_unref (debug_sender);
+#endif
+
g_object_unref (idle);
g_object_unref (connectivity);
g_object_unref (icon);