]> git.sur5r.net Git - openldap/commitdiff
example client using new logging
authorGary Williams <gwilliams@openldap.org>
Thu, 12 Oct 2000 20:13:20 +0000 (20:13 +0000)
committerGary Williams <gwilliams@openldap.org>
Thu, 12 Oct 2000 20:13:20 +0000 (20:13 +0000)
clients/tools/ldapsearch.c

index 13a786b2481c75b61f18d7b7fe27aadbd6774f57..c4432f67e99d0f8102e8e153c20ed10434f82993 100644 (file)
@@ -165,6 +165,7 @@ main( int argc, char **argv )
 {
        char            *infile, *filtpattern, **attrs = NULL, line[BUFSIZ];
        FILE            *fp = NULL;
+       FILE            *log = NULL;
        int                     rc, i, first, scope, deref, attrsonly, manageDSAit;
        int                     referrals, timelimit, sizelimit, debug;
        int             authmethod, version, want_bindpw;
@@ -174,6 +175,11 @@ main( int argc, char **argv )
        debug = verbose = not = vals2tmp = referrals =
                attrsonly = manageDSAit = ldif = want_bindpw = 0;
 
+       lutil_log_initialize(argc, argv);
+       lutil_set_debug_level( "LIBLBER", 8 );
+       /* log = fopen( "ldapsearch.log", "w" ); */
+       /* ber_set_option( NULL, LBER_OPT_LOG_PRINT_FILE, log ); */
+
        deref = sizelimit = timelimit = version = -1;
 
        scope = LDAP_SCOPE_SUBTREE;
@@ -728,6 +734,7 @@ main( int argc, char **argv )
                return EXIT_FAILURE;
        }
 
+
        if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
                if ( use_tls > 1 ) {
                        ldap_perror( ld, "ldap_start_tls" );