[gnome-online-accounts/gnome-3-16] daemon: Timestamp the EnsureCredentials logs and shorten their length



commit 0541e139ddd3ac76531bd5d420850d1d1abf7ca1
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 27 15:29:49 2015 +0100

    daemon: Timestamp the EnsureCredentials logs and shorten their length
    
    The "for account" bit was redundant. Shortening the strings makes it
    easier to follow the logs and the timestamps can be useful if there are
    any delays or time outs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751524

 src/daemon/goadaemon.c |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 0c8146b..5e7688d 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -1177,6 +1177,7 @@ ensure_credentials_queue_complete (GList *invocations, GoaAccount *account, gint
   GList *l;
   const gchar *id;
   const gchar *provider_type;
+  gint64 timestamp;
 
   for (l = invocations; l != NULL; l = l->next)
     {
@@ -1193,7 +1194,8 @@ ensure_credentials_queue_complete (GList *invocations, GoaAccount *account, gint
 
   id = goa_account_get_id (account);
   provider_type = goa_account_get_provider_type (account);
-  g_debug ("Handled EnsureCredentials for account (%s, %s)", provider_type, id);
+  timestamp = g_get_monotonic_time ();
+  g_debug ("%" G_GINT64_FORMAT ": Handled EnsureCredentials (%s, %s)", timestamp, provider_type, id);
 }
 
 static void
@@ -1274,6 +1276,7 @@ ensure_credentials_queue_check (GoaDaemon *self)
   GTask *task;
   const gchar *id;
   const gchar *provider_type;
+  gint64 timestamp;
 
   if (self->ensure_credentials_running)
     goto out;
@@ -1291,7 +1294,8 @@ ensure_credentials_queue_check (GoaDaemon *self)
 
   id = goa_account_get_id (account);
   provider_type = goa_account_get_provider_type (account);
-  g_debug ("Handling EnsureCredentials for account (%s, %s)", provider_type, id);
+  timestamp = g_get_monotonic_time ();
+  g_debug ("%" G_GINT64_FORMAT ": Handling EnsureCredentials (%s, %s)", timestamp, provider_type, id);
 
   provider = goa_provider_get_for_provider_type (provider_type);
   g_assert_nonnull (provider);
@@ -1361,11 +1365,13 @@ on_account_handle_ensure_credentials (GoaAccount            *account,
   const gchar *id;
   const gchar *method_name;
   const gchar *provider_type;
+  gint64 timestamp;
 
   id = goa_account_get_id (account);
   provider_type = goa_account_get_provider_type (account);
   method_name = g_dbus_method_invocation_get_method_name (invocation);
-  g_debug ("Received %s for account (%s, %s)", method_name, provider_type, id);
+  timestamp = g_get_monotonic_time ();
+  g_debug ("%" G_GINT64_FORMAT ": Received %s (%s, %s)", timestamp, method_name, provider_type, id);
 
   provider = goa_provider_get_for_provider_type (provider_type);
   if (provider == NULL)
@@ -1382,7 +1388,12 @@ on_account_handle_ensure_credentials (GoaAccount            *account,
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (account)));
   if (ensure_credentials_queue_coalesce (self, object, invocation))
     {
-      g_debug ("Coalesced %s for account (%s, %s)", method_name, provider_type, id);
+      timestamp = g_get_monotonic_time ();
+      g_debug ("%" G_GINT64_FORMAT ": Coalesced %s (%s, %s)",
+               timestamp,
+               method_name,
+               provider_type,
+               id);
       goto out;
     }
 
@@ -1425,6 +1436,7 @@ goa_daemon_check_credentials (GoaDaemon *self)
       GTask *task = NULL;
       const gchar *id;
       const gchar *provider_type;
+      gint64 timestamp;
 
       account = goa_object_peek_account (object);
       if (account == NULL)
@@ -1437,11 +1449,19 @@ goa_daemon_check_credentials (GoaDaemon *self)
 
       id = goa_account_get_id (account);
       provider_type = goa_account_get_provider_type (account);
-      g_debug ("Calling EnsureCredentials for account (%s, %s)", provider_type, id);
+      timestamp = g_get_monotonic_time ();
+      g_debug ("%" G_GINT64_FORMAT ": Calling EnsureCredentials (%s, %s)",
+               timestamp,
+               provider_type,
+               id);
 
       if (ensure_credentials_queue_coalesce (self, object, NULL))
         {
-          g_debug ("Coalesced EnsureCredentials for account (%s, %s)", provider_type, id);
+          timestamp = g_get_monotonic_time ();
+          g_debug ("%" G_GINT64_FORMAT ": Coalesced EnsureCredentials (%s, %s)",
+                   timestamp,
+                   provider_type,
+                   id);
           continue;
         }
 


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