[evince] [daemon] Add some debug logging to the daemon



commit c4589297f7b7f7813c9b3e62ef678dfa5a5f5190
Author: Christian Persch <chpe gnome org>
Date:   Mon May 10 14:40:17 2010 +0200

    [daemon] Add some debug logging to the daemon

 shell/ev-daemon.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/shell/ev-daemon.c b/shell/ev-daemon.c
index 9aed23e..b304dfc 100644
--- a/shell/ev-daemon.c
+++ b/shell/ev-daemon.c
@@ -37,6 +37,8 @@
 
 #define DAEMON_TIMEOUT (30) /* seconds */
 
+#define LOG g_printerr
+
 static GList *ev_daemon_docs = NULL;
 static guint kill_timer_id;
 
@@ -88,6 +90,8 @@ ev_daemon_shutdown (gpointer user_data)
 {
         GMainLoop *loop = (GMainLoop *) user_data;
 
+        LOG ("Timeout; exiting daemon.\n");
+
         if (g_main_loop_is_running (loop))
                 g_main_loop_quit (loop);
 
@@ -264,7 +268,10 @@ method_call_cb (GDBusConnection       *connection,
                                                           name_vanished_cb,
                                                           user_data, NULL);
 
+                        LOG ("RegisterDocument registered owner '%s' for URI '%s'\n", doc->dbus_name, uri);
                         ev_daemon_docs = g_list_prepend (ev_daemon_docs, doc);
+                } else {
+                        LOG ("RegisterDocument found owner '%s' for URI '%s'\n", doc->dbus_name, uri);
                 }
 
                 g_dbus_method_invocation_return_value (invocation,
@@ -277,8 +284,11 @@ method_call_cb (GDBusConnection       *connection,
 
                 g_variant_get (parameters, "(&s)", &uri);
 
+                LOG ("UnregisterDocument URI '%s'\n", uri);
+
                 doc = ev_daemon_find_doc (uri);
                 if (doc == NULL) {
+                        LOG ("UnregisterDocument URI was not registered!\n");
                         g_dbus_method_invocation_return_error_literal (invocation,
                                                                        G_DBUS_ERROR,
                                                                        G_DBUS_ERROR_INVALID_ARGS,
@@ -287,6 +297,9 @@ method_call_cb (GDBusConnection       *connection,
                 }
 
                 if (strcmp (doc->dbus_name, sender) != 0) {
+                        LOG ("UnregisterDocument called by non-owner (owner '%s' sender '%s')\n",
+                             doc->dbus_name, sender);
+
                         g_dbus_method_invocation_return_error_literal (invocation,
                                                                        G_DBUS_ERROR,
                                                                        G_DBUS_ERROR_BAD_ADDRESS,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]