[evolution-mapi] Allow debugging of an account Authenticate process



commit 4ca0c786893a832158387e55c55fca389f2aa0e1
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 25 16:21:34 2013 +0100

    Allow debugging of an account Authenticate process
    
    Debugging was enabled only for the profile's load mapi contexts, not for all,
    thus for example accounts' validation didn't print debug info on console.
    Setting debugging for each mapi context makes this work better.

 src/libexchangemapi/e-mapi-connection.c |    8 --------
 src/libexchangemapi/e-mapi-utils.c      |    7 +++++++
 2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/libexchangemapi/e-mapi-connection.c b/src/libexchangemapi/e-mapi-connection.c
index 0f9aa4d..a67a11c 100644
--- a/src/libexchangemapi/e-mapi-connection.c
+++ b/src/libexchangemapi/e-mapi-connection.c
@@ -6818,7 +6818,6 @@ mapi_profile_load (ESourceRegistry *registry,
        enum MAPISTATUS ms = MAPI_E_SUCCESS;
        struct mapi_session *session = NULL;
        struct mapi_profile *profile;
-       guint32 debug_log_level = 0;
 
        e_return_val_mapi_error_if_fail (mapi_ctx != NULL, MAPI_E_INVALID_PARAMETER, NULL);
        e_return_val_mapi_error_if_fail (profname != NULL, MAPI_E_INVALID_PARAMETER, NULL);
@@ -6828,13 +6827,6 @@ mapi_profile_load (ESourceRegistry *registry,
 
        e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
-       /* Initialize libmapi logger*/
-       if (g_getenv ("LIBMAPI_DEBUG")) {
-               debug_log_level = atoi (g_getenv ("LIBMAPI_DEBUG"));
-               SetMAPIDumpData (mapi_ctx, TRUE);
-               SetMAPIDebugLevel (mapi_ctx, debug_log_level);
-       }
-
        profile = talloc_zero (mapi_ctx, struct mapi_profile);
        if (MAPI_E_SUCCESS == OpenProfile (mapi_ctx, profile, profname, NULL)) {
                if (!can_reach_mapi_server (profile->server, cancellable, perror)) {
diff --git a/src/libexchangemapi/e-mapi-utils.c b/src/libexchangemapi/e-mapi-utils.c
index d1cc052..de79e05 100644
--- a/src/libexchangemapi/e-mapi-utils.c
+++ b/src/libexchangemapi/e-mapi-utils.c
@@ -1141,6 +1141,13 @@ e_mapi_utils_create_mapi_context (struct mapi_context **mapi_ctx, GError **perro
 
        g_free (profpath);
 
+       /* Initialize libmapi logger */
+       if (*mapi_ctx && g_getenv ("LIBMAPI_DEBUG")) {
+               guint32 debug_log_level = atoi (g_getenv ("LIBMAPI_DEBUG"));
+               SetMAPIDumpData (*mapi_ctx, TRUE);
+               SetMAPIDebugLevel (*mapi_ctx, debug_log_level);
+       }
+
        e_mapi_utils_global_unlock ();
 
        return TRUE;


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