]> www.fi.muni.cz Git - evince.git/commitdiff
[daemon] Add some debug logging to the daemon
authorChristian Persch <chpe@gnome.org>
Mon, 10 May 2010 12:40:17 +0000 (14:40 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 25 May 2010 07:38:30 +0000 (09:38 +0200)
shell/ev-daemon.c

index 9aed23e1d73788a03311f82f5b2e0674be33711a..b304dfca09e859b3c2a51ecc44eddb5c899a22b2 100644 (file)
@@ -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,