[gnome-online-accounts/gnome--3-18: 2/2] Sprinkle some debug messages when handling D-Bus calls



commit 2abfd7b176c55ccb8ac7fd17b3b82742a6bc5561
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Oct 27 18:09:33 2015 +0100

    Sprinkle some debug messages when handling D-Bus calls

 src/daemon/goadaemon.c               |   15 ++++++++++++---
 src/goabackend/goaexchangeprovider.c |   11 ++++++++++-
 src/goabackend/goaimapsmtpprovider.c |   11 ++++++++++-
 src/goabackend/goakerberosprovider.c |   10 +++++++++-
 src/goabackend/goaoauth2provider.c   |   11 ++++++++++-
 src/goabackend/goaoauthprovider.c    |   11 ++++++++++-
 src/goabackend/goaowncloudprovider.c |   11 ++++++++++-
 7 files changed, 71 insertions(+), 9 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index fe62d1e..d9410ec 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -1228,17 +1228,26 @@ on_account_handle_ensure_credentials (GoaAccount            *account,
   GoaDaemon *self = GOA_DAEMON (user_data);
   GoaProvider *provider = NULL;
   GoaObject *object;
+  const gchar *id;
+  const gchar *method_name;
+  const gchar *provider_type;
+
+  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 ("Handling %s for account (%s, %s)", method_name, provider_type, id);
 
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (account)));
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+  provider = goa_provider_get_for_provider_type (provider_type);
+
   if (provider == NULL)
     {
       g_dbus_method_invocation_return_error (invocation,
                                              GOA_ERROR,
                                              GOA_ERROR_FAILED,
                                              "Unsupported account type %s for id %s (no provider)",
-                                             goa_account_get_provider_type (account),
-                                             goa_account_get_id (account));
+                                             provider_type,
+                                             id);
       goto out;
     }
 
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 466cade..05c34b8 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -953,7 +953,10 @@ on_handle_get_password (GoaPasswordBased      *interface,
   GoaProvider *provider;
   GError *error;
   GVariant *credentials;
+  const gchar *account_id;
   const gchar *identity;
+  const gchar *method_name;
+  const gchar *provider_type;
   gchar *password;
 
   /* TODO: maybe log what app is requesting access */
@@ -964,7 +967,13 @@ on_handle_get_password (GoaPasswordBased      *interface,
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
   identity = goa_account_get_identity (account);
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+
+  account_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 ("Handling %s for account (%s, %s)", method_name, provider_type, account_id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
 
   error = NULL;
   credentials = goa_utils_lookup_credentials_sync (provider,
diff --git a/src/goabackend/goaimapsmtpprovider.c b/src/goabackend/goaimapsmtpprovider.c
index 93c3bb8..4770741 100644
--- a/src/goabackend/goaimapsmtpprovider.c
+++ b/src/goabackend/goaimapsmtpprovider.c
@@ -1600,7 +1600,10 @@ on_handle_get_password (GoaPasswordBased      *interface,
   GoaProvider *provider;
   GError *error;
   GVariant *credentials;
+  const gchar *account_id;
   const gchar *identity;
+  const gchar *method_name;
+  const gchar *provider_type;
   gchar *password;
 
   /* TODO: maybe log what app is requesting access */
@@ -1611,7 +1614,13 @@ on_handle_get_password (GoaPasswordBased      *interface,
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
   identity = goa_account_get_identity (account);
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+
+  account_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 ("Handling %s for account (%s, %s)", method_name, provider_type, account_id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
 
   error = NULL;
   credentials = goa_utils_lookup_credentials_sync (provider,
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 26b105f..26b008e 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -385,11 +385,19 @@ on_handle_get_ticket (GoaTicketing          *interface,
   GoaProvider *provider;
   GError *error;
   gboolean got_ticket;
+  const gchar *id;
+  const gchar *method_name;
+  const gchar *provider_type;
 
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
 
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+  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 ("Handling %s for account (%s, %s)", method_name, provider_type, id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
   error = NULL;
   got_ticket = get_ticket_sync (GOA_KERBEROS_PROVIDER (provider),
                                 object,
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index 06c0785..db086da 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -1725,6 +1725,9 @@ on_handle_get_access_token (GoaOAuth2Based        *interface,
   GoaAccount *account;
   GoaProvider *provider;
   GError *error;
+  const gchar *id;
+  const gchar *method_name;
+  const gchar *provider_type;
   gchar *access_token;
   gint access_token_expires_in;
 
@@ -1734,7 +1737,13 @@ on_handle_get_access_token (GoaOAuth2Based        *interface,
 
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+
+  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 ("Handling %s for account (%s, %s)", method_name, provider_type, id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
 
   error = NULL;
   access_token = goa_oauth2_provider_get_access_token_sync (GOA_OAUTH2_PROVIDER (provider),
diff --git a/src/goabackend/goaoauthprovider.c b/src/goabackend/goaoauthprovider.c
index db949db..47e2711 100644
--- a/src/goabackend/goaoauthprovider.c
+++ b/src/goabackend/goaoauthprovider.c
@@ -1659,6 +1659,9 @@ on_handle_get_access_token (GoaOAuthBased         *interface,
   GoaAccount *account;
   GoaProvider *provider;
   GError *error;
+  const gchar *id;
+  const gchar *method_name;
+  const gchar *provider_type;
   gchar *access_token;
   gchar *access_token_secret;
   gint access_token_expires_in;
@@ -1670,7 +1673,13 @@ on_handle_get_access_token (GoaOAuthBased         *interface,
 
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+
+  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 ("Handling %s for account (%s, %s)", method_name, provider_type, id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
 
   error = NULL;
   access_token = goa_oauth_provider_get_access_token_sync (GOA_OAUTH_PROVIDER (provider),
diff --git a/src/goabackend/goaowncloudprovider.c b/src/goabackend/goaowncloudprovider.c
index 05a98ad..2eeb09b 100644
--- a/src/goabackend/goaowncloudprovider.c
+++ b/src/goabackend/goaowncloudprovider.c
@@ -1104,7 +1104,10 @@ on_handle_get_password (GoaPasswordBased      *interface,
   GoaProvider *provider;
   GError *error;
   GVariant *credentials;
+  const gchar *account_id;
   const gchar *identity;
+  const gchar *method_name;
+  const gchar *provider_type;
   gchar *password;
 
   /* TODO: maybe log what app is requesting access */
@@ -1115,7 +1118,13 @@ on_handle_get_password (GoaPasswordBased      *interface,
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (interface)));
   account = goa_object_peek_account (object);
   identity = goa_account_get_identity (account);
-  provider = goa_provider_get_for_provider_type (goa_account_get_provider_type (account));
+
+  account_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 ("Handling %s for account (%s, %s)", method_name, provider_type, account_id);
+
+  provider = goa_provider_get_for_provider_type (provider_type);
 
   error = NULL;
   credentials = goa_utils_lookup_credentials_sync (provider,


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