Make LDAP use log_print instead of log_message for uninteresting stuff.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 3 Mar 2018 17:05:52 +0000 (18:05 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 3 Mar 2018 17:05:52 +0000 (18:05 +0100)
This makes it less noisy on the console without --debug if
everything works OK.

src/ldapquery.c
src/ldapserver.c
src/ldaputil.c

index 7f0d293..b132989 100644 (file)
@@ -746,7 +746,7 @@ static gint ldapqry_disconnect( LdapQuery *qry ) {
                        log_error(LOG_PROTOCOL, _("LDAP error (unbind): %d (%s)\n"),
                                        rc, ldaputil_get_error(qry->ldap));
                } else {
-                       log_message(LOG_PROTOCOL, _("LDAP (unbind): successful\n"));
+                       log_print(LOG_PROTOCOL, _("LDAP (unbind): successful\n"));
                }
        }
        qry->ldap = NULL;
@@ -821,11 +821,11 @@ static gint ldapqry_search_retrieve( LdapQuery *qry ) {
                searchFlag = TRUE;
        }
        else if( rc == LDAP_SUCCESS ) {
-               log_message(LOG_PROTOCOL, _("LDAP (search): successful\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (search): successful\n"));
                searchFlag = TRUE;
        }
        else if( rc == LDAP_PARTIAL_RESULTS || (result && ldap_count_entries(ld, result) > 0) ) {
-               log_message(LOG_PROTOCOL, _("LDAP (search): successful (partial results)\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (search): successful (partial results)\n"));
                searchFlag = TRUE;
        }
        else {
@@ -1236,7 +1236,7 @@ static gint ldapqry_locate_retrieve( LdapQuery *qry ) {
                                rc, ldaputil_get_error(ld));
                return ADDRQUERY_RETVAL(qry);
        } else {
-               log_message(LOG_PROTOCOL, _("LDAP (search): successful\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (search): successful\n"));
        }
 
 #ifdef G_OS_WIN32
index a05c07c..831dd48 100644 (file)
@@ -758,7 +758,6 @@ PFldap_start_tls_s Win32_ldap_start_tls_s = NULL;
 LDAP *ldapsvr_connect(LdapControl *ctl) {
        LDAP *ld = NULL;
        gint rc;
-       gint op;
        gint version;
        gchar *uri = NULL;
        gchar *pwd;
@@ -780,7 +779,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
                rc = ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, (void *)&version);
                if (rc == LDAP_SUCCESS) {
                        ctl->version = LDAP_VERSION3;
-                       log_message(LOG_PROTOCOL, "LDAP (options): set version 3\n");
+                       log_print(LOG_PROTOCOL, "LDAP (options): set version 3\n");
                } else {
                        log_error(LOG_PROTOCOL, _("LDAP error (options): %d (%s)\n"),
                                        rc, ldaputil_get_error(ld));
@@ -807,7 +806,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
                                        log_error(LOG_PROTOCOL, _("LDAP error (options): %d (%s)\n"),
                                                        rc, ldaputil_get_error(ld));
                                } else {
-                                       log_message(LOG_PROTOCOL, _("LDAP (options): SSL/TLS enabled (%d)\n"), op);
+                                       log_print(LOG_PROTOCOL, _("LDAP (options): SSL/TLS enabled (%d)\n"), op);
                                }
                                debug_print("SSL/TLS now %d\n", op);
                        }
@@ -818,7 +817,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
                                        rc, ldaputil_get_error(ld));
                        debug_print("ldap_connect failed: %d %s\n", rc, ldaputil_get_error(ld));
                } else {
-                       log_message(LOG_PROTOCOL, _("LDAP (connect): completed successfully\n"));
+                       log_print(LOG_PROTOCOL, _("LDAP (connect): completed successfully\n"));
                }
        }
 #endif
@@ -834,7 +833,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
        rc = ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
        if (rc == LDAP_OPT_SUCCESS) {
                ctl->version = LDAP_VERSION3;
-               log_message(LOG_PROTOCOL, "LDAP (options): set version 3\n");
+               log_print(LOG_PROTOCOL, "LDAP (options): set version 3\n");
        } else {
                log_error(LOG_PROTOCOL, _("LDAP error (options): %d (%s)\n"),
                                rc, ldaputil_get_error(ld));
@@ -869,7 +868,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
                                                rc, ldaputil_get_error(ld));
                                return NULL;
                        } else {
-                               log_message(LOG_PROTOCOL, _("LDAP (TLS): started successfully\n"));
+                               log_print(LOG_PROTOCOL, _("LDAP (TLS): started successfully\n"));
                                debug_print("Done\n");
                        }
                }
@@ -889,7 +888,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
                                                ctl->bindDN, rc, ldaputil_get_error(ld));
                                return NULL;
                        }
-                       log_message(LOG_PROTOCOL, _("LDAP (bind): successfully for DN '%s'\n"),
+                       log_print(LOG_PROTOCOL, _("LDAP (bind): successfully for DN '%s'\n"),
                                        ctl->bindDN);
                }
        }
@@ -909,7 +908,7 @@ void ldapsvr_disconnect(LDAP *ld) {
                log_error(LOG_PROTOCOL, _("LDAP error (unbind): %d (%s)\n"),
                                rc, ldaputil_get_error(ld));
        } else {
-               log_message(LOG_PROTOCOL, _("LDAP (unbind): successful\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (unbind): successful\n"));
        }
 }
 
index 1be1854..983e970 100644 (file)
@@ -78,7 +78,7 @@ static GList *ldaputil_test_v3( LDAP *ld, gint tov, gint *errcode ) {
                attribs, 0, NULL, NULL, &timeout, 0, &result );
 
        if( rc == LDAP_SUCCESS ) {
-               log_message(LOG_PROTOCOL, _("LDAP (search): succesful\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (search): succesful\n"));
                /* Process entries */
                for( e = ldap_first_entry( ld, result );
                     e != NULL;
@@ -153,7 +153,7 @@ static GList *ldaputil_test_v2( LDAP *ld, gint tov ) {
                attribs, 0, NULL, NULL, &timeout, 0, &result );
 
        if( rc == LDAP_SUCCESS ) {
-               log_message(LOG_PROTOCOL, _("LDAP (search): succesful\n"));
+               log_print(LOG_PROTOCOL, _("LDAP (search): succesful\n"));
                /* Process entries */
                for( e = ldap_first_entry( ld, result );
                     e != NULL;