]> git.sur5r.net Git - openldap/commitdiff
Coverted LDAP_LOG macro to use subsystem ID int values instead of string values
authorJulius Enarusai <julius@openldap.org>
Thu, 11 Jul 2002 20:33:24 +0000 (20:33 +0000)
committerJulius Enarusai <julius@openldap.org>
Thu, 11 Jul 2002 20:33:24 +0000 (20:33 +0000)
177 files changed:
clients/tools/ldapmodify.c
include/ldap_log.h
libraries/liblber/Makefile.in
libraries/liblber/decode.c
libraries/liblber/encode.c
libraries/liblber/io.c
libraries/liblber/lber-int.h
libraries/libldap/abandon.c
libraries/libldap/add.c
libraries/libldap/bind.c
libraries/libldap/cache.c
libraries/libldap/compare.c
libraries/libldap/cyrus.c
libraries/libldap/delete.c
libraries/libldap/error.c
libraries/libldap/extended.c
libraries/libldap/filter.c
libraries/libldap/getattr.c
libraries/libldap/getdn.c
libraries/libldap/getfilter.c
libraries/libldap/getvalues.c
libraries/libldap/init.c
libraries/libldap/kbind.c
libraries/libldap/modify.c
libraries/libldap/modrdn.c
libraries/libldap/open.c
libraries/libldap/os-ip.c
libraries/libldap/request.c
libraries/libldap/result.c
libraries/libldap/sasl.c
libraries/libldap/sbind.c
libraries/libldap/search.c
libraries/libldap/tls.c
libraries/libldap/unbind.c
libraries/libldap/url.c
libraries/liblutil/Makefile.in
libraries/liblutil/debug.c
servers/slapd/abandon.c
servers/slapd/acl.c
servers/slapd/add.c
servers/slapd/ava.c
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/attr.c
servers/slapd/back-bdb/attribute.c
servers/slapd/back-bdb/bind.c
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/compare.c
servers/slapd/back-bdb/dbcache.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/dn2entry.c
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/error.c
servers/slapd/back-bdb/filterindex.c
servers/slapd/back-bdb/group.c
servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/index.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/key.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/nextid.c
servers/slapd/back-bdb/operational.c
servers/slapd/back-bdb/passwd.c
servers/slapd/back-bdb/referral.c
servers/slapd/back-bdb/search.c
servers/slapd/back-bdb/tools.c
servers/slapd/back-ldap/add.c
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/compare.c
servers/slapd/back-ldap/delete.c
servers/slapd/back-ldap/group.c
servers/slapd/back-ldap/modify.c
servers/slapd/back-ldap/modrdn.c
servers/slapd/back-ldap/search.c
servers/slapd/back-ldap/suffixmassage.c
servers/slapd/back-ldap/unbind.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/attr.c
servers/slapd/back-ldbm/attribute.c
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/cache.c
servers/slapd/back-ldbm/close.c
servers/slapd/back-ldbm/compare.c
servers/slapd/back-ldbm/config.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/dn2id.c
servers/slapd/back-ldbm/filterindex.c
servers/slapd/back-ldbm/group.c
servers/slapd/back-ldbm/id2children.c
servers/slapd/back-ldbm/id2entry.c
servers/slapd/back-ldbm/idl.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/key.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/nextid.c
servers/slapd/back-ldbm/passwd.c
servers/slapd/back-ldbm/referral.c
servers/slapd/back-ldbm/search.c
servers/slapd/back-ldbm/tools.c
servers/slapd/back-meta/add.c
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/compare.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/delete.c
servers/slapd/back-meta/group.c
servers/slapd/back-meta/modify.c
servers/slapd/back-meta/modrdn.c
servers/slapd/back-meta/search.c
servers/slapd/back-meta/unbind.c
servers/slapd/back-monitor/backend.c
servers/slapd/back-monitor/bind.c
servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/init.c
servers/slapd/back-monitor/listener.c
servers/slapd/back-monitor/log.c
servers/slapd/back-monitor/modify.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-monitor/search.c
servers/slapd/back-monitor/sent.c
servers/slapd/back-monitor/thread.c
servers/slapd/back-monitor/time.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/ch_malloc.c
servers/slapd/compare.c
servers/slapd/config.c
servers/slapd/connection.c
servers/slapd/controls.c
servers/slapd/daemon.c
servers/slapd/delete.c
servers/slapd/dn.c
servers/slapd/entry.c
servers/slapd/extended.c
servers/slapd/filter.c
servers/slapd/filterentry.c
servers/slapd/init.c
servers/slapd/limits.c
servers/slapd/lock.c
servers/slapd/main.c
servers/slapd/matchedValues.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/module.c
servers/slapd/mr.c
servers/slapd/mra.c
servers/slapd/oc.c
servers/slapd/passwd.c
servers/slapd/referral.c
servers/slapd/result.c
servers/slapd/sasl.c
servers/slapd/saslauthz.c
servers/slapd/schema_check.c
servers/slapd/schema_init.c
servers/slapd/schema_prep.c
servers/slapd/search.c
servers/slapd/str2filter.c
servers/slapd/suffixalias.c
servers/slapd/syntax.c
servers/slapd/tools/slapadd.c
servers/slapd/unbind.c
servers/slapd/user.c
servers/slurpd/config.c
servers/slurpd/fm.c
servers/slurpd/ldap_op.c
servers/slurpd/lock.c
servers/slurpd/main.c
servers/slurpd/re.c
servers/slurpd/reject.c
servers/slurpd/replica.c
servers/slurpd/replog.c
servers/slurpd/ri.c
servers/slurpd/rq.c
servers/slurpd/st.c

index 427952c5fa027e43b57a931f692257a0a923287f..a72f6f0a9395cbf0117b72c1a314f0e9b5413131 100644 (file)
@@ -582,10 +582,6 @@ main( int argc, char **argv )
        (void) SIGNAL( SIGPIPE, SIG_IGN );
 #endif
 
-#ifdef NEW_LOGGING
-    lutil_log_initialize( argc, argv );
-#endif
-
     if ( !not ) {
        if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) {
                if ( verbose ) {
index 30f57c418c268304ba8766136d0b3a6f73cdd4d6..500e848d714e7cdcc9d925d83a6a7a31c2e792ac 100644 (file)
@@ -35,21 +35,29 @@ LDAP_BEGIN_DECL
  * reflect the number of subsystems and LDAP_SUBSYS_MAX reflect
  * the largest subsystem number.
  */
-#define LDAP_SUBSYS_NUM 12
-#define LDAP_SUBSYS_MAX 11
+#define LDAP_SUBSYS_NUM 20
+#define LDAP_SUBSYS_MAX 19
 
 #define LDAP_SUBSYS_GLOBAL      0
 #define LDAP_SUBSYS_OPERATION   1
 #define LDAP_SUBSYS_TRANSPORT   2
 #define LDAP_SUBSYS_CONNECTION  3
 #define LDAP_SUBSYS_FILTER      4
-#define LDAP_SUBSYS_BACKEND     5
-#define LDAP_SUBSYS_BER         6
-#define LDAP_SUBSYS_CONFIG      7
-#define LDAP_SUBSYS_ACL         8
-#define LDAP_SUBSYS_CACHE       9
-#define LDAP_SUBSYS_INDEX      10
-#define LDAP_SUBSYS_LDIF       11
+#define LDAP_SUBSYS_BER         5
+#define LDAP_SUBSYS_CONFIG      6
+#define LDAP_SUBSYS_ACL         7
+#define LDAP_SUBSYS_CACHE       8
+#define LDAP_SUBSYS_INDEX              9
+#define LDAP_SUBSYS_LDIF               10
+#define LDAP_SUBSYS_TOOLS              11
+#define LDAP_SUBSYS_SLAPD              12
+#define LDAP_SUBSYS_SLURPD             13
+#define LDAP_SUBSYS_BACKEND     14
+#define LDAP_SUBSYS_BACK_BDB   15
+#define LDAP_SUBSYS_BACK_LDBM  16
+#define LDAP_SUBSYS_BACK_LDAP  17
+#define LDAP_SUBSYS_BACK_META  18
+#define LDAP_SUBSYS_BACK_MON   19
 
 /*
  * debug reporting levels.
@@ -125,27 +133,37 @@ LDAP_BEGIN_DECL
        } while ( 0 )
 #   endif
 
-#ifndef LDAP_LOG
-#   define LDAP_LOG(a) lutil_log a
-#endif
-
 #else /* LDAP_DEBUG */
 #   define Debug( level, fmt, arg1, arg2, arg3 )
 
-#ifndef LDAP_LOG
-#   define LDAP_LOG(a)
-#endif
-
 #endif /* LDAP_DEBUG */
 
+#ifdef NEW_LOGGING
+extern int ldap_loglevels[LDAP_SUBSYS_NUM];
+#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3) do {\
+       if (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
+               ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)\
+                  lutil_log (LDAP_SUBSYS_##a, LDAP_LEVEL_##b, fmt, arg1, arg2, arg3); \
+       } while (0)
+
+
+#define LDAP_LOGS_TEST(a, b) \
+       (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
+        ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)
+
+#endif /* LDAP_LOG */
+
+#ifndef LDAP_LOG
+#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3)
+#endif
 
 LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( const char *level ));
 LDAP_LUTIL_F(void) lutil_log_initialize LDAP_P((
        int argc, char **argv ));
-LDAP_LUTIL_F(void) lutil_set_debug_level LDAP_P((
+LDAP_LUTIL_F(int) lutil_set_debug_level LDAP_P((
        const char *subsys, int level ));
 LDAP_LUTIL_F(void) lutil_log LDAP_P((
-       const char *subsys, int level, const char *fmt, ... ));
+       const int subsys, int level, const char *fmt, ... ));
 
 LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file ));
 
index 4687775b079f5375284ae7cfa3835afe422396a7..416ac6cbf93b93c0f070a22b9ead9ac47a142463 100644 (file)
@@ -12,16 +12,16 @@ NT_OBJS = nt_err.lo
 
 LIB_DEFS = -DLBER_LIBRARY
 
-SRCS= assert.c decode.c encode.c io.c bprint.c \
+SRCS= assert.c decode.c encode.c io.c bprint.c debug.c \
        memory.c options.c sockbuf.c $(@PLAT@_SRCS)
-OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo \
+OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo debug.lo\
        memory.lo options.lo sockbuf.lo $(@PLAT@_OBJS)
 XSRCS= version.c
 
 PROGRAMS= dtest etest idtest
 
-LDAP_INCDIR= ../../include       
-LDAP_LIBDIR= ../../libraries       
+LDAP_INCDIR= ../../include
+LDAP_LIBDIR= ../../libraries
 
 XLIBS = $(LIBRARY)
 XXLIBS = 
index 89e9745ff5ffbac7d11da4ee9bdf6add026090c8..e69bb496fa0673f09e6397519a45dfa8625427dd 100644 (file)
@@ -643,8 +643,10 @@ ber_scanf ( BerElement *ber,
        fmt_reset = fmt;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_scanf fmt (%s) ber:\n", fmt ));
-       BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+       LDAP_LOG( BER, ENTRY, "ber_scanf fmt (%s) ber:\n", fmt, 0, 0 );
+
+       if ( LDAP_LOGS_TEST(BER, DETAIL2 ))
+                       BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
 #else
        ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
                "ber_scanf fmt (%s) ber:\n", fmt );
@@ -796,8 +798,8 @@ ber_scanf ( BerElement *ber,
                default:
                        if( ber->ber_debug ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "liblber", LDAP_LEVEL_ERR,
-                                       "ber_scanf: unknown fmt %c\n", *fmt ));
+                               LDAP_LOG( BER, ERR, 
+                                       "ber_scanf: unknown fmt %c\n", *fmt, 0, 0 );
 #else
                                ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
                                        "ber_scanf: unknown fmt %c\n", *fmt );
index 50eb6b5f9234af5e596f6da5ab4a3c084cada359..fefad6d3ecc6061850a2a800153b940e22118032 100644 (file)
@@ -812,8 +812,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
                default:
                        if( ber->ber_debug ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "liblber", LDAP_LEVEL_ERR,
-                                          "ber_printf: unknown fmt %c\n", *fmt ));
+                               LDAP_LOG( BER, ERR, 
+                                       "ber_printf: unknown fmt %c\n", *fmt, 0, 0 );
 #else
                                ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
                                        "ber_printf: unknown fmt %c\n", *fmt );
index 7003ec297bdcff1c9ae322d32e238ee6a77b2849..4e3a1cebd84ad07bcf6a9e510b9cd39d2caa16ab 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 
 #include "lber-int.h"
+#include "ldap_log.h"
 
 ber_slen_t
 ber_read(
@@ -207,11 +208,14 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
 
        if ( sb->sb_debug ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BER, DETAIL1,
                           "ber_flush: %ld bytes to sd %ld%s\n",
                           towrite, (long)sb->sb_fd,
-                          ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" ));
-               BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+                          ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
+
+               if(LDAP_LOGS_TEST(BER, DETAIL2))
+                               BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+
 #else
                ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug,
                        "ber_flush: %ld bytes to sd %ld%s\n",
@@ -441,7 +445,7 @@ ber_get_next(
        assert( LBER_VALID( ber ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_get_next: enter\n" ));
+       LDAP_LOG( BER, ENTRY, "ber_get_next: enter\n", 0, 0, 0 );
 #else
        ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
                "ber_get_next\n" );
@@ -550,9 +554,9 @@ ber_get_next(
                        return LBER_DEFAULT;
                } else if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "liblber", LDAP_LEVEL_ERR, 
+                       LDAP_LOG( BER, ERR, 
                                "ber_get_next: sockbuf_max_incoming limit hit "
-                               "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming ));
+                               "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming, 0 );
 #else
                        ber_log_printf( LDAP_DEBUG_CONNS, ber->ber_debug,
                                "ber_get_next: sockbuf_max_incoming limit hit "
@@ -618,10 +622,11 @@ done:
                *len = ber->ber_len;
                if ( ber->ber_debug ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1,
-                               "ber_get_next: tag 0x%lx len %ld\n",
-                               ber->ber_tag, ber->ber_len ));
-                       BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+                       LDAP_LOG( BER, DETAIL1, 
+                               "ber_get_next: tag 0x%lx len %ld\n", 
+                               ber->ber_tag, ber->ber_len, 0  );
+                       if(LDAP_LOGS_TEST(BER, DETAIL2))
+                                       BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
 #else
                        ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
                                "ber_get_next: tag 0x%lx len %ld contents:\n",
index 14f02ca555a9d7df24f8ddef18ef103c24d1652d..1d6ad83ba3a2bb841539d4910cd1f5c9b08a2ecb 100644 (file)
@@ -38,16 +38,20 @@ struct lber_options {
 };
 
 #ifdef NEW_LOGGING
+/*
 #    ifdef LDAP_DEBUG
 #        ifdef LDAP_LOG
 #            undef LDAP_LOG
 #        endif
 #        define LDAP_LOG(a) ber_pvt_log_output a
+ */
 #        define BER_DUMP(a) ber_output_dump a
+/*
 #    else
 #        define LDAP_LOG(a)
 #        define BER_DUMP(a)
 #    endif
+ */
 #endif
 
 LBER_F( int ) ber_pvt_log_output(
index 70c2d97e732879709e9beae901f9bc3bed22907a..a88a5865b5a89ab8813b2c49ababf82bd4954ee3 100644 (file)
@@ -58,7 +58,7 @@ ldap_abandon_ext(
 {
        int rc;
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "ldap_abandon_ext %d\n", msgid ));
+       LDAP_LOG ( OPERATION, ARGS, "ldap_abandon_ext %d\n", msgid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_abandon_ext %d\n", msgid, 0, 0 );
 #endif
@@ -86,7 +86,7 @@ int
 ldap_abandon( LDAP *ld, int msgid )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "ldap_abandon %d\n", msgid ));
+       LDAP_LOG ( OPERATION, ARGS, "ldap_abandon %d\n", msgid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_abandon %d\n", msgid, 0, 0 );
 #endif
@@ -110,8 +110,7 @@ do_abandon(
        LDAPRequest     *lr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "do_abandon %d, msgid %d\n", 
-               origid, msgid ));
+       LDAP_LOG ( OPERATION, ARGS, "do_abandon %d, msgid %d\n", origid, msgid, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_abandon origid %d, msgid %d\n",
                origid, msgid, 0 );
index 1ce57eba7f6f95d4fa09a3796ea268aa5f8febf1..20a987e97734bb7d3725a3f8332721be894f051a 100644 (file)
@@ -100,7 +100,7 @@ ldap_add_ext(
        int             i, rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "add", LDAP_LEVEL_ENTRY, "ldap_add_ext\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_add_ext\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 );
 #endif
index 076bd179768d085e85a416848986c6657c6d7c46..4040da1804eb28f9263f31a9d2b68bff17eb3e4e 100644 (file)
@@ -42,7 +42,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
-
+#include "ldap_log.h"
 
 /*
  * ldap_bind - bind to the ldap server (and X.500).  The dn and password
@@ -61,7 +61,7 @@ int
 ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "bind", LDAP_LEVEL_ENTRY, "ldap_bind\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_bind\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 );
 #endif
@@ -110,7 +110,7 @@ ldap_bind_s(
        int authmethod )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "bind", LDAP_LEVEL_ENTRY, "ldap_bind_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_bind_s\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 );
 #endif
index 83e6e7953cbe9b0ff8da07f23f52149eb1999bf9..f071ab6255e02fe9ad97db17f6d3923bddaf5dcf 100644 (file)
@@ -118,7 +118,7 @@ ldap_flush_cache( LDAP *ld )
        assert( LDAP_VALID( ld ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_flush_cache\n" ));
+       LDAP_LOG ( CACHE, ENTRY, "ldap_flush_cache\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_flush_cache\n", 0, 0, 0 );
 #endif
@@ -154,9 +154,9 @@ ldap_uncache_request( LDAP *ld, int msgid )
 
 #ifndef LDAP_NOCACHE
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, 
-               "ldap_uncache_request %d ld_cache %lx\n",
-               msgid, (long) ld->ld_cache ));
+
+       LDAP_LOG ( CACHE, ARGS, "ldap_uncache_request %d ld_cache %lx\n",
+               msgid, (long) ld->ld_cache, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n",
            msgid, (long) ld->ld_cache, 0 );
@@ -176,9 +176,9 @@ ldap_uncache_entry( LDAP *ld, LDAP_CONST char *dn )
 
 #ifndef LDAP_NOCACHE
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, 
-               "ldap_uncache_entry %s ld_cache %lx\n",
-               dn, (long) ld->ld_cache ));
+
+       LDAP_LOG ( CACHE, ARGS, "ldap_uncache_entry %s ld_cache %lx\n",
+               dn, (long) ld->ld_cache, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n",
            dn, (long) ld->ld_cache, 0 );
@@ -200,9 +200,10 @@ uncache_entry_or_req( LDAP *ld,
        LDAPMessage     *m, *prev, *next;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, 
+
+       LDAP_LOG ( CACHE, ARGS, 
                "uncache_entry_or_req dn %s msgid %ld ld_cache %lx\n",
-               dn, (long) msgid, (long) ld->ld_cache ));
+               dn, (long) msgid, (long) ld->ld_cache );
 #else
        Debug( LDAP_DEBUG_TRACE,
            "ldap_uncache_entry_or_req  dn %s  msgid %ld  ld_cache %lx\n",
@@ -266,7 +267,7 @@ ldap_add_request_to_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
        assert( LDAP_VALID( ld ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_add_request_to_cache\n" ));
+       LDAP_LOG ( CACHE, ENTRY, "ldap_add_request_to_cache\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_add_request_to_cache\n", 0, 0, 0 );
 #endif
@@ -318,9 +319,10 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
        assert( result != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, 
+
+       LDAP_LOG ( CACHE, ARGS, 
                "ldap_add_result_to_cache: id %ld, type %ld\n",
-               (long) result->lm_msgid, (long) result->lm_msgtype ));
+               (long) result->lm_msgid, (long) result->lm_msgtype, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %ld, type %ld\n", 
                (long) result->lm_msgid, (long) result->lm_msgtype, 0 );
@@ -329,8 +331,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
        if ( ld->ld_cache == NULL ||
            ( ld->ld_cache->lc_enabled == 0 )) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-               "ldap_add_result_to_cache: cache disabled\n" ));
+               LDAP_LOG ( CACHE, DETAIL1, 
+                       "ldap_add_result_to_cache: cache disabled\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "artc: cache disabled\n", 0, 0, 0 );
 #endif
@@ -345,9 +347,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
                 * only cache search and compare operations
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-               "ldap_add_result_to_cache: "
-               "only caching search & compare operations\n" ));
+               LDAP_LOG ( CACHE, DETAIL1, 
+                       "ldap_add_result_to_cache: only caching search & "
+                       "compare operations\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "artc: only caching search & compare operations\n", 0, 0, 0 );
@@ -376,9 +378,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
                        new->lm_chain = NULL;
                        m->lm_chain = new;
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
+                       LDAP_LOG ( CACHE, RESULTS, 
                                "ldap_add_result_to_cache: "
-                               "result added to cache request chain\n" ));
+                               "result added to cache request chain\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                            "artc: result added to cache request chain\n",
@@ -418,9 +420,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
 
                        if ( !keep ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
+                               LDAP_LOG ( CACHE, RESULTS, 
                                        "ldap_add_result_to_cache: "
-                                       "not caching result with error\n" ));
+                                       "not caching result with error\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                    "artc: not caching result with error %d\n",
@@ -436,9 +438,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
                                ld->ld_cache->lc_memused += msg_size( req );
                                check_cache_memused( ld->ld_cache );
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
+                               LDAP_LOG ( CACHE, RESULTS, 
                                        "ldap_add_result_to_cache: "
-                                       "cached result with error\n" ));
+                                       "cached result with error\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                    "artc: cached result with error %d\n",
@@ -448,9 +450,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
                }
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
-                       "ldap_add_result_to_cache: "
-                       "msgid not in request list\n" ));
+               LDAP_LOG ( CACHE, RESULTS, 
+                       "ldap_add_result_to_cache: msgid not in request list\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n",
                    0, 0, 0 );
@@ -481,7 +482,7 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
        assert( request != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_check_cache\n" ));
+       LDAP_LOG ( CACHE, ENTRY, "ldap_check_cache\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_check_cache\n", 0, 0, 0 );
 #endif
@@ -503,9 +504,9 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
        hash = cache_hash( &reqber );
        for ( m = ld->ld_cache->lc_buckets[ hash ]; m != NULL; m = next ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
+               LDAP_LOG ( CACHE, DETAIL1, 
                        "ldap_check_cache: examining id %ld, type %ld\n",
-                       (long) m->lm_msgid, (long) m->lm_msgtype ));
+                       (long) m->lm_msgid, (long) m->lm_msgtype, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,"cc: examining id %ld,type %ld\n",
                    (long) m->lm_msgid, (long) m->lm_msgtype, 0 );
@@ -519,9 +520,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
                                prev->lm_next = next;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-                               "ldap_check_cache: expired id %ld\n",
-                               (long) m->lm_msgid ));
+                       LDAP_LOG ( CACHE, DETAIL1, "ldap_check_cache: expired id %ld\n",
+                               (long) m->lm_msgid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "cc: expired id %d\n",
                            m->lm_msgid, 0, 0 );
@@ -562,9 +562,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
                }
                prev = new;
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-                       "ldap_check_cache: added type %ld\n",
-                       (long) m->lm_msgtype ));
+               LDAP_LOG ( CACHE, DETAIL1, "ldap_check_cache: added type %ld\n",
+                       (long) m->lm_msgtype, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "cc: added type %ld\n",
                    (long) new->lm_msgtype, 0, 0 );
@@ -572,8 +571,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
-               "ldap_check_cache: result returned from cache\n" ));
+       LDAP_LOG ( CACHE, RESULTS, 
+               "ldap_check_cache: result returned from cache\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 );
 #endif
@@ -603,9 +602,8 @@ cache_hash( BerElement *ber )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, 
-               "cache_hash: len is %ld, returning %ld\n",
-                len, len % LDAP_CACHE_BUCKETS ));
+       LDAP_LOG ( CACHE, RESULTS, "cache_hash: len is %ld, returning %ld\n",
+               len, len % LDAP_CACHE_BUCKETS, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "cache_hash: len is %ld, returning %ld\n",
            len, len % LDAP_CACHE_BUCKETS, 0 );
@@ -760,9 +758,9 @@ check_cache_memused( LDAPCache *lc )
        LDAPMessage     *m, *prev, *next;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
+       LDAP_LOG ( CACHE, DETAIL1, 
                "check_cache_memused: %ld bytes in use (%ld max)\n",
-                lc->lc_memused, lc->lc_maxmem ));
+               lc->lc_memused, lc->lc_maxmem, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "check_cache_memused: %ld bytes in use (%ld max)\n",
            lc->lc_memused, lc->lc_maxmem, 0 );
@@ -789,9 +787,8 @@ check_cache_memused( LDAPCache *lc )
                                        }
                                        lc->lc_memused -= msg_size( m );
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-                                               "check_cache_memused: removed %ld\n",
-                                               m->lm_msgid ));
+                                       LDAP_LOG ( CACHE, DETAIL1, 
+                                               "check_cache_memused: removed %ld\n", m->lm_msgid,0,0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                            "ccm: removed %d\n",
@@ -807,9 +804,9 @@ check_cache_memused( LDAPCache *lc )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, 
-               "check_cache_memused: reduced usage to %ld bytes\n",
-               lc->lc_memused ));
+       LDAP_LOG ( CACHE, DETAIL1, 
+               "check_cache_memused: reduced usage to %ld bytes\n", 
+               lc->lc_memused, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ccm: reduced usage to %ld bytes\n",
            lc->lc_memused, 0, 0 );
index 4af59d01b8d15842a6a5f44db0244028d1a04c66..bb13bcc11f511a673d8a43b51df26c8937b04798 100644 (file)
@@ -29,6 +29,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
+#include "ldap_log.h"
 
 /*
  * ldap_compare_ext - perform an ldap extended compare operation.  The dn
@@ -55,7 +56,7 @@ ldap_compare_ext(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "compare", LDAP_LEVEL_ENTRY, "ldap_compare\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_compare\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 );
 #endif
index f215b752e16616de51068a4d564b663cc2f3564a..5310903c0ea570f59d59c2395ab7139e8bf6399f 100644 (file)
@@ -361,7 +361,7 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = {
 int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cyrus", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_install\n" ));
+       LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_install\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n",
                0, 0, 0 );
@@ -457,8 +457,8 @@ ldap_int_sasl_open(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1
-               "ldap_int_sasl_open: host=%s\n", host ));
+       LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_open: host=%s\n"
+               host, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n",
                host, 0, 0 );
@@ -479,8 +479,8 @@ ldap_int_sasl_open(
                        (void *) &extprops );
 #endif
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, 
-                       "ldap_int_sasl_open: ssf=%ld\n", (long) ssf ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                       "ldap_int_sasl_open: ssf=%ld\n", (long) ssf, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n",
                        (long) ssf, 0, 0 );
@@ -525,8 +525,8 @@ ldap_int_sasl_bind(
        ber_socket_t            sd;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "cyrus", LDAP_LEVEL_ARGS
-                       "ldap_int_sasl_bind: %s\n", mechs ? mechs : "<null>" ));
+       LDAP_LOG ( TRANSPORT, ARGS, "ldap_int_sasl_bind: %s\n"
+               mechs ? mechs : "<null>", 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
                mechs ? mechs : "<null>", 0, 0 );
@@ -637,9 +637,9 @@ ldap_int_sasl_bind(
                        if( scred && scred->bv_len ) {
                                /* and server provided us with data? */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, 
+                               LDAP_LOG ( TRANSPORT, DETAIL1, 
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", 
-                                       rc, saslrc, scred->bv_len ));
+                                       rc, saslrc, scred->bv_len );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
@@ -655,9 +655,9 @@ ldap_int_sasl_bind(
                        if( scred && scred->bv_len ) {
                                /* but server provided us with data! */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, 
+                               LDAP_LOG ( TRANSPORT, DETAIL1, 
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", 
-                                       rc, saslrc, scred->bv_len ));
+                                       rc, saslrc, scred->bv_len );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
@@ -678,8 +678,8 @@ ldap_int_sasl_bind(
                                &credlen );
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc ));
+                               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                                       "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc,0,0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n",
                                saslrc, 0, 0 );
index c91e02e565c61c186ec99670ac8abea154c39a80..e930fc579bae1557744c44f064ab3f167e2d567e 100644 (file)
@@ -49,7 +49,7 @@ ldap_delete_ext(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "delete", LDAP_LEVEL_ENTRY, "ldap_delete_ext\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_delete_ext\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_delete_ext\n", 0, 0, 0 );
 #endif
@@ -139,7 +139,7 @@ ldap_delete( LDAP *ld, LDAP_CONST char *dn )
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "delete", LDAP_LEVEL_ENTRY, "ldap_delete\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_delete\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 );
 #endif
index 3569887747de5e16b2c0d3ecf7f2d87736a1722f..ca2b4268f4d120d4a65375a269b1dd6c59feaa3b 100644 (file)
@@ -147,7 +147,7 @@ ldap_err2string( int err )
        const struct ldaperror *e;
        
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_err2string\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_err2string\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 );
 #endif
@@ -163,7 +163,7 @@ ldap_perror( LDAP *ld, LDAP_CONST char *str )
 {
        const struct ldaperror *e;
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_perror\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_perror\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 );
 #endif
@@ -243,7 +243,7 @@ ldap_parse_result(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_parse_result\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_result\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 );
 #endif
index b0a7ed691a44329f38baf7c434b9db12d00fd5fc..3789720d880d82b92df1cb470adef44aaae2341c 100644 (file)
@@ -30,6 +30,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
+#include "ldap_log.h"
 
 int
 ldap_extended_operation(
@@ -44,7 +45,7 @@ ldap_extended_operation(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_extended_operation\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 );
 #endif
@@ -117,7 +118,7 @@ ldap_extended_operation_s(
     LDAPMessage *res;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_extended_operation_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation_s\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation_s\n", 0, 0, 0 );
 #endif
@@ -173,7 +174,7 @@ ldap_parse_extended_result (
        assert( res != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_parse_extended_result\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_extended_result\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_parse_extended_result\n", 0, 0, 0 );
 #endif
@@ -300,8 +301,7 @@ ldap_parse_extended_partial (
        assert( res != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, 
-               "ldap_parse_extended_partial\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_extended_partial\n", 0,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_parse_extended_partial\n", 0, 0, 0 );
 #endif
index 93a45cd75aa9f6507cb010a07152e314ffb83b0e..259c9a459089dba1a482147aa463f1c82ea06ab7 100644 (file)
@@ -357,8 +357,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, "ldap_pvt_put_filter: \"%s\"\n",
-               str_in ));
+       LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_filter: \"%s\"\n", str_in,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_filter: \"%s\"\n", str_in, 0, 0 );
 #endif
@@ -380,8 +379,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
                        switch ( *str ) {
                        case '&':
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_pvt_put_filter: AND\n" ));
+                               LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: AND\n", 0,0,0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "put_filter: AND\n",
                                    0, 0, 0 );
@@ -399,8 +397,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
 
                        case '|':
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_pvt_put_filter: OR\n" ));
+                               LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: OR\n", 0,0,0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "put_filter: OR\n",
                                    0, 0, 0 );
@@ -418,8 +415,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
 
                        case '!':
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_pvt_put_filter: NOT\n" ));
+                               LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: NOT\n", 0,0,0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "put_filter: NOT\n",
                                    0, 0, 0 );
@@ -437,8 +433,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
 
                        default:
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_pvt_put_filter: simple\n" ));
+                               LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: simple\n", 0,0,0);
 #else
                                Debug( LDAP_DEBUG_TRACE, "put_filter: simple\n",
                                    0, 0, 0 );
@@ -488,8 +483,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
 
                case /*'('*/ ')':
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                               "ldap_pvt_put_filter: end\n" ));
+                       LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: end\n", 0,0,0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "put_filter: end\n",
                                0, 0, 0 );
@@ -508,8 +502,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
 
                default:        /* assume it's a simple type=value filter */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                               "ldap_pvt_put_filter: default\n" ));
+                       LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: default\n", 0,0,0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "put_filter: default\n",
                                0, 0, 0 );
@@ -542,8 +535,7 @@ put_filter_list( BerElement *ber, char *str, ber_tag_t tag )
        char    save;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, 
-                               "put_filter_list \"%s\"\n", str ));
+       LDAP_LOG ( FILTER, ARGS, "put_filter_list \"%s\"\n", str,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n",
                str, 0, 0 );
@@ -587,8 +579,7 @@ put_simple_filter(
        int             rc = -1;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, 
-                               "put_simple_filter: \"%s\"\n", str ));
+       LDAP_LOG ( FILTER, ARGS, "put_simple_filter: \"%s\"\n", str,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_simple_filter: \"%s\"\n",
                str, 0, 0 );
@@ -759,8 +750,7 @@ put_substring_filter( BerElement *ber, char *type, char *val )
        ber_tag_t       ftype = LDAP_FILTER_SUBSTRINGS;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, 
-                               "put_substring_filter \"%s=%s\"\n", type, val ));
+       LDAP_LOG ( FILTER, ARGS, "put_substring_filter \"%s=%s\"\n", type, val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_substring_filter \"%s=%s\"\n",
                type, val, 0 );
@@ -847,8 +837,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, "put_vrFilter: \"%s\"\n",
-               str_in ));
+       LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_vrFilter: \"%s\"\n", 
+               str_in, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_vrFilter: \"%s\"\n", str_in, 0, 0 );
 #endif
@@ -892,8 +882,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
 
                        default:
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                                       "put_vrFilter: simple\n" ));
+                               LDAP_LOG ( FILTER, DETAIL1, 
+                                       "put_vrFilter: simple\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "put_vrFilter: simple\n",
                                    0, 0, 0 );
@@ -943,8 +933,7 @@ put_vrFilter( BerElement *ber, const char *str_in )
 
                case /*'('*/ ')':
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, 
-                               "ldap_pvt_put_filter: end\n" ));
+                       LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: end\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "put_filter: end\n",
                                0, 0, 0 );
@@ -963,8 +952,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
 
                default:        /* assume it's a simple type=value filter */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1
-                               "ldap_pvt_put_filter: default\n" ));
+                       LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: default\n"
+                               0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "put_filter: default\n",
                                0, 0, 0 );
@@ -1011,8 +1000,7 @@ put_vrFilter_list( BerElement *ber, char *str )
        char    save;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, 
-               "put_vrFilter_list \"%s\"\n", str ));
+       LDAP_LOG ( FILTER, ARGS, "put_vrFilter_list \"%s\"\n", str, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_vrFilter_list \"%s\"\n",
                str, 0, 0 );
@@ -1050,8 +1038,7 @@ put_simple_vrFilter(
        int             rc = -1;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, 
-               "put_simple_vrFilter: \"%s\"\n", str ));
+       LDAP_LOG ( FILTER, ARGS, "put_simple_vrFilter: \"%s\"\n", str, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "put_simple_vrFilter: \"%s\"\n",
                str, 0, 0 );
index e5cd6e628d910edf1f09734f212d394b6f7f9bbc..91e37b28351ed993818b83e492a46d00d27d798d 100644 (file)
@@ -31,7 +31,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout )
        BerElement *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getattr", LDAP_LEVEL_ENTRY, "ldap_first_attribute\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_first_attribute\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
 #endif
@@ -97,7 +97,7 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
        char *attr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getattr", LDAP_LEVEL_ENTRY, "ldap_next_attribute\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_next_attribute\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
 #endif
index 43c1b4470b54c571f02cf1b278a67bda52b452e2..781dca07afe6450849247111e1a12ed1e7caf525 100644 (file)
@@ -85,7 +85,7 @@ ldap_get_dn( LDAP *ld, LDAPMessage *entry )
        BerElement      tmp;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_get_dn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_get_dn\n", 0, 0, 0 );
 #endif
@@ -112,7 +112,7 @@ ldap_dn2ufn( LDAP_CONST char *dn )
        char    *out = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2ufn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ufn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 );
 #endif
@@ -135,7 +135,7 @@ ldap_explode_dn( LDAP_CONST char *dn, int notypes )
        unsigned flag = notypes ? LDAP_DN_FORMAT_UFN : LDAP_DN_FORMAT_LDAPV3;
        
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_explode_dn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_dn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_explode_dn\n", 0, 0, 0 );
 #endif
@@ -179,7 +179,7 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes )
        int             iAVA;
        
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_explode_rdn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_rdn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_explode_rdn\n", 0, 0, 0 );
 #endif
@@ -264,7 +264,7 @@ ldap_dn2dcedn( LDAP_CONST char *dn )
        char    *out = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2dcedn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2dcedn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_dn2dcedn\n", 0, 0, 0 );
 #endif
@@ -281,7 +281,7 @@ ldap_dcedn2dn( LDAP_CONST char *dce )
        char    *out = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dcedn2dn\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_dcedn2dn\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_dcedn2dn\n", 0, 0, 0 );
 #endif
@@ -297,7 +297,7 @@ ldap_dn2ad_canonical( LDAP_CONST char *dn )
        char    *out = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2ad_canonical\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ad_canonical\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_dn2ad_canonical\n", 0, 0, 0 );
 #endif
@@ -333,7 +333,7 @@ ldap_dn_normalize( LDAP_CONST char *dnin,
        LDAPDN  *tmpDN = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn_normalize\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_dn_normalize\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_dn_normalize\n", 0, 0, 0 );
 #endif
@@ -660,9 +660,8 @@ ldap_bv2dn( struct berval *bv, LDAPDN **dn, unsigned flags )
        assert( dn );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ARGS, "ldap_bv2dn(%s,%u)\n%s", 
-               str, flags, "" ));
-#elif 0
+       LDAP_LOG ( OPERATION, ARGS, "ldap_bv2dn(%s,%u)\n%s", str, flags, "" );
+#else
        Debug( LDAP_DEBUG_TRACE, "=> ldap_bv2dn(%s,%u)\n%s", str, flags, "" );
 #endif
 
@@ -837,9 +836,9 @@ return_result:;
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_RESULTS, "<= ldap_bv2dn(%s,%u)=%d\n", 
-               str, flags, rc ));
-#elif 0
+       LDAP_LOG ( OPERATION, RESULTS, "<= ldap_bv2dn(%s,%u)=%d\n", 
+               str, flags, rc );
+#else
        Debug( LDAP_DEBUG_TRACE, "<= ldap_bv2dn(%s,%u)=%d\n", str, flags, rc );
 #endif
        *dn = newDN;
@@ -2967,9 +2966,9 @@ int ldap_dn2bv( LDAPDN *dn, struct berval *bv, unsigned flags )
        bv->bv_val = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_ARGS, "=> ldap_dn2bv(%u)\n%s%s", 
-               flags, "", "" ));
-#elif 0
+       LDAP_LOG ( OPERATION, ARGS, "=> ldap_dn2bv(%u)\n%s%s", 
+               flags, "", "" );
+#else
        Debug( LDAP_DEBUG_TRACE, "=> ldap_dn2bv(%u)\n%s%s", flags, "", "" );
 #endif
 
@@ -3279,9 +3278,9 @@ int ldap_dn2bv( LDAPDN *dn, struct berval *bv, unsigned flags )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getdn", LDAP_LEVEL_RESULTS, "<= ldap_dn2bv(%s,%u)=%d\n", 
-               bv->bv_val, flags, rc ));
-#elif 0
+       LDAP_LOG ( OPERATION, RESULTS, "<= ldap_dn2bv(%s,%u)=%d\n", 
+               bv->bv_val, flags, rc );
+#else
        Debug( LDAP_DEBUG_TRACE, "<= ldap_dn2bv(%s,%u)=%d\n",
                bv->bv_val, flags, rc );
 #endif
index d6f62f325504289bc915c5fe5d3ad9e3d0cbf84e..d4d0d4452a045613144a41736b800b4dba5dd1d9 100644 (file)
@@ -79,9 +79,9 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
                regerror(rc, &re, error, sizeof(error));
                ldap_getfilter_free( lfdp );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "getfilter", LDAP_LEVEL_ERR, 
-                       "ldap_init_get_filter_buf: bad regular expression %s, %s\n",
-                       nextflp->lfl_pattern, error ));
+               LDAP_LOG ( FILTER, ERR, 
+                       "ldap_init_get_filter_buf: bad regular expression %s, %s\n", 
+                       nextflp->lfl_pattern, error, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ldap_init_get_filter_buf: "
                        "bad regular expression %s, %s\n",
index bbf16d8c411c3e6b8981527cd216ea12517b8f56..34ee28da563a40a9706cf1aca713aaea49f2dd3d 100644 (file)
@@ -37,7 +37,7 @@ ldap_get_values( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target )
        assert( target != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getvalues", LDAP_LEVEL_ENTRY, "ldap_get_values\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 );
 #endif
@@ -98,7 +98,7 @@ ldap_get_values_len( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target )
        assert( target != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "getvalues", LDAP_LEVEL_ENTRY, "ldap_get_values_len\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values_len\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_get_values_len\n", 0, 0, 0 );
 #endif
index c6b68759823304508494be73f768def571f82827..e7d0648a1f7448cf181791ca519a056d7a8d87f8 100644 (file)
@@ -116,8 +116,8 @@ static void openldap_ldap_init_w_conf(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
-               "openldap_init_w_conf: trying %s\n", file ));
+       LDAP_LOG ( CONFIG, DETAIL1, 
+               "openldap_init_w_conf: trying %s\n", file, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "ldap_init: trying %s\n", file, 0, 0);
 #endif
@@ -129,8 +129,7 @@ static void openldap_ldap_init_w_conf(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
-               "openldap_init_w_conf: using %s\n", file ));
+       LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_conf: using %s\n", file, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "ldap_init: using %s\n", file, 0, 0);
 #endif
@@ -262,8 +261,8 @@ static void openldap_ldap_init_w_userconf(const char *file)
 
        if (home != NULL) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_ARGS, 
-               "openldap_init_w_userconf: HOME env is %s\n", home ));
+       LDAP_LOG ( CONFIG, ARGS, 
+               "openldap_init_w_userconf: HOME env is %s\n", home, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is %s\n",
                      home, 0, 0);
@@ -271,8 +270,8 @@ static void openldap_ldap_init_w_userconf(const char *file)
                path = LDAP_MALLOC(strlen(home) + strlen(file) + 3);
        } else {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_ARGS, 
-               "openldap_init_w_userconf: HOME env is NULL\n" ));
+       LDAP_LOG ( CONFIG, ARGS, "openldap_init_w_userconf: HOME env is NULL\n",
+               0, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is NULL\n",
                      0, 0, 0);
@@ -555,9 +554,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 
                if( altfile != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sCONF env is %s\n",
-                               LDAP_ENV_PREFIX, altfile ));
+                               LDAP_ENV_PREFIX, altfile, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
                              LDAP_ENV_PREFIX "CONF", altfile, 0);
@@ -566,9 +565,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                }
                else
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sCONF env is NULL\n",
-                               LDAP_ENV_PREFIX ));
+                               LDAP_ENV_PREFIX, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
                              LDAP_ENV_PREFIX "CONF", 0, 0);
@@ -580,9 +579,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 
                if( altfile != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sRC env is %s\n",
-                               LDAP_ENV_PREFIX, altfile ));
+                               LDAP_ENV_PREFIX, altfile, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
                              LDAP_ENV_PREFIX "RC", altfile, 0);
@@ -591,9 +590,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                }
                else
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sRC env is NULL\n",
-                               LDAP_ENV_PREFIX ));
+                               LDAP_ENV_PREFIX, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
                              LDAP_ENV_PREFIX "RC", 0, 0);
index 372eb9fa0053a98856963865a2abf9a6f1982691..eadf2ac72dd1f8b7266d9a75d49ba52338219217 100644 (file)
@@ -45,7 +45,6 @@
 
 #include "ldap-int.h"
 
-
 /*
  * ldap_kerberos_bind1 - initiate a bind to the ldap server using
  * kerberos authentication.  The dn is supplied.  It is assumed the user
@@ -65,7 +64,7 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn )
        ber_len_t credlen;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind1\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 );
 #endif
@@ -119,7 +118,7 @@ ldap_kerberos_bind1_s( LDAP *ld, LDAP_CONST char *dn )
        LDAPMessage     *res;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind1_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1_s\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1_s\n", 0, 0, 0 );
 #endif
@@ -156,7 +155,7 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn )
        ber_len_t credlen;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind2\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 );
 #endif
@@ -205,7 +204,7 @@ ldap_kerberos_bind2_s( LDAP *ld, LDAP_CONST char *dn )
        LDAPMessage     *res;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind2_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2_s\n" , 0, 0, 0);
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2_s\n", 0, 0, 0 );
 #endif
@@ -230,7 +229,7 @@ ldap_kerberos_bind_s( LDAP *ld, LDAP_CONST char *dn )
        int     err;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind_s\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind_s\n", 0, 0, 0 );
 #endif
@@ -261,17 +260,16 @@ ldap_get_kerberosv4_credentials(
        char            realm[REALM_SZ], *cred, *krbinstance;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, 
-               "ldap_get_kerberosv4_credentials\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
 #endif
 
        if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "kbind", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "ldap_get_kerberosv4_credentials: krb_get_tf_realm failed: %s\n",
-                       krb_err_txt[err] ));
+                       krb_err_txt[err], 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: "
                        "krb_get_tf_realm failed: %s\n", krb_err_txt[err], 0, 0 );
@@ -293,9 +291,9 @@ ldap_get_kerberosv4_credentials(
            != KSUCCESS )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "kbind", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "ldap_get_kerberosv4_credentials: krb_mk_req failed: %s\n",
-                       krb_err_txt[err] ));
+                       krb_err_txt[err], 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: "
                        "krb_mk_req failed (%s)\n", krb_err_txt[err], 0, 0 );
index cf9f6ed573161c9862ed3c87d4c7f84e4f6a77a5..f3460643704ea6914ee027f7df69b287ce643f7a 100644 (file)
@@ -72,7 +72,7 @@ ldap_modify_ext( LDAP *ld,
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "ldap_modify_ext\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_modify_ext\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 );
 #endif
@@ -160,7 +160,7 @@ ldap_modify( LDAP *ld, LDAP_CONST char *dn, LDAPMod **mods )
        int rc, msgid;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "ldap_modify\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_modify\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 );
 #endif
index 5603d6dbeace7ac62affc73537098776b611780e..6907a2299859d5f5fd532d656c905485577bd145 100644 (file)
@@ -69,7 +69,7 @@ ldap_rename(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "ldap_rename\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_rename\n", 0, 0, 0 );
 #endif
@@ -156,7 +156,7 @@ ldap_rename2(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "ldap_rename2\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_rename2\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 );
 #endif
index 11a9b413318e67f2a750603c5066acc807613d98..8030790a942a9d3d5d26b768553376227b3c4740 100644 (file)
@@ -23,6 +23,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
+#include "ldap_log.h"
 
 int ldap_open_defconn( LDAP *ld )
 {
@@ -55,8 +56,7 @@ ldap_open( LDAP_CONST char *host, int port )
        LDAP            *ld;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "open", LDAP_LEVEL_ARGS, "ldap_open(%s, %d)\n",
-               host, port ));
+       LDAP_LOG ( CONNECTION, ARGS, "ldap_open(%s, %d)\n", host, port, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_open(%s, %d)\n",
                host, port, 0 );
@@ -75,8 +75,8 @@ ldap_open( LDAP_CONST char *host, int port )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "open", LDAP_LEVEL_RESULTS, "ldap_open: %s\n",
-               ld == NULL ? "succeeded" : "failed" ));
+       LDAP_LOG ( CONNECTION, RESULTS, "ldap_open: %s\n",
+               ld == NULL ? "succeeded" : "failed", 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_open: %s\n",
                ld == NULL ? "succeeded" : "failed", 0, 0 );
@@ -107,7 +107,7 @@ ldap_create( LDAP **ldp )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "open", LDAP_LEVEL_ENTRY, "ldap_create\n" ));
+       LDAP_LOG ( CONNECTION, ENTRY, "ldap_create\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_create\n", 0, 0, 0 );
 #endif
@@ -240,7 +240,7 @@ ldap_int_open_connection(
        long addr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "open", LDAP_LEVEL_ENTRY, "ldap_int_open_connection\n" ));
+       LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_open_connection\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_open_connection\n", 0, 0, 0 );
 #endif
index 7412a58014d067c5b702ae566db0dd77bff2ed90..61f8a7c0abcc796a710b075500e93a522d9b80d7 100644 (file)
@@ -686,7 +686,7 @@ ldap_int_select( LDAP *ld, struct timeval *timeout )
        struct selectinfo       *sip;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "os-ip", LDAP_LEVEL_ENTRY, "ldap_int_select\n" ));
+       LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_select\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 );
 #endif
index 3c4d2347f7cbe8cbdcdcddf0758843f5e2740f53..b9ecd9b3bd3a8ca7b50962b4fabfc288b1518e95 100644 (file)
@@ -84,7 +84,7 @@ ldap_send_initial_request(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_send_initial_request\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_send_initial_request\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 );
 #endif
@@ -99,8 +99,9 @@ ldap_send_initial_request(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
-                       "ldap_send_initial_request: ldap_open_defconn: successful\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "ldap_send_initial_request: ldap_open_defconn: successful\n" , 
+                       0, 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_open_defconn: successful\n",
@@ -151,7 +152,7 @@ ldap_send_server_request(
        int incparent;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_send_server_request\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_send_server_request\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_send_server_request\n", 0, 0, 0 );
 #endif
@@ -263,7 +264,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
        Sockbuf         *sb = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_new_connection\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_new_connection\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_new_connection\n", 0, 0, 0 );
 #endif
@@ -329,8 +330,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
                                ld->ld_defconn = lc;
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
-                                       "ldap_new_connection: Call application rebind_proc\n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "ldap_new_connection: Call application rebind_proc\n", 
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "Call application rebind_proc\n", 0, 0, 0);
 #endif
@@ -354,8 +356,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
                        ld->ld_defconn = lc;
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
-                               "ldap_new_connection: anonymous rebind via ldap_bind_s\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "ldap_new_connection: anonymous rebind via ldap_bind_s\n", 
+                               0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "anonymous rebind via ldap_bind_s\n", 0, 0, 0);
 #endif
@@ -422,7 +425,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
        LDAPConn        *tmplc, *prevlc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_free_connection\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_free_connection\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_free_connection\n", 0, 0, 0 );
 #endif
@@ -472,8 +475,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
                }
                LDAP_FREE( lc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_RESULTS, 
-                       "ldap_free_connection: actually freed\n" ));
+               LDAP_LOG ( OPERATION, RESULTS, 
+                       "ldap_free_connection: actually freed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: actually freed\n",
                    0, 0, 0 );
@@ -481,8 +484,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
        } else {
                lc->lconn_lastused = time( NULL );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_RESULTS
-                       "ldap_free_connection: refcnt %d\n", lc->lconn_refcnt ));
+               LDAP_LOG ( OPERATION, RESULTS, "ldap_free_connection: refcnt %d\n"
+                       lc->lconn_refcnt, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: refcnt %d\n",
                    lc->lconn_refcnt, 0, 0 );
@@ -612,9 +615,8 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr )
        LDAPRequest     **ttmplr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ARGS, 
-               "ldap_free_request (origid %d, msgid %d)\n",
-               lr->lr_origid, lr->lr_msgid ));
+       LDAP_LOG ( OPERATION, ARGS, "ldap_free_request (origid %d, msgid %d)\n",
+               lr->lr_origid, lr->lr_msgid, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_free_request (origid %d, msgid %d)\n",
                lr->lr_origid, lr->lr_msgid, 0 );
@@ -665,7 +667,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
        *hadrefp = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_chase_v3referrals\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_v3referrals\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals\n", 0, 0, 0 );
 #endif
@@ -682,9 +684,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
        /* Check for hop limit exceeded */
        if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
+               LDAP_LOG ( OPERATION, DETAIL1, 
                        "ldap_chase_v3referrals: more than %d referral hops (dropping)\n",
-                       ld->ld_refhoplimit ));
+                       ld->ld_refhoplimit, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "more than %d referral hops (dropping)\n", ld->ld_refhoplimit, 0, 0 );
@@ -737,9 +739,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
                                 * for the same server with different contexts.
                                 */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
+                               LDAP_LOG ( OPERATION, DETAIL1, 
                                        "ldap_chase_v3referrals: queue referral \"%s\"\n",
-                                       refarray[i] ));
+                                       refarray[i], 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_chase_v3referrals: queue referral \"%s\"\n",
@@ -807,9 +809,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
+               LDAP_LOG ( OPERATION, DETAIL1, 
                        "ldap_chase_v3referrals: msgid %d, url \"%s\"\n",
-                       lr->lr_msgid, refarray[i] ));
+                       lr->lr_msgid, refarray[i], 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_chase_v3referral: msgid %d, url \"%s\"\n",
@@ -823,9 +825,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
                        origreq, srv, NULL, &rinfo )) < 0 ) {
                        /* Failure, try next referral in the list */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "request", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( OPERATION, ERR, 
                        "ldap_chase_v3referrals: Unable to chase referral \"%s\" (%s)\n",
-                       refarray[i], ldap_err2string( ld->ld_errno ) ));
+                       refarray[i], ldap_err2string( ld->ld_errno ), 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "Unable to chase referral \"%s\" (%s)\n", 
                                refarray[i], ldap_err2string( ld->ld_errno ), 0);
@@ -908,7 +910,7 @@ ldap_chase_referrals( LDAP *ld,
        LDAPreqinfo  rinfo;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_chase_referrals\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_referrals\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_chase_referrals\n", 0, 0, 0 );
 #endif
@@ -935,9 +937,9 @@ ldap_chase_referrals( LDAP *ld,
 
        if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, 
+               LDAP_LOG ( OPERATION, ENTRY, 
                        "ldap_chase_referrals: more than %d referral hops (dropping)\n",
-                       ld->ld_refhoplimit ));
+                       ld->ld_refhoplimit, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "more than %d referral hops (dropping)\n",
@@ -968,9 +970,9 @@ ldap_chase_referrals( LDAP *ld,
 
                if ( rc != LDAP_URL_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( OPERATION, DETAIL1, 
                                "ldap_chase_referrals: ignoring unknown referral <%s>\n",
-                               ref ));
+                               ref, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                            "ignoring unknown referral <%s>\n", ref, 0, 0 );
@@ -986,8 +988,8 @@ ldap_chase_referrals( LDAP *ld,
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, 
-                       "ldap_chase_referrals: chasing LDAP referral <%s>\n", ref ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "ldap_chase_referrals: chasing LDAP referral <%s>\n", ref, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "chasing LDAP referral: <%s>\n", ref, 0, 0 );
@@ -1016,9 +1018,9 @@ ldap_chase_referrals( LDAP *ld,
                        ++count;
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "request", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( OPERATION, ERR, 
                                "ldap_chase_referrals: Unable to chase referral <%s>\n", 
-                               ldap_err2string( ld->ld_errno) ));
+                               ldap_err2string( ld->ld_errno), 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "Unable to chase referral (%s)\n", 
@@ -1091,10 +1093,10 @@ re_encode_request( LDAP *ld,
        char            *dn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "request", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "re_encode_request: new msgid %ld, new dn <%s>\n",
                (long) msgid, 
-               ( srv == NULL || srv->lud_dn == NULL ) ? "NONE" : srv->lud_dn ));
+               ( srv == NULL || srv->lud_dn == NULL ) ? "NONE" : srv->lud_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
            "re_encode_request: new msgid %ld, new dn <%s>\n",
@@ -1192,8 +1194,8 @@ re_encode_request( LDAP *ld,
 #ifdef LDAP_DEBUG
        if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1,
-                       "re_encode_request: new request is:\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "re_encode_request: new request is:\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "re_encode_request new request is:\n",
                    0, 0, 0 );
index a1ee317cf6d31e78de76eb77fbcf554ba7674300..1a7bcec9efff41fa9bd692f91cab037538a24cea 100644 (file)
@@ -53,7 +53,7 @@
 #include <ac/unistd.h>
 
 #include "ldap-int.h"
-
+#include "ldap_log.h"
 
 static int ldap_abandoned LDAP_P(( LDAP *ld, ber_int_t msgid ));
 static int ldap_mark_abandoned LDAP_P(( LDAP *ld, ber_int_t msgid ));
@@ -98,7 +98,7 @@ ldap_result(
        assert( result != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_ARGS, "ldap_result msgid %d\n", msgid ));
+       LDAP_LOG ( OPERATION, ARGS, "ldap_result msgid %d\n", msgid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_result msgid %d\n", msgid, 0, 0 );
 #endif
@@ -129,8 +129,8 @@ chkResponseList(
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_ARGS
-               "ldap_chkResponseList for msgid=%d, all=%d\n", msgid, all ));
+       LDAP_LOG ( OPERATION, ARGS, "ldap_chkResponseList for msgid=%d, all=%d\n"
+               msgid, all, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "ldap_chkResponseList for msgid=%d, all=%d\n",
@@ -142,8 +142,8 @@ chkResponseList(
 
                if ( ldap_abandoned( ld, lm->lm_msgid ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-                               "ldap_chkResponseList msg abandoned, msgid %d\n", msgid ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "ldap_chkResponseList msg abandoned, msgid %d\n", msgid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldap_chkResponseList msg abandoned, msgid %d\n",
@@ -207,17 +207,17 @@ chkResponseList(
 #ifdef LDAP_DEBUG
        if( lm == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_RESULTS, 
-                       "ldap_chkResponseList returns NULL\n" ));
+               LDAP_LOG ( OPERATION, RESULTS, "ldap_chkResponseList returns NULL\n",
+                       0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_chkResponseList returns NULL\n", 0, 0, 0);
 #endif
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_RESULTS, 
-                       "ldap_chkResponseList returns msgid %d, type 0x02lu\n",
-                       lm->lm_msgid, (unsigned long) lm->lm_msgtype ));
+               LDAP_LOG ( OPERATION, RESULTS, 
+                       "ldap_chkResponseList returns msgid %d, type 0x%02lu\n",
+                       lm->lm_msgid, (unsigned long) lm->lm_msgtype, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_chkResponseList returns msgid %d, type 0x%02lu\n",
@@ -248,17 +248,17 @@ wait4msg(
 #ifdef LDAP_DEBUG
        if ( timeout == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_ARGS,
-                       "wait4msg (infinite timeout), msgid %d\n", msgid ));
+               LDAP_LOG ( OPERATION, ARGS, 
+                       "wait4msg (infinite timeout), msgid %d\n", msgid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "wait4msg (infinite timeout), msgid %d\n",
                    msgid, 0, 0 );
 #endif
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_ARGS,
+               LDAP_LOG ( OPERATION, ARGS, 
                        "wait4msg (timeout %ld sec, %ld usec), msgid %d\n", 
-                       (long) timeout->tv_sec, (long) timeout->tv_usec, msgid ));
+                       (long) timeout->tv_sec, (long) timeout->tv_usec, msgid );
 #else
                Debug( LDAP_DEBUG_TRACE, "wait4msg (timeout %ld sec, %ld usec), msgid %d\n",
                       (long) timeout->tv_sec, (long) timeout->tv_usec, msgid );
@@ -278,8 +278,8 @@ wait4msg(
        while ( rc == -2 ) {
 #ifdef LDAP_DEBUG
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_ARGS,
-                       "wait4msg continue, msgid %d, all %d\n", msgid, all ));
+               LDAP_LOG ( OPERATION, ARGS, 
+                       "wait4msg continue, msgid %d, all %d\n", msgid, all, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n",
                    msgid, all, 0 );
@@ -310,9 +310,9 @@ wait4msg(
 #ifdef LDAP_DEBUG
                            if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "result", LDAP_LEVEL_ARGS,
+                                       LDAP_LOG ( OPERATION, ARGS, 
                                                "wait4msg: ldap_int_select returned -1: errno %d\n", 
-                                               errno ));
+                                               errno, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_select returned -1: errno %d\n",
@@ -358,8 +358,8 @@ wait4msg(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1,
-                               "wait4msg: %ld secs to go\n", (long) tv.tv_sec ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "wait4msg: %ld secs to go\n", (long) tv.tv_sec, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "wait4msg:  %ld secs to go\n",
                               (long) tv.tv_sec, 0, 0 );
@@ -401,8 +401,7 @@ try_read1msg(
        assert( lc != NULL );
        
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_ARGS, "read1msg: msgid %d, all %d\n",
-               msgid, all ));
+       LDAP_LOG ( OPERATION, ARGS, "read1msg: msgid %d, all %d\n", msgid, all, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "read1msg: msgid %d, all %d\n", msgid, all, 0 );
 #endif
@@ -431,8 +430,8 @@ try_read1msg(
                if ( tag == LBER_DEFAULT) {
 #ifdef LDAP_DEBUG                 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-                               "read1msg: ber_get_next failed\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "read1msg: ber_get_next failed\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS,
                              "ber_get_next failed.\n", 0, 0, 0 );
@@ -468,8 +467,7 @@ try_read1msg(
        if ( ldap_abandoned( ld, id ) ) {
                ber_free( ber, 1 );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-                       "read1msg: abandoned\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, "read1msg: abandoned\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "abandoned\n", 0, 0, 0);
 #endif
@@ -478,9 +476,9 @@ try_read1msg(
 
        if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+               LDAP_LOG ( OPERATION, DETAIL1, 
                        "read1msg: no request for response with msgid %ld (tossing)\n",
-                       (long) id ));
+                       (long) id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "no request for response with msgid %ld (tossing)\n",
@@ -503,10 +501,10 @@ try_read1msg(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+       LDAP_LOG ( OPERATION, DETAIL1, 
                "read1msg: ldap_read: message type %s msgid %ld, original id %ld\n",
            ldap_int_msgtype2str( tag ),
-               (long) lr->lr_msgid, (long) lr->lr_origid ));
+               (long) lr->lr_msgid, (long) lr->lr_origid );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "ldap_read: message type %s msgid %ld, original id %ld\n",
@@ -548,10 +546,10 @@ try_read1msg(
                                                if( lr->lr_status != LDAP_REQST_COMPLETED) {
                                                        lr->lr_status = LDAP_REQST_CHASINGREFS;
 #ifdef NEW_LOGGING
-                                                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+                                                       LDAP_LOG ( OPERATION, DETAIL1, 
                                                                "read1msg: search ref chased,"
                                                                "mark request chasing refs, id =        %d\n",
-                                                               lr->lr_msgid ));
+                                                               lr->lr_msgid, 0, 0 );
 #else
                                                        Debug( LDAP_DEBUG_TRACE,
                                                            "read1msg:  search ref chased, mark request chasing refs, id = %d\n",
@@ -581,10 +579,10 @@ try_read1msg(
                                                        rc = LDAP_DECODING_ERROR;
                                                        lr->lr_status = LDAP_REQST_COMPLETED;
 #ifdef NEW_LOGGING
-                                                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+                                                       LDAP_LOG ( OPERATION, DETAIL1, 
                                                                "read1msg: referral decode error,"
                                                                "mark request completed, id =   %d\n",
-                                                               lr->lr_msgid ));
+                                                               lr->lr_msgid, 0, 0 );
 #else
                                                        Debug( LDAP_DEBUG_TRACE,
                                                            "read1msg: referral decode error, mark request completed, id = %d\n",
@@ -598,10 +596,10 @@ try_read1msg(
                                                            0, &lr->lr_res_error, &hadref );
                                                        lr->lr_status = LDAP_REQST_COMPLETED;
 #ifdef NEW_LOGGING
-                                                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+                                                       LDAP_LOG ( OPERATION, DETAIL1, 
                                                                "read1msg: referral chased,"
                                                                "mark request completed, id =   %d\n",
-                                                               lr->lr_msgid ));
+                                                               lr->lr_msgid, 0, 0 );
 #else
                                                        Debug( LDAP_DEBUG_TRACE,
                                                            "read1msg:  referral chased, mark request completed, id = %d\n",
@@ -654,10 +652,10 @@ try_read1msg(
                                                &lr->lr_res_error, -1, &hadref );
                                        lr->lr_status = LDAP_REQST_COMPLETED;
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+                                       LDAP_LOG ( OPERATION, DETAIL1, 
                                                "read1msg: V2 referral chased,"
                                                "mark request completed, id =   %d\n",
-                                               lr->lr_msgid ));
+                                               lr->lr_msgid, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                            "read1msg:  V2 referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0);
@@ -675,10 +673,10 @@ try_read1msg(
                                        lr->lr_res_errno = LDAP_PARTIAL_RESULTS;
                                }
 #ifdef NEW_LOGGING
-LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+LDAP_LOG ( OPERATION, DETAIL1, 
        "read1msg: new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
     lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
-    lr->lr_res_matched ? lr->lr_res_matched : "" ));
+    lr->lr_res_matched ? lr->lr_res_matched : "" );
 #else
 Debug( LDAP_DEBUG_TRACE,
     "new result:  res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
@@ -689,8 +687,8 @@ Debug( LDAP_DEBUG_TRACE,
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1
-                       "read1msg: %d new referrals\n", refer_cnt ));
+               LDAP_LOG ( OPERATION, DETAIL1, "read1msg: %d new referrals\n"
+                       refer_cnt, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "read1msg:  %d new referrals\n", refer_cnt, 0, 0 );
@@ -715,8 +713,9 @@ Debug( LDAP_DEBUG_TRACE,
 
                        lr->lr_status = LDAP_REQST_COMPLETED; /* declare this request done */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-                               "read1msg: mark request completed, id = %d\n", lr->lr_msgid ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "read1msg: mark request completed, id = %d\n", 
+                               lr->lr_msgid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                            "read1msg:  mark request completed, id = %d\n", lr->lr_msgid, 0, 0);
@@ -745,12 +744,12 @@ Debug( LDAP_DEBUG_TRACE,
                                id = lr->lr_msgid;
                                tag = lr->lr_res_msgtype;
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-                               "read1msg: request %ld done\n", (long) id ));
-                       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "read1msg: request %ld done\n", (long) id, 0, 0 );
+                       LDAP_LOG ( OPERATION, DETAIL1, 
                                "read1msg: res_errno: %d,res_error: <%s>, res_matched: <%s>\n",
                                lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
-                               lr->lr_res_matched ? lr->lr_res_matched : "" ));
+                               lr->lr_res_matched ? lr->lr_res_matched : "" );
 #else
                                Debug( LDAP_DEBUG_ANY, "request %ld done\n",
                                    (long) id, 0, 0 );
@@ -838,9 +837,9 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
+       LDAP_LOG ( OPERATION, DETAIL1, 
                "read1msg: adding response id %ld type %ld\n",
-               (long) new->lm_msgid, (long) new->lm_msgtype ));
+               (long) new->lm_msgid, (long) new->lm_msgtype, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "adding response id %ld type %ld:\n",
            (long) new->lm_msgid, (long) new->lm_msgtype, 0 );
@@ -964,12 +963,12 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, 
-               "read1msg: merged parent (id %d) error info: result errno %d, "
-               "error <%s>, matched <%s>\n", parentr->lr_msgid,
+       LDAP_LOG( OPERATION, DETAIL1, "merged parent (id %d) error info:  ",
+           parentr->lr_msgid, 0, 0 );
+       LDAP_LOG( OPERATION, DETAIL1, "result errno %d, error <%s>, matched <%s>\n",
            parentr->lr_res_errno, parentr->lr_res_error ?
            parentr->lr_res_error : "", parentr->lr_res_matched ?
-           parentr->lr_res_matched : "" ));
+           parentr->lr_res_matched : "" );
 #else
        Debug( LDAP_DEBUG_TRACE, "merged parent (id %d) error info:  ",
            parentr->lr_msgid, 0, 0 );
@@ -1024,7 +1023,7 @@ ldap_msgfree( LDAPMessage *lm )
        int             type = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_ENTRY, "ldap_msgfree\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_msgfree\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_msgfree\n", 0, 0, 0 );
 #endif
@@ -1052,7 +1051,7 @@ ldap_msgdelete( LDAP *ld, int msgid )
        assert( ld != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "result", LDAP_LEVEL_ENTRY, "ldap_msgdelete\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_msgdelete\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_msgdelete\n", 0, 0, 0 );
 #endif
index 0164bc962fc02d9ee660f12aa032dceb39d73cbc..e5c64921d5ad82c57ea6ce2b52107d1ea8dd7d30 100644 (file)
@@ -62,7 +62,7 @@ ldap_sasl_bind(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_sasl_bind\n" ));
+       LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind\n", 0, 0, 0 );
 #endif
@@ -169,7 +169,7 @@ ldap_sasl_bind_s(
        struct berval   *scredp = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_sasl_bind_s\n" ));
+       LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind_s\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind_s\n", 0, 0, 0 );
 #endif
@@ -255,7 +255,7 @@ ldap_parse_sasl_bind_result(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_parse_sasl_bind_result\n" ));
+       LDAP_LOG ( TRANSPORT, ENTRY, "ldap_parse_sasl_bind_result\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_parse_sasl_bind_result\n", 0, 0, 0 );
 #endif
@@ -368,7 +368,7 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, char **pmechlist )
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_getmech\n" ));
+       LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
 #endif
@@ -456,8 +456,9 @@ ldap_sasl_interactive_bind_s(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "sasl", LDAP_LEVEL_DETAIL1, 
-                       "ldap_interactive_sasl_bind_s: server supports: %s\n", smechs ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                       "ldap_interactive_sasl_bind_s: server supports: %s\n", 
+                       smechs, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_interactive_sasl_bind_s: server supports: %s\n",
@@ -468,8 +469,8 @@ ldap_sasl_interactive_bind_s(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "sasl", LDAP_LEVEL_DETAIL1, 
-                       "ldap_interactive_sasl_bind_s: user selected: %s\n", mechs ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                       "ldap_interactive_sasl_bind_s: user selected: %s\n", mechs, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_interactive_sasl_bind_s: user selected: %s\n",
index eb8aaed4bd57f564e125b6011efa549c53f713cd..1d016bbf9233d18a75ac78abb94c7e8317c5559c 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "ldap-int.h"
 
-
 /*
  * ldap_simple_bind - bind to the ldap server (and X.500).  The dn and
  * password of the entry to which to bind are supplied.  The message id
@@ -63,7 +62,7 @@ ldap_simple_bind(
        struct berval cred;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sbind", LDAP_LEVEL_ENTRY, "ldap_simple_bind\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 );
 #endif
@@ -102,7 +101,7 @@ ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd )
        struct berval cred;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "sbind", LDAP_LEVEL_ENTRY, "ldap_simple_bind_s\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind_s\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind_s\n", 0, 0, 0 );
 #endif
index c0bc46df7899dae708c45b7ce4e559d476bc1fb2..2817e650826ddfb9c720510c6d65e72fe2510e39 100644 (file)
@@ -21,7 +21,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
-
+#include "ldap_log.h"
 
 /*
  * ldap_search_ext - initiate an ldap search operation.
@@ -62,7 +62,7 @@ ldap_search_ext(
        int timelimit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_ENTRY, "ldap_search_ext\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_search_ext\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_search_ext\n", 0, 0, 0 );
 #endif
@@ -184,7 +184,7 @@ ldap_search(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_ENTRY, "ldap_search\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_search\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_search\n", 0, 0, 0 );
 #endif
index f7f27bce46d01ca1bc1e61d88da6d6c445bcea92..7b87c247bb688f5b522823baded14d8eaac4ba2e 100644 (file)
@@ -180,9 +180,9 @@ ldap_pvt_tls_init_def_ctx( void )
                tls_def_ctx = SSL_CTX_new( SSLv23_method() );
                if ( tls_def_ctx == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
                                "TLS could not allocate default ctx (%d).\n",
-                               ERR_peek_error() ));
+                               ERR_peek_error(), 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                           "TLS: could not allocate default ctx (%lu).\n",
@@ -195,9 +195,9 @@ ldap_pvt_tls_init_def_ctx( void )
                        !SSL_CTX_set_cipher_list( tls_def_ctx, tls_opt_ciphersuite ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
                                "TLS could not set cipher list %s.\n",
-                               tls_opt_ciphersuite ));
+                               tls_opt_ciphersuite, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                   "TLS: could not set cipher list %s.\n",
@@ -213,12 +213,12 @@ ldap_pvt_tls_init_def_ctx( void )
                                !SSL_CTX_set_default_verify_paths( tls_def_ctx ) )
                        {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "tls", LDAP_LEVEL_ERR,
+                               LDAP_LOG ( TRANSPORT, ERR, 
                                        "ldap_pvt_tls_init_def_ctx: "
                                        "TLS could not load verify locations "
                                        "(file:`%s',dir:`%s').\n",
                                        tls_opt_cacertfile ? tls_opt_cacertfile : "",
-                                       tls_opt_cacertdir ? tls_opt_cacertdir : "" ));
+                                       tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "TLS: "
                                        "could not load verify locations (file:`%s',dir:`%s').\n",
@@ -233,10 +233,10 @@ ldap_pvt_tls_init_def_ctx( void )
                        calist = get_ca_list( tls_opt_cacertfile, tls_opt_cacertdir );
                        if ( !calist ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
+                               LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
                                        "TLS could not load client CA list (file: `%s',dir:`%s')\n",
                                        tls_opt_cacertfile ? tls_opt_cacertfile : "",
-                                       tls_opt_cacertdir ? tls_opt_cacertdir : "" ));
+                                       tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "TLS: "
                                        "could not load client CA list (file:`%s',dir:`%s').\n",
@@ -256,8 +256,8 @@ ldap_pvt_tls_init_def_ctx( void )
                                tls_opt_keyfile, SSL_FILETYPE_PEM ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
-                               "TLS could not use key file `%s'.\n", tls_opt_keyfile ));
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
+                               "TLS could not use key file `%s'.\n", tls_opt_keyfile, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "TLS: could not use key file `%s'.\n",
@@ -272,8 +272,9 @@ ldap_pvt_tls_init_def_ctx( void )
                                tls_opt_certfile, SSL_FILETYPE_PEM ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
-                               "TLS could not use certificate `%s'.\n", tls_opt_certfile ));
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
+                               "TLS could not use certificate `%s'.\n", 
+                               tls_opt_certfile, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "TLS: could not use certificate `%s'.\n",
@@ -287,8 +288,9 @@ ldap_pvt_tls_init_def_ctx( void )
                        !SSL_CTX_check_private_key( tls_def_ctx ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: "
-                               "TLS private key mismatch.\n" ));
+                       LDAP_LOG ( TRANSPORT, ERR, 
+                               "ldap_pvt_tls_init_def_ctx: TLS private key mismatch.\n", 
+                               0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "TLS: private key mismatch.\n",
@@ -397,8 +399,8 @@ alloc_handle( void *ctx_arg )
        ssl = SSL_new( ctx );
        if ( ssl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "alloc_handle: "
-                       "TLS can't create ssl handle.\n" ));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "alloc_handle: TLS can't create ssl handle.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,"TLS: can't create ssl handle.\n",0,0,0);
 #endif
@@ -739,8 +741,8 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn )
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_int_tls_connect: "
-                       "TLS can't connect.\n" ));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "ldap_int_tls_connect: TLS can't connect.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,"TLS: can't connect.\n",0,0,0);
 #endif
@@ -791,8 +793,8 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
                if ( update_flags( sb, ssl, err )) return 1;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_accept: "
-                       "TLS can't accept.\n" ));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "ldap_pvt_tls_accept: TLS can't accept.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,"TLS: can't accept.\n",0,0,0 );
 #endif
@@ -929,8 +931,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
        x = tls_get_cert((SSL *)s);
        if (!x) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: "
-                       "TLS unable to get peer certificate.\n" ));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "ldap_pvt_tls_check_hostname: "
+                       "TLS unable to get peer certificate.\n" , 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "TLS: unable to get peer certificate.\n",
@@ -1006,8 +1009,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
                        buf, sizeof(buf)) == -1)
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: "
-                               "TLS unable to get common name from peer certificate.\n" ));
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: "
+                               "TLS unable to get common name from peer certificate.\n", 
+                               0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "TLS: unable to get common name from peer certificate.\n",
@@ -1016,9 +1020,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
 
                } else if (strcasecmp(name, buf)) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: "
+                       LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: "
                                "TLS hostname (%s) does not match "
-                               "common name in certificate (%s).\n", name, buf ));
+                               "common name in certificate (%s).\n", name, buf, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "TLS: hostname (%s) does not match "
                                "common name in certificate (%s).\n", 
@@ -1344,8 +1348,8 @@ tls_info_cb( SSL *ssl, int where, int ret )
 
        if ( where & SSL_CB_LOOP ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, "tls_info_cb: "
-                       "TLS trace: %s:%s\n", op, SSL_state_string_long( ssl ) ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, "tls_info_cb: "
+                       "TLS trace: %s:%s\n", op, SSL_state_string_long( ssl ), 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                           "TLS trace: %s:%s\n",
@@ -1355,10 +1359,10 @@ tls_info_cb( SSL *ssl, int where, int ret )
        } else if ( where & SSL_CB_ALERT ) {
                op = ( where & SSL_CB_READ ) ? "read" : "write";
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, "tls_info_cb: "
-                       "TLS trace: SSL3 alert %s:%s:%s\n", op,
-                          SSL_alert_type_string_long( ret ),
-                          SSL_alert_desc_string_long( ret) ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                       "tls_info_cb: TLS trace: SSL3 alert %s:%s:%s\n", 
+                       op, SSL_alert_type_string_long( ret ), 
+                       SSL_alert_desc_string_long( ret) );
 #else
                Debug( LDAP_DEBUG_TRACE,
                           "TLS trace: SSL3 alert %s:%s:%s\n",
@@ -1370,8 +1374,9 @@ tls_info_cb( SSL *ssl, int where, int ret )
        } else if ( where & SSL_CB_EXIT ) {
                if ( ret == 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_info_cb: "
-                       "TLS trace: %s:failed in %s\n", op, SSL_state_string_long( ssl ) ));
+                       LDAP_LOG ( TRANSPORT, ERR, 
+                               "tls_info_cb: TLS trace: %s:failed in %s\n", 
+                               op, SSL_state_string_long( ssl ), 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                   "TLS trace: %s:failed in %s\n",
@@ -1379,8 +1384,9 @@ tls_info_cb( SSL *ssl, int where, int ret )
 #endif
                } else if ( ret < 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_info_cb: "
-                       "TLS trace: %s:error in %s\n", op, SSL_state_string_long( ssl ) ));
+                       LDAP_LOG ( TRANSPORT, ERR, 
+                               "tls_info_cb: TLS trace: %s:error in %s\n", 
+                               op, SSL_state_string_long( ssl ), 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                   "TLS trace: %s:error in %s\n",
@@ -1415,13 +1421,15 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx )
        sname = X509_NAME_oneline( subject, NULL, 0 );
        iname = X509_NAME_oneline( issuer, NULL, 0 );
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_verify_cb"
-               "TLS certificate verification: depth: %d, err: %d: "
-               "subject: %s, issuer: %s\n", errdepth, errnum, 
-               sname ? sname : "-unknown-", iname ? iname : "-unknown-" ));
+       LDAP_LOG( TRANSPORT, ERR,
+                  "TLS certificate verification: depth: %d, err: %d, subject: %s,",
+                  errdepth, errnum,
+                  sname ? sname : "-unknown-" );
+       LDAP_LOG( TRANSPORT, ERR, " issuer: %s\n", iname ? iname : "-unknown-", 0, 0 );
        if ( !ok ) {
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "TLS certificate verification: Error, %s\n",
-                       X509_verify_cert_error_string(errnum)));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "TLS certificate verification: Error, %s\n",
+                       X509_verify_cert_error_string(errnum), 0, 0 );
        }
 #else
        Debug( LDAP_DEBUG_TRACE,
@@ -1461,9 +1469,9 @@ tls_report_error( void )
 
        while ( ( l = ERR_get_error_line( &file, &line ) ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( TRANSPORT, ERR, 
                        "tls_report_error: TLS %s %s:%d\n", 
-                       ERR_error_string( l, buf ), file, line ));
+                       ERR_error_string( l, buf ), file, line );
 #else
                Debug( LDAP_DEBUG_ANY, "TLS: %s %s:%d\n",
                   ERR_error_string( l, buf ), file, line );
@@ -1482,9 +1490,9 @@ tls_tmp_rsa_cb( SSL *ssl, int is_export, int key_length )
 
        if ( !tmp_rsa ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_ERR, 
-                       "tls_tmp_rsa_cb: TLS Failed to generate temporary %d-bit %s RSA key\n", 
-                       key_length, is_export ? "export" : "domestic" ));
+               LDAP_LOG ( TRANSPORT, ERR, 
+                       "tls_tmp_rsa_cb: TLS Failed to generate temporary %d-bit %s "
+                       "RSA key\n", key_length, is_export ? "export" : "domestic", 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "TLS: Failed to generate temporary %d-bit %s RSA key\n",
@@ -1518,9 +1526,9 @@ tls_seed_PRNG( const char *randfile )
 
        if (randfile == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, 
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
                        "tls_seed_PRNG: TLS Use configuration file or "
-                       "$RANDFILE to define seed PRNG\n" ));
+                       "$RANDFILE to define seed PRNG\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "TLS: Use configuration file or $RANDFILE to define seed PRNG\n",
@@ -1533,8 +1541,9 @@ tls_seed_PRNG( const char *randfile )
 
        if (RAND_status() == 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, 
-                       "tls_seed_PRNG: TLS PRNG not been seeded with enough data\n" ));
+               LDAP_LOG ( TRANSPORT, DETAIL1, 
+                       "tls_seed_PRNG: TLS PRNG not been seeded with enough data\n", 
+                       0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "TLS: PRNG not been seeded with enough data\n",
index 4474920bf7bc97d65ce867aa47b7bd012384e8dc..45b77f65281a421d0015b702471885f4ada0399f 100644 (file)
@@ -59,7 +59,7 @@ int
 ldap_unbind( LDAP *ld )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_unbind\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_unbind\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_unbind\n", 0, 0, 0 );
 #endif
@@ -181,7 +181,7 @@ ldap_send_unbind(
        BerElement      *ber;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_send_unbind\n" ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_send_unbind\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 );
 #endif
index e7985dae6b74079fc2314c8c9433fce455aab0fc..6b9e756cd3f4ed617a113b78d24326c965d7a26d 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "ldap-int.h"
 
-
 /* local functions */
 static const char* skip_url_prefix LDAP_P((
        const char *url,
@@ -446,7 +445,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
         * the options and cause infinite recursion
         */
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "url", LDAP_LEVEL_ENTRY, "ldap_url_parse_ext(%s)\n", url_in ));
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 );
 #endif
index 908fbd7b511b84f052067cd5c202d91df4f95946..ba9f3ec5e7737c1e1e128a94a58b22914393aedc 100644 (file)
@@ -13,11 +13,11 @@ NT_OBJS = ntservice.o slapdmsg.res
 UNIX_SRCS = detach.c
 UNIX_OBJS = detach.o
 
-SRCS   = base64.c csn.c debug.c entropy.c sasl.c signal.c hash.c \
+SRCS   = base64.c csn.c entropy.c sasl.c signal.c hash.c \
        md5.c passwd.c sha1.c getpass.c lockf.c utils.c uuid.c sockpair.c \
        @LIBSRCS@ $(@PLAT@_SRCS)
 
-OBJS   = base64.o csn.o debug.o entropy.o sasl.o signal.o hash.o \
+OBJS   = base64.o csn.o entropy.o sasl.o signal.o hash.o \
        md5.o passwd.o sha1.o getpass.o lockf.o utils.o uuid.o sockpair.o \
        @LIBOBJS@ $(@PLAT@_OBJS)
 
index 1d47361d8e53adca94a876b002583d017f21a518..4cc883f104a8843f4a7a09525b5ddefddd97f986 100644 (file)
@@ -12,6 +12,7 @@
 #include <ac/stdlib.h>
 #include <ac/string.h>
 #include <ac/time.h>
+#include <ac/ctype.h>
 
 #ifdef LDAP_SYSLOG
 #include <ac/syslog.h>
@@ -27,7 +28,7 @@ struct DEBUGLEVEL
        int  level;
 };
 
-static struct DEBUGLEVEL **levelArray;
+int ldap_loglevels[LDAP_SUBSYS_NUM];
 static long   numLevels = 0;
 
 static FILE *log_file = NULL;
@@ -56,6 +57,39 @@ static char *lutil_levels[] = {"emergency", "alert", "critical",
                           "results", "detail1", "detail2",
                           NULL};
 
+static char *lutil_subsys[LDAP_SUBSYS_NUM] = {"global","operation", "transport",
+                               "connection", "filter", "ber", 
+                               "config", "acl", "cache", "index", 
+                               "ldif", "tools", "slapd", "slurpd",
+                               "backend", "back_bdb", "back_ldbm", 
+                               "back_ldap", "back_meta", "back_mon" };
+
+int lutil_mnem2subsys( const char *subsys )
+{
+    int i;
+    for( i = 0; i < LDAP_SUBSYS_NUM; i++ )
+    {
+               if ( !strcasecmp( subsys, lutil_subsys[i] ) )
+               {
+               return i;
+               }
+    }
+    return 0;
+}
+
+void lutil_set_all_backends( level )
+{
+    int i;
+
+    for( i = 0; i < LDAP_SUBSYS_NUM; i++ )
+    {
+               if ( !strncasecmp( "back_", lutil_subsys[i], strlen("back_") ) )
+               {
+                       ldap_loglevels[i] = level;
+               }
+    }
+}
+
 int lutil_mnem2level( const char *level )
 {
     int i;
@@ -71,36 +105,15 @@ int lutil_mnem2level( const char *level )
 
 static void addSubsys( const char *subsys, int level )
 {
-       int i, j;
-
-       if ( !strcasecmp( subsys, "global") ) global_level = level;
+       int i, j, subsys_num;
 
-       for( i = 0; i < numLevels; i++ )
-       {
-               if ( levelArray[i] == NULL )
-               {
-                       levelArray[i] = (struct DEBUGLEVEL*)ber_memalloc( sizeof( struct DEBUGLEVEL ) );
-                       levelArray[i]->subsystem = (char*)ber_memalloc( strlen( subsys ) + 1 );
-                       strcpy ( levelArray[i]->subsystem, subsys );
-                       levelArray[i]->level = level;
-                       return;
-               }
-               if( !strcasecmp( subsys, levelArray[i]->subsystem ) )
-               {
-                       levelArray[i]->level = level;
-                       return;
-               }
-       }
-       levelArray = (struct DEBUGLEVEL**)ber_memrealloc( levelArray, sizeof( struct DEBUGLEVEL* ) * (numLevels + 10) );
-       for( j = numLevels; j < (numLevels + 10); j++ )
+       if ( !strcasecmp( subsys, "backend" ) )
+               lutil_set_all_backends( level );
+       else
        {
-               levelArray[j] = NULL;
+               subsys_num = lutil_mnem2subsys(subsys);
+               ldap_loglevels[subsys_num] = level;
        }
-       numLevels += 10;
-       levelArray[i] = (struct DEBUGLEVEL*)ber_memalloc( sizeof( struct DEBUGLEVEL ) );
-       levelArray[i]->subsystem = (char*)ber_memalloc( strlen( subsys ) + 1 );
-       strcpy( levelArray[i]->subsystem, subsys );
-       levelArray[i]->level = level;
        return;
 }
 
@@ -127,27 +140,14 @@ void lutil_log_int(
        struct tm *today;
 #endif
        int i;
+       char data[4096];
+       char * t_subsys;
+       char * tmp;
 
-       if ( levelArray == NULL ) return; /* logging isn't set up */
-
-       /*
-        * Look for the subsystem in the level array.  When we find it,
-        * break out of the loop.
-        */
-       for( i = 0; i < numLevels; i++ ) {
-               if ( levelArray[i] == NULL ) break; 
-               if ( ! strcasecmp( levelArray[i]->subsystem, subsys ) ) break;
-       }
-
-       /*
-        * If we didn't find the subsystem, or the set level is less than
-        * the requested output level, don't output it.
-        */
-       if ( (level > global_level) &&
-               ((i > numLevels ) || (levelArray[i] == NULL) || ( level > levelArray[i]->level )) )
-       {
-               return;
-       }
+       t_subsys = strdup(subsys);
+       
+       for(tmp = t_subsys, i = 0; i < strlen(t_subsys); i++, tmp++)
+               *tmp = TOUPPER( (unsigned char) *tmp );
 
 #ifdef LDAP_SYSLOG
        /* we're configured to use syslog */
@@ -198,7 +198,10 @@ void lutil_log_int(
        /*
         * format the output data.
         */
+
+       fprintf(file, "\n%s:: ", t_subsys ); 
        vfprintf( file, fmt, vl );
+       fflush( file );
 }
 
 /*
@@ -206,13 +209,13 @@ void lutil_log_int(
  * level of the log output and the format and data.  Send this on to the
  * internal routine with the print file, if any.
  */
-void lutil_log( const char *subsys, int level, const char *fmt, ... )
+void lutil_log( const int subsys, int level, const char *fmt, ... )
 {
        FILE* outfile = NULL;
        va_list vl;
        va_start( vl, fmt );
        ber_get_option( NULL, LBER_OPT_LOG_PRINT_FILE, &outfile );
-       lutil_log_int( outfile, subsys, level, fmt, vl );
+       lutil_log_int( outfile, lutil_subsys[subsys], level, fmt, vl );
        va_end( vl );
 }
 
@@ -232,32 +235,38 @@ void lutil_log_initialize(int argc, char **argv)
      */
     for( i = 0; i < argc; i++ )
     {
-       char *next = argv[i];
-       if ( i < argc-1 && next[0] == '-' && next[1] == 'd' )
-       {
-           char subsys[64];
-           int level;
-           char *optarg = argv[i+1];
-           char *index = strchr( optarg, '=' );
-           if ( index != NULL )
-           {
-               *index = 0;
-               strcpy ( subsys, optarg );
-               level = atoi( index+1 );
-               if ( level <= 0 ) level = lutil_mnem2level( index + 1 );
-               lutil_set_debug_level( subsys, level );
-               *index = '=';
-           }
-           else
-           {
-               global_level = atoi( optarg );
-               /* 
-                * if a negative number was used, make the global level the
-                * maximum sane level.
-                */
-               if ( global_level < 0 ) global_level = 65535;
-           }
-       }
+               char *next = argv[i];
+       
+               if ( i < argc-1 && next[0] == '-' && next[1] == 'd' )
+               {
+                       char subsys[64];
+                       int level;
+               char *optarg = argv[i+1];
+               char *index = strchr( optarg, '=' );
+               if ( index != NULL )
+               {
+                               *index = 0;
+                               strcpy ( subsys, optarg );
+                               level = atoi( index+1 );
+                               if ( level <= 0 ) level = lutil_mnem2level( index + 1 );
+                               lutil_set_debug_level( subsys, level );
+                               *index = '=';
+               }
+               else
+               {
+                               global_level = atoi( optarg );
+                               ldap_loglevels[0] = global_level;
+                               /* 
+                               * if a negative number was used, make the global level the
+                               * maximum sane level.
+                               */
+                               if ( global_level < 0 ) 
+                               {
+                                       global_level = 65535;
+                                       ldap_loglevels[0] = 65535;
+                       }
+               }
+               }
     }
 }
 
index b092d124f338f2c1d2713d7a0fe672af46949edd..80ea94be0ce51671969174d2d19c419d889fc7dd 100644 (file)
@@ -35,8 +35,7 @@ do_abandon(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, "conn: %d do_abandon\n",
-               conn->c_connid));
+       LDAP_LOG( OPERATION, ENTRY, "conn: %d do_abandon\n", conn->c_connid, 0, 0);
 #else
        Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 );
 #endif
@@ -49,9 +48,8 @@ do_abandon(
 
        if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR, 
-                      "conn: %d do_abandon: ber_scanf failed\n",
-                      conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "conn: %d do_abandon: ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_abandon: ber_scanf failed\n", 0, 0 ,0 );
 #endif
@@ -66,16 +64,17 @@ do_abandon(
        } 
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_abandon: conn: %d  id=%ld\n", conn->c_connid, (long) id ));
+       LDAP_LOG( OPERATION, ARGS, "do_abandon: conn: %d  id=%ld\n", 
+               conn->c_connid, (long) id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "do_abandon: id=%ld\n", (long) id, 0 ,0 );
 #endif
 
        if( id <= 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                   "do_abandon: conn: %d bad msgid %ld\n", conn->c_connid, (long) id ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_abandon: conn: %d bad msgid %ld\n", 
+                       conn->c_connid, (long) id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_abandon: bad msgid %ld\n", (long) id, 0, 0 );
@@ -109,9 +108,9 @@ done:
        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( OPERATION, ENTRY, 
                "do_abandon: conn: %d op=%ld %sfound\n",
-               conn->c_connid, (long)id, o ? "" : "not " ));
+               conn->c_connid, (long)id, o ? "" : "not " );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n",
                (long) id, o ? "" : "not ", 0 );
index 2318cbffd508eebd7ba923c6b51f691271f395ce..c2f8641db8b8110309ce80d0f35509265432a890 100644 (file)
@@ -19,7 +19,6 @@
 
 #define ACL_BUF_SIZE   1024    /* use most appropriate size */
 
-
 /*
  * speed up compares
  */
@@ -122,6 +121,7 @@ access_allowed(
        int                             ret = 1;
        int                             count;
        AccessControl   *a;
+
 #ifdef LDAP_DEBUG
        char accessmaskbuf[ACCESSMASK_MAXLEN];
 #endif
@@ -152,9 +152,9 @@ access_allowed(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
-               "access_allowed: conn %lu %s access to \"%s\" \"%s\" requested\n",
-               conn ? conn->c_connid : -1, access2str( access ), e->e_dn, attr ));
+       LDAP_LOG( ACL, ENTRY, 
+               "access_allowed: %s access to \"%s\" \"%s\" requested\n",
+               access2str( access ), e->e_dn, attr );
 #else
        Debug( LDAP_DEBUG_ACL,
                "=> access_allowed: %s access to \"%s\" \"%s\" requested\n",
@@ -172,9 +172,9 @@ access_allowed(
        /* grant database root access */
        if ( be != NULL && be_isroot( be, &op->o_ndn ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
-                      "access_allowed: conn %lu root access granted\n",
-                      conn->c_connid));
+               LDAP_LOG( ACL, INFO, 
+                       "access_allowed: conn %lu root access granted\n", 
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                    "<= root access granted\n",
@@ -193,9 +193,9 @@ access_allowed(
                && desc != slap_schema.si_ad_children )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                      "access_allowed: conn %lu NoUserMod Operational attribute: %s access granted\n",
-                      conn->c_connid, attr ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "access_allowed: conn %lu NoUserMod Operational attribute: %s "
+                       "access granted\n", conn->c_connid, attr , 0 );
 #else
                Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:"
                        " %s access granted\n",
@@ -207,10 +207,11 @@ access_allowed(
        /* use backend default access if no backend acls */
        if( be != NULL && be->be_acl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                      "access_allowed: conn %lu backend default %s access %s to \"%s\"\n",
-                      conn->c_connid, access2str( access ),
-                      be->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "access_allowed: backend default %s access %s to \"%s\"\n",
+                   access2str( access ),
+                   be->be_dfltaccess >= access ? "granted" : "denied", 
+                       op->o_dn.bv_val );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: backend default %s access %s to \"%s\"\n",
@@ -225,10 +226,11 @@ access_allowed(
        /* use global default access if no global acls */
        } else if ( be == NULL && global_acl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                      "access_allowed: conn %lu global default %s access %s to \"%s\"\n",
-                      conn->c_connid, access2str( access ),
-                      global_default_access >= access ? "granted" : "denied", op->o_dn.bv_val ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "access_allowed: global default %s access %s to \"%s\"\n",
+                   access2str( access ),
+                   global_default_access >= access ? "granted" : "denied", 
+                       op->o_dn.bv_val );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: global default %s access %s to \"%s\"\n",
@@ -267,10 +269,9 @@ access_allowed(
 
                for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                           "access_allowed: conn %lu match[%d]:  %d %d ",
-                           conn->c_connid, i,
-                               (int)matches[i].rm_so, (int)matches[i].rm_eo ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "access_allowed: match[%d]:  %d %d ",
+                           i, (int)matches[i].rm_so, (int)matches[i].rm_eo );
 #else
                        Debug( LDAP_DEBUG_ACL, "=> match[%d]: %d %d ", i,
                            (int)matches[i].rm_so, (int)matches[i].rm_eo );
@@ -282,7 +283,7 @@ access_allowed(
                                }
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_ARGS, "\n" ));
+                       LDAP_LOG( ACL, ARGS, "\n" , 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
 #endif
@@ -301,9 +302,9 @@ vd_access:
 
        if ( ACL_IS_INVALID( mask ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                   "access_allowed: conn %lu    \"%s\" (%s) invalid!\n",
-                   conn->c_connid, e->e_dn, attr ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "access_allowed: conn %lu \"%s\" (%s) invalid!\n",
+                   conn->c_connid, e->e_dn, attr );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: \"%s\" (%s) invalid!\n",
@@ -313,9 +314,8 @@ vd_access:
 
        } else if ( control == ACL_BREAK ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                      "access_allowed: conn %lu         no more rules\n", 
-                      conn->c_connid ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "access_allowed: conn %lu        no more rules\n", conn->c_connid, 0,0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: no more rules\n", 0, 0, 0);
@@ -325,12 +325,10 @@ vd_access:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
-               "access_allowed: conn %lu  %s access %s by %s\n",
-               conn->c_connid,
-               access2str( access ),
-               ACL_GRANT( mask, access ) ? "granted" : "denied",
-               accessmask2str( mask, accessmaskbuf ) ));
+       LDAP_LOG( ACL, ENTRY, 
+               "access_allowed: %s access %s by %s\n", 
+               access2str( access ), ACL_GRANT( mask, access ) ? "granted" : "denied",
+               accessmask2str( mask, accessmaskbuf ) );
 #else
        Debug( LDAP_DEBUG_ACL,
                "=> access_allowed: %s access %s by %s\n",
@@ -398,9 +396,10 @@ acl_get(
                if ( a->acl_dn_pat.bv_len || ( a->acl_dn_style != ACL_STYLE_REGEX )) {
                        if ( a->acl_dn_style == ACL_STYLE_REGEX ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                          "acl_get: dnpat [%d] %s nsub: %d\n",
-                                          *count, a->acl_dn_pat.bv_val, (int) a->acl_dn_re.re_nsub ));
+                               LDAP_LOG( ACL, DETAIL1, 
+                                       "acl_get: dnpat [%d] %s nsub: %d\n",
+                                       *count, a->acl_dn_pat.bv_val, 
+                                       (int) a->acl_dn_re.re_nsub );
 #else
                                Debug( LDAP_DEBUG_ACL, "=> dnpat: [%d] %s nsub: %d\n", 
                                        *count, a->acl_dn_pat.bv_val, (int) a->acl_dn_re.re_nsub );
@@ -410,9 +409,8 @@ acl_get(
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                          "acl_get: dn [%d] %s\n",
-                                          *count, a->acl_dn_pat.bv_val ));
+                               LDAP_LOG( ACL, DETAIL1, "acl_get: dn [%d] %s\n",
+                                          *count, a->acl_dn_pat.bv_val, 0 );
 #else
                                Debug( LDAP_DEBUG_ACL, "=> dn: [%d] %s\n", 
                                        *count, a->acl_dn_pat.bv_val, 0 );
@@ -455,9 +453,8 @@ acl_get(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_get: [%d] matched\n",
-                                  *count ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_get: [%d] matched\n", *count, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] matched\n",
                                *count, 0, 0 );
@@ -472,9 +469,8 @@ acl_get(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                          "acl_get: [%d] check attr %s\n",
-                          *count, attr ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "acl_get: [%d] check attr %s\n", *count, attr ,0 );
 #else
                Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] check attr %s\n",
                       *count, attr, 0);
@@ -483,9 +479,8 @@ acl_get(
                        ad_inlist( desc, a->acl_attrs ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_get:  [%d] acl %s attr: %s\n",
-                                  *count, e->e_dn, attr ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_get:  [%d] acl %s attr: %s\n", *count, e->e_dn, attr );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "<= acl_get: [%d] acl %s attr: %s\n",
@@ -497,8 +492,7 @@ acl_get(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
-                  "acl_get: done.\n" ));
+       LDAP_LOG( ACL, RESULTS, "acl_get: done.\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 );
 #endif
@@ -559,15 +553,14 @@ acl_mask(
        assert( attr != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
-                  "acl_mask: conn %lu  access to entry \"%s\", attr \"%s\" requested\n",
-                  conn->c_connid, e->e_dn, attr ));
-
-       LDAP_LOG(( "acl", LDAP_LEVEL_ARGS,
-                  " to %s by \"%s\", (%s) \n",
-                  val ? "value" : "all values",
-                  op->o_ndn.bv_val ? op->o_ndn.bv_val : "",
-                  accessmask2str( *mask, accessmaskbuf ) ));
+       LDAP_LOG( ACL, ENTRY, 
+               "acl_mask: conn %lu  access to entry \"%s\", attr \"%s\" requested\n",
+               conn->c_connid, e->e_dn, attr );
+
+       LDAP_LOG( ACL, ARGS, 
+               " to %s by \"%s\", (%s) \n", val ? "value" : "all values",
+               op->o_ndn.bv_val ? op->o_ndn.bv_val : "",
+               accessmask2str( *mask, accessmaskbuf ) );
 #else
        Debug( LDAP_DEBUG_ACL,
                "=> acl_mask: access to entry \"%s\", attr \"%s\" requested\n",
@@ -599,9 +592,9 @@ acl_mask(
                /* AND <who> clauses */
                if ( b->a_dn_pat.bv_len != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_mask: conn %lu  check a_dn_pat: %s\n",
-                                  conn->c_connid, b->a_dn_pat.bv_val ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_mask: conn %lu  check a_dn_pat: %s\n",
+                               conn->c_connid, b->a_dn_pat.bv_val ,0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_dn_pat: %s\n",
                                b->a_dn_pat.bv_val, 0, 0);
@@ -723,9 +716,9 @@ dn_match_cleanup:;
 
                if ( b->a_sockurl_pat.bv_len ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_mask: conn %lu  check a_sockurl_pat: %s\n",
-                                  conn->c_connid, b->a_sockurl_pat.bv_val ));
+                                  conn->c_connid, b->a_sockurl_pat.bv_val , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_sockurl_pat: %s\n",
                                b->a_sockurl_pat.bv_val, 0, 0 );
@@ -747,9 +740,9 @@ dn_match_cleanup:;
 
                if ( b->a_domain_pat.bv_len ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_mask: conn %lu  check a_domain_pat: %s\n",
-                                  conn->c_connid, b->a_domain_pat.bv_val ));
+                                  conn->c_connid, b->a_domain_pat.bv_val , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
                                b->a_domain_pat.bv_val, 0, 0 );
@@ -801,9 +794,9 @@ dn_match_cleanup:;
 
                if ( b->a_peername_pat.bv_len ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_mask: conn %lu  check a_perrname_path: %s\n",
-                                  conn->c_connid, b->a_peername_pat.bv_val ));
+                                  conn->c_connid, b->a_peername_pat.bv_val , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
                                b->a_peername_pat.bv_val, 0, 0 );
@@ -824,9 +817,9 @@ dn_match_cleanup:;
 
                if ( b->a_sockname_pat.bv_len ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_mask: conn %lu  check a_sockname_path: %s\n",
-                                  conn->c_connid, b->a_sockname_pat.bv_val ));
+                                  conn->c_connid, b->a_sockname_pat.bv_val , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
                                b->a_sockname_pat.bv_val, 0, 0 );
@@ -859,9 +852,9 @@ dn_match_cleanup:;
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_mask: conn %lu  check a_dn_pat: %s\n",
-                                  conn->c_connid, attr ));
+                                  conn->c_connid, attr , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n",
                                attr, 0, 0);
@@ -970,9 +963,9 @@ dn_match_cleanup:;
 
                if ( b->a_authz.sai_ssf ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_mask: conn %lu  check a_authz.sai_ssf: ACL %u > OP %u\n",
-                                  conn->c_connid, b->a_authz.sai_ssf, op->o_ssf ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_mask: conn %lu  check a_authz.sai_ssf: ACL %u > OP %u\n",
+                               conn->c_connid, b->a_authz.sai_ssf, op->o_ssf  );
 #else
                        Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_ssf: ACL %u > OP %u\n",
                                b->a_authz.sai_ssf, op->o_ssf, 0 );
@@ -984,9 +977,11 @@ dn_match_cleanup:;
 
                if ( b->a_authz.sai_transport_ssf ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_mask: conn %lu  check a_authz.sai_transport_ssf: ACL %u > OP %u\n",
-                                  conn->c_connid, b->a_authz.sai_transport_ssf, op->o_transport_ssf ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_mask: conn %lu  check a_authz.sai_transport_ssf: "
+                               "ACL %u > OP %u\n",
+                               conn->c_connid, b->a_authz.sai_transport_ssf, 
+                               op->o_transport_ssf  );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "<= check a_authz.sai_transport_ssf: ACL %u > OP %u\n",
@@ -999,9 +994,10 @@ dn_match_cleanup:;
 
                if ( b->a_authz.sai_tls_ssf ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_mask: conn %lu  check a_authz.sai_tls_ssf: ACL %u > OP %u\n",
-                                  conn->c_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                               "acl_mask: conn %lu  check a_authz.sai_tls_ssf: ACL %u > "
+                               "OP %u\n",
+                               conn->c_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf  );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "<= check a_authz.sai_tls_ssf: ACL %u > OP %u\n",
@@ -1014,9 +1010,10 @@ dn_match_cleanup:;
 
                if ( b->a_authz.sai_sasl_ssf ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
-                                  "acl_mask: conn %lu check a_authz.sai_sasl_ssf: ACL %u > OP %u\n",
-                                  conn->c_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf ));
+                       LDAP_LOG( ACL, DETAIL1, 
+                          "acl_mask: conn %lu check a_authz.sai_sasl_ssf: " 
+                          "ACL %u > OP %u\n",
+                               conn->c_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "<= check a_authz.sai_sasl_ssf: ACL %u > OP %u\n",
@@ -1109,11 +1106,11 @@ dn_match_cleanup:;
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS,
-                          "acl_mask: conn %lu  [%d] applying %s (%s)\n",
-                          conn->c_connid, i, accessmask2str( modmask, accessmaskbuf),
+               LDAP_LOG( ACL, RESULTS, 
+                          "acl_mask: [%d] applying %s (%s)\n",
+                          i, accessmask2str( modmask, accessmaskbuf),
                           b->a_type == ACL_CONTINUE ? "continue" : b->a_type == ACL_BREAK
-                          ? "break" : "stop" ));
+                          ? "break" : "stop"  );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= acl_mask: [%d] applying %s (%s)\n",
@@ -1147,9 +1144,9 @@ dn_match_cleanup:;
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( ACL, DETAIL1, 
                           "acl_mask: conn %lu  [%d] mask: %s\n",
-                          conn->c_connid, i, accessmask2str( *mask, accessmaskbuf) ));
+                          conn->c_connid, i, accessmask2str( *mask, accessmaskbuf)  );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= acl_mask: [%d] mask: %s\n",
@@ -1171,9 +1168,9 @@ dn_match_cleanup:;
        ACL_INIT(*mask);
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS,
+       LDAP_LOG( ACL, RESULTS, 
                   "acl_mask: conn %lu  no more <who> clauses, returning %d (stop)\n",
-                  conn->c_connid, accessmask2str( *mask, accessmaskbuf) ));
+                  conn->c_connid, accessmask2str( *mask, accessmaskbuf) , 0 );
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= acl_mask: no more <who> clauses, returning %s (stop)\n",
@@ -1205,9 +1202,9 @@ acl_check_modlist(
        /* short circuit root database access */
        if ( be_isroot( be, &op->o_ndn ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( ACL, DETAIL1, 
                           "acl_check_modlist: conn %lu  access granted to root user\n",
-                          conn->c_connid ));
+                          conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= acl_access_allowed: granted to database root\n",
@@ -1219,10 +1216,11 @@ acl_check_modlist(
        /* use backend default access if no backend acls */
        if( be != NULL && be->be_acl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
-                          "acl_check_modlist: conn %lu  backend default %s access %s to \"%s\"\n",
-                          conn->c_connid, access2str( ACL_WRITE ),
-                          be->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", op->o_dn.bv_val ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "acl_check_modlist: backend default %s access %s to \"%s\"\n",
+                       access2str( ACL_WRITE ),
+                       be->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", 
+                       op->o_dn.bv_val  );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: backend default %s access %s to \"%s\"\n",
@@ -1236,10 +1234,11 @@ acl_check_modlist(
        /* use global default access if no global acls */
        } else if ( be == NULL && global_acl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
-                          "acl_check_modlist: conn %lu  global default %s access %s to \"%s\"\n",
-                          conn->c_connid, access2str( ACL_WRITE ),
-                          global_default_access >= ACL_WRITE ? "granted" : "denied", op->o_dn ));
+               LDAP_LOG( ACL, DETAIL1, 
+                       "acl_check_modlist: global default %s access %s to \"%s\"\n",
+                  access2str( ACL_WRITE ),
+                  global_default_access >= ACL_WRITE ? "granted" : "denied", 
+                  op->o_dn  );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: global default %s access %s to \"%s\"\n",
@@ -1261,9 +1260,9 @@ acl_check_modlist(
                 */
                if ( is_at_no_user_mod( mlist->sml_desc->ad_type ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( ACL, DETAIL1, 
                                   "acl_check_modlist: conn %lu  no-user-mod %s: modify access granted\n",
-                                  conn->c_connid, mlist->sml_desc->ad_cname.bv_val ));
+                                  conn->c_connid, mlist->sml_desc->ad_cname.bv_val , 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:"
                                " modify access granted\n",
@@ -1889,10 +1888,9 @@ string_expand(
        bv->bv_len = size;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
-                  "string_expand:  pattern = %.*s\n", (int)pat->bv_len, pat->bv_val ));
-       LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
-                  "string_expand:  expanded = %s\n", bv->bv_val ));
+       LDAP_LOG( ACL, DETAIL1, 
+          "string_expand:  pattern = %.*s\n", (int)pat->bv_len, pat->bv_val, 0 );
+       LDAP_LOG( ACL, DETAIL1, "string_expand:  expanded = %s\n", bv->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> string_expand: pattern:  %.*s\n", (int)pat->bv_len, pat->bv_val, 0 );
        Debug( LDAP_DEBUG_TRACE, "=> string_expand: expanded: %s\n", bv->bv_val, 0, 0 );
@@ -1923,9 +1921,9 @@ regex_matches(
                regerror(rc, &re, error, sizeof(error));
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "aci", LDAP_LEVEL_ERR,
+               LDAP_LOG( ACL, ERR, 
                           "regex_matches: compile( \"%s\", \"%s\") failed %s\n",
-                          pat->bv_val, str, error ));
+                          pat->bv_val, str, error  );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "compile( \"%s\", \"%s\") failed %s\n",
@@ -1938,11 +1936,9 @@ regex_matches(
        regfree( &re );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL2,
-                  "regex_matches: string:   %s\n", str ));
-       LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL2,
-                  "regex_matches: rc:  %d  %s\n",
-                  rc, rc ? "matches" : "no matches" ));
+       LDAP_LOG( ACL, DETAIL2, "regex_matches: string:   %s\n", str, 0, 0 );
+       LDAP_LOG( ACL, DETAIL2, "regex_matches: rc:     %d  %s\n",
+                  rc, rc ? "matches" : "no matches", 0  );
 #else
        Debug( LDAP_DEBUG_TRACE,
            "=> regex_matches: string:   %s\n", str, 0, 0 );
index 48411f3b9908f69031daf99e51cca56aa3940f4f..b43e78105212e139b353cecd8cec865f62203463 100644 (file)
@@ -50,8 +50,7 @@ do_add( Connection *conn, Operation *op )
        int     manageDSAit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "do_add: conn %d enter\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "do_add: conn %d enter\n", conn->c_connid,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
 #endif
@@ -70,8 +69,8 @@ do_add( Connection *conn, Operation *op )
        /* get the name */
        if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_add: conn %d ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_add: conn %d ber_scanf failed\n", conn->c_connid,0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -86,9 +85,8 @@ do_add( Connection *conn, Operation *op )
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_add: conn %d invalid dn (%s)\n", conn->c_connid,
-                               dn.bv_val ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_add: conn %d invalid dn (%s)\n", conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 );
 #endif
@@ -98,8 +96,8 @@ do_add( Connection *conn, Operation *op )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_add: conn %d  dn (%s)\n", conn->c_connid, e->e_dn ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "do_add: conn %d  dn (%s)\n", conn->c_connid, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 );
 #endif
@@ -115,8 +113,8 @@ do_add( Connection *conn, Operation *op )
 
                if ( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "do_add: conn %d      decoding error \n", conn->c_connid ));
+                       LDAP_LOG( OPERATION, ERR, 
+                                  "do_add: conn %d      decoding error \n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 );
 #endif
@@ -128,9 +126,9 @@ do_add( Connection *conn, Operation *op )
 
                if ( tmp.sml_bvalues == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                       LDAP_LOG( OPERATION, INFO, 
                                "do_add: conn %d         no values for type %s\n",
-                               conn->c_connid, tmp.sml_type.bv_val ));
+                               conn->c_connid, tmp.sml_type.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "no values for type %s\n",
                                tmp.sml_type.bv_val, 0, 0 );
@@ -153,8 +151,8 @@ do_add( Connection *conn, Operation *op )
 
        if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_add: conn %d ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_add: conn %d ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -166,8 +164,8 @@ do_add( Connection *conn, Operation *op )
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "do_add: conn %d get_ctrls failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "do_add: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -309,8 +307,8 @@ do_add( Connection *conn, Operation *op )
                }
        } else {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "do_add: conn %d  no backend support\n", conn->c_connid ));
+           LDAP_LOG( OPERATION, INFO, 
+                      "do_add: conn %d  no backend support\n", conn->c_connid, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ARGS, "    do_add: no backend support\n", 0, 0, 0 );
 #endif
index c521993c54bf3b9c66c667357e96ec052b9b444d..e0fdd8bb2e8decf242ae5c381d37f9d9d83996f9 100644 (file)
@@ -44,8 +44,7 @@ get_ava(
 
        if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "get_ava:  ber_scanf failure\n" ));
+               LDAP_LOG( FILTER, ERR, "get_ava:  ber_scanf failure\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "  get_ava ber_scanf\n", 0, 0, 0 );
 #endif
index 98fa9b85665a0c0e60fbc89325a5879ce13856ac..983ddd9dba9c5c56ab6d25c083c8f70a85c7885c 100644 (file)
@@ -41,7 +41,7 @@ bdb_add(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "add", LDAP_LEVEL_ARGS, "==> bdb_add: %s\n", e->e_dn ));
+       LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0);
 #endif
@@ -50,7 +50,8 @@ bdb_add(
        rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: entry failed schema check: %s (%d)\n", text, rc ));
+       LDAP_LOG ( OPERATION, ERR, 
+               "bdb_add: entry failed schema check: %s (%d)\n", text, rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_add: entry failed schema check: %s (%d)\n",
@@ -70,7 +71,8 @@ bdb_add(
        rc = bdb_next_id( be, NULL, &e->e_id );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: next_id failed (%d)\n", rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_add: next_id failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_add: next_id failed (%d)\n",
@@ -100,7 +102,8 @@ retry:      /* transaction retry */
        text = NULL;
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: txn_begin failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_add: txn_begin failed: %s (%d)\n", db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_add: txn_begin failed: %s (%d)\n",
@@ -182,7 +185,8 @@ retry:      /* transaction retry */
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent does not exist\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: parent does not exist\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_add: parent does not exist\n",
                                0, 0, 0 );
@@ -211,7 +215,8 @@ retry:      /* transaction retry */
 
                if ( ! rc ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no write access to parent\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: no write access to parent\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_add: no write access to parent\n",
                                0, 0, 0 );
@@ -225,7 +230,8 @@ retry:      /* transaction retry */
                if ( is_entry_subentry( p ) ) {
                        /* parent is a subentry, don't allow add */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is subentry\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: parent is subentry\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n",
                                0, 0, 0 );
@@ -239,7 +245,8 @@ retry:      /* transaction retry */
                if ( is_entry_alias( p ) ) {
                        /* parent is an alias, don't allow add */
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is alias\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: parent is alias\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is alias\n",
                                0, 0, 0 );
@@ -256,7 +263,8 @@ retry:      /* transaction retry */
                        BerVarray refs = get_entry_referrals( be, conn, op, p );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is referral\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: parent is referral\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is referral\n",
                                0, 0, 0 );
@@ -305,7 +313,8 @@ retry:      /* transaction retry */
 
                                if ( ! rc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no write access to parent\n" ));
+                                       LDAP_LOG ( OPERATION, DETAIL1, 
+                                               "bdb_add: no write access to parent\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "bdb_add: no write access to parent\n",
@@ -318,7 +327,8 @@ retry:      /* transaction retry */
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: %s denied\n", pdn.bv_len == 0 ? "suffix" : "entry at root" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n", 
+                                       pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "bdb_add: %s denied\n",
                                        pdn.bv_len == 0 ? "suffix" : "entry at root",
@@ -332,7 +342,8 @@ retry:      /* transaction retry */
 #ifdef BDB_SUBENTRIES
                if( subentry ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no parent, cannot add subentry\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_add: no parent, cannot add subentry\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_add: no parent, cannot add subentry\n",
@@ -358,7 +369,8 @@ retry:      /* transaction retry */
        rc = bdb_dn2id_add( be, ltid, &pdn, e );
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_add: dn2id_add failed: %s (%d)\n",
                        db_strerror(rc), rc, 0 );
@@ -381,7 +393,7 @@ retry:      /* transaction retry */
        rc = bdb_id2entry_add( be, ltid, e );
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: id2entry_add failed\n" ));
+               LDAP_LOG ( OPERATION, ERR, "bdb_add: id2entry_add failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_add: id2entry_add failed\n",
                        0, 0, 0 );
@@ -401,7 +413,8 @@ retry:      /* transaction retry */
        rc = bdb_index_entry_add( be, ltid, e, e->e_attrs );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: index_entry_add failed\n" ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_add: index_entry_add failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n",
                        0, 0, 0 );
@@ -471,7 +484,9 @@ retry:      /* transaction retry */
 
        if (rc == LDAP_SUCCESS) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_RESULTS, "bdb_add: added%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ));
+               LDAP_LOG ( OPERATION, RESULTS, 
+                       "bdb_add: added%s id=%08lx dn=\"%s\"\n", 
+                       op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
 #else
                Debug(LDAP_DEBUG_TRACE, "bdb_add: added%s id=%08lx dn=\"%s\"\n",
                        op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
@@ -481,7 +496,8 @@ retry:      /* transaction retry */
        }
        else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: %s : %s (%d)\n", text, db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_add: %s : %s (%d)\n",  text, db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
                        text, db_strerror(rc), rc );
index c05cfc393390b46624cc01f5b3531c55d89ef096..b60f82c8dedb33932c0a708859016aa4bdb86804 100644 (file)
@@ -181,9 +181,9 @@ bdb_attr_index_config(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BACK_BDB, DETAIL1, 
                        "attr_index_config: index %s 0x%04lx\n",
-                       ad->ad_cname.bv_val, mask ));
+                       ad->ad_cname.bv_val, mask, 0 );
 #else
                Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n",
                        ad->ad_cname.bv_val, mask, 0 ); 
index 1277f0256104f9addae957f37ed24829b19ed65a..b41177b4e74fdb4750091ca0a8c567b27646af43 100644 (file)
@@ -43,13 +43,12 @@ bdb_attribute(
        DB_LOCK         lock;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val ));
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "bdb_attribute: at: \"%s\"\n", entry_at_name));
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "bdb_attribute: tr dn: \"%s\"\n",
-               target ? target->e_ndn : "" ));
+       LDAP_LOG( BACK_BDB, ARGS, 
+               "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val, 0, 0 );
+       LDAP_LOG( BACK_BDB, ARGS, 
+               "bdb_attribute: at: \"%s\"\n", entry_at_name, 0, 0);
+       LDAP_LOG( BACK_BDB, ARGS, "bdb_attribute: tr dn: \"%s\"\n",
+               target ? target->e_ndn : "", 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_attribute: gr dn: \"%s\"\n",
@@ -77,9 +76,8 @@ bdb_attribute(
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "bdb_attribute: target is LOCKED (%s)\n",
-                       entry_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, DETAIL1, 
+                       "bdb_attribute: target is LOCKED (%s)\n", entry_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> bdb_attribute: target is entry: \"%s\"\n",
@@ -109,9 +107,9 @@ dn2entry_retry:
                }
                if (e == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "bdb_attribute: cannot find entry (%s)\n",
-                               entry_ndn->bv_val ));
+                       LDAP_LOG( BACK_BDB, INFO, 
+                               "bdb_attribute: cannot find entry (%s)\n", 
+                               entry_ndn->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> bdb_attribute: cannot find entry: \"%s\"\n",
@@ -124,9 +122,8 @@ dn2entry_retry:
                }
                
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "bdb_attribute: found entry (%s)\n",
-                       entry_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, DETAIL1, "bdb_attribute: found entry (%s)\n",
+                       entry_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> bdb_attribute: found entry: \"%s\"\n",
@@ -138,8 +135,8 @@ dn2entry_retry:
        /* find attribute values */
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_attribute: entry (%s) is an alias\n", e->e_dn ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_attribute: entry (%s) is an alias\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_attribute: entry is an alias\n", 0, 0, 0 );
@@ -151,8 +148,8 @@ dn2entry_retry:
 
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_attribute: entry (%s) is a referral.\n", e->e_dn ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_attribute: entry (%s) is a referral.\n", e->e_dn, 0, 0);
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_attribute: entry is a referral\n", 0, 0, 0 );
@@ -171,8 +168,8 @@ dn2entry_retry:
 
        if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_attribute: failed to find %s.\n", entry_at_name ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_attribute: failed to find %s.\n", entry_at_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_attribute: failed to find %s\n",
@@ -231,9 +228,7 @@ return_results:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "bdb_attribute: rc=%d nvals=%d.\n",
-               rc, j ));
+       LDAP_LOG( BACK_BDB, ENTRY, "bdb_attribute: rc=%d nvals=%d.\n", rc, j, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "bdb_attribute: rc=%d nvals=%d\n",
index be64c5b6a8c90ca587a63b51cbf81943868bf619..ebd4880642383e15872e3fc971ed94ef295cfc55 100644 (file)
@@ -44,7 +44,7 @@ bdb_bind(
        DB_LOCK         lock;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "bind", LDAP_LEVEL_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val ));
+       LDAP_LOG ( OPERATION, ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0);
 #endif
@@ -134,7 +134,8 @@ dn2entry_retry:
        if ( is_entry_subentry( e ) ) {
                /* entry is an subentry, don't allow bind */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is subentry\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_bind: entry is subentry\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0,
                        0, 0 );
@@ -151,7 +152,7 @@ dn2entry_retry:
        if ( is_entry_alias( e ) ) {
                /* entry is an alias, don't allow bind */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is alias\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, "bdb_bind: entry is alias\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0,
                        0, 0 );
@@ -170,7 +171,8 @@ dn2entry_retry:
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is referral\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_bind: entry is referral\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                        0, 0 );
index 18854548fed61a6764105066e3f1d7348f53a697..8f20bcee6ff0f1b9559a3a91b98d3d7f815cc12d 100644 (file)
@@ -49,9 +49,9 @@ static int
 bdb_cache_entry_rdwr_lock(Entry *e, int rw)
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_entry_rdwr_lock: %s lock on ID %ld\n",
-                  rw ? "w" : "r", e->e_id ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "bdb_cache_entry_rdwr_lock: %s lock on ID %ld\n",
+               rw ? "w" : "r", e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%slock: ID: %ld\n",
                rw ? "w" : "r", e->e_id, 0);
@@ -67,9 +67,9 @@ static int
 bdb_cache_entry_rdwr_trylock(Entry *e, int rw)
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_entry_rdwr_trylock: try %s lock on ID: %ld.\n",
-                  rw ? "w" : "r", e->e_id ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "bdb_cache_entry_rdwr_trylock: try %s lock on ID: %ld.\n",
+               rw ? "w" : "r", e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%strylock: ID: %ld\n",
                rw ? "w" : "r", e->e_id, 0);
@@ -85,9 +85,9 @@ static int
 bdb_cache_entry_rdwr_unlock(Entry *e, int rw)
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_entry_rdwr_unlock: remove %s lock on ID %ld.\n",
-                  rw ? "w" : "r", e->e_id ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "bdb_cache_entry_rdwr_unlock: remove %s lock on ID %ld.\n",
+               rw ? "w" : "r", e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%sunlock: ID: %ld\n",
                rw ? "w" : "r", e->e_id, 0);
@@ -232,9 +232,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "bdb_unlocked_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
-                          id, rw ? "w" : "r", refcnt ));
+                          id, rw ? "w" : "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_unlocked_cache_return_entry_%s( %ld ): created (%d)\n",
@@ -248,9 +248,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                        ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "bdb_unlocked_cache_return_entry_rw: %ld, delete pending (%d).\n",
-                                  id, refcnt ));
+                                  id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> bdb_unlocked_cache_return_entry_%s( %ld ): delete pending (%d)\n",
@@ -267,9 +267,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                        ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "bdb_unlocked_cache_return_entry_rw: (%ld): deleted (%d)\n",
-                                  id, refcnt ));
+                                  id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> bdb_unlocked_cache_return_entry_%s( %ld ): deleted (%d)\n",
@@ -282,9 +282,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "bdb_unlocked_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
-                          id, rw ? "w": "r", refcnt ));
+                          id, rw ? "w": "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_unlocked_cache_return_entry_%s( %ld ): returned (%d)\n",
@@ -335,9 +335,9 @@ bdb_cache_return_entry_rw
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "bdb_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
-                          id, rw ? "w" : "r", refcnt ));
+                          id, rw ? "w" : "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_cache_return_entry_%s( %ld ): created (%d)\n",
@@ -351,9 +351,9 @@ bdb_cache_return_entry_rw
                        ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "bdb_cache_return_entry_rw: %ld, delete pending (%d).\n",
-                                  id, refcnt ));
+                                  id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> bdb_cache_return_entry_%s( %ld ): delete pending (%d)\n",
@@ -370,9 +370,9 @@ bdb_cache_return_entry_rw
                        ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "bdb_cache_return_entry_rw: (%ld): deleted (%d)\n",
-                                  id, refcnt ));
+                                  id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> bdb_cache_return_entry_%s( %ld ): deleted (%d)\n",
@@ -385,9 +385,9 @@ bdb_cache_return_entry_rw
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "bdb_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
-                          id, rw ? "w": "r", refcnt ));
+                          id, rw ? "w": "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_cache_return_entry_%s( %ld ): returned (%d)\n",
@@ -442,9 +442,9 @@ bdb_cache_add_entry_rw(
        Entry   *ee;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_add_entry_rw: add (%s):%s to cache\n",
-                  e->e_dn, rw ? "w" : "r" ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "bdb_cache_add_entry_rw: add (%s):%s to cache\n",
+               e->e_dn, rw ? "w" : "r", 0 );
 #endif
        /* set cache write lock */
        ldap_pvt_thread_rdwr_wlock( &cache->c_rwlock );
@@ -456,9 +456,9 @@ bdb_cache_add_entry_rw(
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_ERR,
-                          "bdb_cache_add_entry_rw: add (%s):%ld private init failed!\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, ERR, 
+                       "bdb_cache_add_entry_rw: add (%s):%ld private init failed!\n",
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> bdb_cache_add_entry( %ld ): \"%s\": private init failed!\n",
@@ -476,9 +476,9 @@ bdb_cache_add_entry_rw(
                ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_add_entry: (%s):%ld already in cache.\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_add_entry: (%s):%ld already in cache.\n",
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_cache_add_entry( %ld ): \"%s\": already in dn cache\n",
@@ -495,9 +495,9 @@ bdb_cache_add_entry_rw(
                (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_add_entry: (%s):%ls already in cache.\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_add_entry: (%s):%ls already in cache.\n",
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> bdb_cache_add_entry( %ld ): \"%s\": already in id cache\n",
@@ -509,9 +509,9 @@ bdb_cache_add_entry_rw(
                        (AVL_CMP) entry_dn_cmp ) == NULL )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "bdb_cache_add_entry: can't delete (%s) from cache.\n",
-                                  e->e_dn ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_add_entry: can't delete (%s) from cache.\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
                            0, 0, 0 );
@@ -535,8 +535,9 @@ bdb_cache_add_entry_rw(
                if ( avl_delete( &cache->c_idtree, (caddr_t) e,
                        (AVL_CMP) entry_id_cmp ) == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                               "bdb_cache_add_entry: can't delete (%s) from cache.\n", e->e_dn ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_add_entry: can't delete (%s) from cache.\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from id cache\n", 0, 0, 0 );
 #endif
@@ -544,8 +545,9 @@ bdb_cache_add_entry_rw(
                if ( avl_delete( &cache->c_dntree, (caddr_t) e,
                                (AVL_CMP) entry_dn_cmp ) == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                       "bdb_cache_add_entry: can't delete (%s) from cache.\n", e->e_dn ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_add_entry: can't delete (%s) from cache.\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n", 0, 0, 0 );
 #endif
@@ -633,9 +635,9 @@ bdb_cache_update_entry(
                (AVL_CMP) entry_dn_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_update_entry: (%s):%ld already in dn cache\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_update_entry: (%s):%ld already in dn cache\n",
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> bdb_cache_update_entry( %ld ): \"%s\": already in dn cache\n",
@@ -652,9 +654,9 @@ bdb_cache_update_entry(
                (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_update_entry: (%s)%ld already in id cache\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_update_entry: (%s)%ld already in id cache\n",
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> bdb_cache_update_entry( %ld ): \"%s\": already in id cache\n",
@@ -666,9 +668,9 @@ bdb_cache_update_entry(
                        (AVL_CMP) entry_dn_cmp ) == NULL )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "bdb_cache_update_entry: can't delete (%s)%ld from dn cache.\n",
-                                  e->e_dn, e->e_id ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_update_entry: can't delete (%s)%ld from dn cache.\n",
+                               e->e_dn, e->e_id, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
                            0, 0, 0 );
@@ -778,9 +780,9 @@ try_again:
                        ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "bdb_cache_find_entry_dn2id: (%s) %ld not ready: %d\n",
-                                  ndn->bv_val, id, state ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_find_entry_dn2id: (%s) %ld not ready: %d\n",
+                               ndn->bv_val, id, state );
 #else
                        Debug(LDAP_DEBUG_TRACE,
                                "====> bdb_cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n",
@@ -806,9 +808,9 @@ try_again:
                ldap_pvt_thread_mutex_unlock( &cache->lru_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_find_entry_dn2id: (%s): %ld %d tries\n",
-                          ndn->bv_val, id, count ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_find_entry_dn2id: (%s): %ld %d tries\n",
+                       ndn->bv_val, id, count );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "====> bdb_cache_find_entry_dn2id(\"%s\"): %ld (%d tries)\n",
@@ -874,9 +876,9 @@ try_again:
                        ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "bdb_cache_find_entry_id: (%ld)->%ld not ready (%d).\n",
-                                  id, ep_id, state ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_find_entry_id: (%ld)->%ld not ready (%d).\n",
+                               id, ep_id, state );
                                   
 #else
                        Debug(LDAP_DEBUG_TRACE,
@@ -905,9 +907,9 @@ try_again:
                        ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "bdb_cache_find_entry_id: %ld -> %ld (busy) %d.\n",
-                                  id, ep_id, state ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "bdb_cache_find_entry_id: %ld -> %ld (busy) %d.\n",
+                               id, ep_id, state );
 #else
                        Debug(LDAP_DEBUG_TRACE,
                                "====> bdb_cache_find_entry_id( %ld ): %ld (busy) %d\n",
@@ -935,9 +937,9 @@ try_again:
                ldap_pvt_thread_mutex_unlock( &cache->lru_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_find_entry_id: %ld -> %s  found %d tries.\n",
-                          ep_id, ep->e_dn, count ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "bdb_cache_find_entry_id: %ld -> %s  found %d tries.\n",
+                       ep_id, ep->e_dn, count );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "====> bdb_cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n",
@@ -979,8 +981,8 @@ bdb_cache_delete_entry(
        assert( e->e_private );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_delete_entry: delete %ld.\n", e->e_id ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "bdb_cache_delete_entry: delete %ld.\n", e->e_id, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_delete_entry( %ld )\n",
                e->e_id, 0, 0 );
@@ -1047,8 +1049,7 @@ bdb_cache_release_all( Cache *cache )
        ldap_pvt_thread_mutex_lock( &cache->lru_mutex );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "bdb_cache_release_all: enter\n" ));
+       LDAP_LOG( CACHE, ENTRY, "bdb_cache_release_all: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_release_all\n", 0, 0, 0 );
 #endif
@@ -1067,8 +1068,8 @@ bdb_cache_release_all( Cache *cache )
 
        if ( cache->c_cursize ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                          "bdb_cache_release_all: Entry cache could not be emptied.\n" ));
+               LDAP_LOG( CACHE, INFO,
+                  "bdb_cache_release_all: Entry cache could not be emptied.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "Entry-cache could not be emptied\n", 0, 0, 0 );
 #endif
index ac799bb62777791701da86b2cd90c090a076f781..25c8cf4f9554480bd81db6913ce5238dda08b2ba 100644 (file)
@@ -88,7 +88,8 @@ dn2entry_retry:
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "compare", LDAP_LEVEL_DETAIL1,"bdb_compare: entry is referral\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_compare: entry is referral\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                        0, 0 );
index 85ed700fbba42bed33ffe66a739e4ad5c323f394..68efe9aad4b977a75807bbf050943257f318960e 100644 (file)
@@ -87,7 +87,9 @@ bdb_db_cache(
        rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ));
+               LDAP_LOG ( CACHE, ERR, 
+                       "bdb_db_cache: db_create(%s) failed: %s (%d)\n", 
+                       bdb->bi_dbenv_home, db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_db_cache: db_create(%s) failed: %s (%d)\n",
@@ -116,7 +118,9 @@ bdb_db_cache(
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", name, db_strerror(rc), rc ));
+               LDAP_LOG ( CACHE, ERR, 
+                       "bdb_db_cache: db_open(%s) failed: %s (%d)\n", 
+                       name, db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_db_cache: db_open(%s) failed: %s (%d)\n",
index 8c26e9a08054771297a633e2cfe9b428ed46f2b7..c15662b15d8b494a1c48e5c8b4a00618f71e51c4 100644 (file)
@@ -42,8 +42,7 @@ bdb_delete(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "delete", LDAP_LEVEL_ARGS, "==> bdb_delete: %s\n", 
-               dn->bv_val ));
+       LDAP_LOG ( OPERATION, ARGS,  "==> bdb_delete: %s\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n",
                dn->bv_val, 0, 0 );
@@ -55,8 +54,8 @@ retry:        /* transaction retry */
                        bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                       "==> bdb_delete: retrying...\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "==> bdb_delete: retrying...\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n",
                        0, 0, 0 );
@@ -78,9 +77,9 @@ retry:        /* transaction retry */
        text = NULL;
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "==> bdb_delete: txn_begin failed: %s (%d)\n",
-                       db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_delete: txn_begin failed: %s (%d)\n",
@@ -136,8 +135,8 @@ retry:      /* transaction retry */
 
                if( p == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                               "<=- bdb_delete: parent does not exist\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "<=- bdb_delete: parent does not exist\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<=- bdb_delete: parent does not exist\n",
@@ -163,8 +162,8 @@ retry:      /* transaction retry */
 
                if ( !rc  ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                               "<=- bdb_delete: no access to parent\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "<=- bdb_delete: no access to parent\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<=- bdb_delete: no access to parent\n",
@@ -194,8 +193,8 @@ retry:      /* transaction retry */
 
                                if ( !rc  ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                                               "<=- bdb_delete: no access to parent\n" ));
+                                       LDAP_LOG ( OPERATION, DETAIL1, 
+                                               "<=- bdb_delete: no access to parent\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "<=- bdb_delete: no access "
@@ -207,8 +206,8 @@ retry:      /* transaction retry */
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                                       "<=- bdb_delete: no parent and not root\n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "<=- bdb_delete: no parent and not root\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "<=- bdb_delete: no parent "
@@ -254,9 +253,8 @@ retry:      /* transaction retry */
                BerVarray refs;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ARGS, 
-                       "<=- bdb_delete: no such object %s\n",
-                       dn->bv_val ));
+               LDAP_LOG ( OPERATION, ARGS, 
+                       "<=- bdb_delete: no such object %s\n", dn->bv_val, 0, 0);
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "<=- bdb_delete: no such object %s\n",
@@ -292,8 +290,8 @@ retry:      /* transaction retry */
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                       "<=- bdb_delete: entry is referral\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "<=- bdb_delete: entry is referral\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_delete: entry is referral\n",
@@ -317,9 +315,8 @@ retry:      /* transaction retry */
                        goto retry;
                case 0:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
-                               "<=- bdb_delete: non-leaf %s\n",
-                               dn->bv_val ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "<=- bdb_delete: non-leaf %s\n", dn->bv_val, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS,
                                "<=- bdb_delete: non-leaf %s\n",
@@ -330,9 +327,9 @@ retry:      /* transaction retry */
                        break;
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( OPERATION, ERR, 
                                "<=- bdb_delete: has_children failed %s (%d)\n",
-                               db_strerror(rc), rc ));
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS,
                                "<=- bdb_delete: has_children failed: %s (%d)\n",
@@ -355,9 +352,8 @@ retry:      /* transaction retry */
                        rc = LDAP_OTHER;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
-                       "<=- bdb_delete: dn2id failed %s (%d)\n",
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_delete: dn2id failed %s (%d)\n", db_strerror(rc), rc, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS,
                        "<=- bdb_delete: dn2id failed: %s (%d)\n",
@@ -378,9 +374,9 @@ retry:      /* transaction retry */
                        rc = LDAP_OTHER;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
-                       "<=- bdb_delete: id2entry failed: %s (%d)\n",
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_delete: id2entry failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS,
                        "<=- bdb_delete: id2entry failed: %s (%d)\n",
@@ -401,8 +397,8 @@ retry:      /* transaction retry */
                        rc = LDAP_OTHER;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
-                       "<=- bdb_delete: entry index delete failed!\n" ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_delete: entry index delete failed!\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n",
                        0, 0, 0 );
@@ -429,10 +425,9 @@ retry:     /* transaction retry */
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "bdb_delete: txn_%s failed: %s (%d)\n",
-                       op->o_noop ? "abort (no-op)" : "commit",
-                       db_strerror(rc), rc ));
+                       op->o_noop ? "abort (no-op)" : "commit", db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_delete: txn_%s failed: %s (%d)\n",
@@ -444,10 +439,9 @@ retry:     /* transaction retry */
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "delete", LDAP_LEVEL_RESULTS, 
+               LDAP_LOG ( OPERATION, RESULTS, 
                        "bdb_delete: deleted%s id=%08lx db=\"%s\"\n",
-                       op->o_noop ? " (no-op)" : "",
-                       e->e_id, e->e_dn ));
+                       op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
index 497514113050e57a51ed8ceefc2739dff0c994da..c2817e23b22104671732c539b0c06adff54c940b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "back-bdb.h"
 
+
 /*
  * dn2entry - look up dn in the cache/indexes and return the corresponding
  * entry.
@@ -33,8 +34,7 @@ bdb_dn2entry_rw(
        ID              id, id2 = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2entry", LDAP_LEVEL_ARGS, "bdb_dn2entry_rw(\"%s\")\n",
-               dn->bv_val ));
+       LDAP_LOG ( CACHE, ARGS, "bdb_dn2entry_rw(\"%s\")\n", dn->bv_val, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry_rw(\"%s\")\n",
                dn->bv_val, 0, 0 );
index ea63172b6aa7f11d0a9b3197908f3116c66d53a5..9f4c5a5c0fba44a4be3973835c42f308aa86b133 100644 (file)
@@ -29,8 +29,8 @@ bdb_dn2id_add(
        struct berval   ptr, pdn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, "bdb_dn2id_add( \"%s\", 0x%08lx )\n",
-               e->e_ndn, (long) e->e_id ));
+       LDAP_LOG ( INDEX, ARGS, "bdb_dn2id_add( \"%s\", 0x%08lx )\n",
+               e->e_ndn, (long) e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_add( \"%s\", 0x%08lx )\n",
                e->e_ndn, (long) e->e_id, 0 );
@@ -57,9 +57,8 @@ bdb_dn2id_add(
        rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
-                       "bdb_dn2id_add: put failed: %s %d\n",
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( INDEX, ERR, "bdb_dn2id_add: put failed: %s %d\n",
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: put failed: %s %d\n",
                        db_strerror(rc), rc, 0 );
@@ -72,9 +71,9 @@ bdb_dn2id_add(
                rc = bdb_idl_insert_key( be, db, txn, &key, e->e_id );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
-                       "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
-                       ptr.bv_val, rc ));
+                       LDAP_LOG ( INDEX, ERR, 
+                               "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                        "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
@@ -95,9 +94,9 @@ bdb_dn2id_add(
 
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( INDEX, ERR, 
                                "=> bdb_dn2id_add: parent (%s) insert failed: %d\n",
-                               ptr.bv_val, rc ));
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_dn2id_add: parent (%s) insert failed: %d\n",
@@ -114,9 +113,9 @@ bdb_dn2id_add(
 
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( INDEX, ERR, 
                                "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
-                               ptr.bv_val, rc ));
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
@@ -135,8 +134,7 @@ bdb_dn2id_add(
 done:
        ch_free( buf );
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, 
-               "<= bdb_dn2id_add: %d\n", rc ));
+       LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_add: %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_add: %d\n", rc, 0, 0 );
 #endif
@@ -158,9 +156,8 @@ bdb_dn2id_delete(
        struct berval   pdn, ptr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, 
-               "=> bdb_dn2id_delete ( \"%s\", 0x08lx )\n", 
-               e->e_ndn, e->e_id ));
+       LDAP_LOG ( INDEX, ARGS, 
+               "=> bdb_dn2id_delete ( \"%s\", 0x%08lx )\n", e->e_ndn, e->e_id, 0);
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_delete( \"%s\", 0x%08lx )\n",
                e->e_ndn, e->e_id, 0 );
@@ -181,9 +178,9 @@ bdb_dn2id_delete(
        rc = db->del( db, txn, &key, 0 );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( INDEX, ERR, 
                        "=> bdb_dn2id_delete: delete failed: %s %d\n", 
-                       db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: delete failed: %s %d\n",
                        db_strerror(rc), rc, 0 );
@@ -196,9 +193,9 @@ bdb_dn2id_delete(
                rc = db->del( db, txn, &key, 0 );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
-                       "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", 
-                       ptr.bv_val, rc ));
+                       LDAP_LOG ( INDEX, ERR, 
+                               "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", 
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                        "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
@@ -219,9 +216,9 @@ bdb_dn2id_delete(
 
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( INDEX, ERR, 
                                "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n", 
-                               ptr.bv_val, rc ));
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n",
@@ -237,9 +234,9 @@ bdb_dn2id_delete(
                rc = bdb_idl_delete_key( be, db, txn, &key, e->e_id );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( INDEX, ERR, 
                                "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", 
-                               ptr.bv_val, rc ));
+                               ptr.bv_val, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
@@ -258,7 +255,7 @@ bdb_dn2id_delete(
 done:
        ch_free( buf );
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, "<= bdb_dn2id_delete %d\n", rc ));
+       LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_delete %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_delete %d\n", rc, 0, 0 );
 #endif
@@ -279,8 +276,7 @@ bdb_dn2id(
        DB *db = bdb->bi_dn2id->bdi_db;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, "=> bdb_dn2id( \"%s\" )\n", 
-       dn->bv_val ));
+       LDAP_LOG ( INDEX, ARGS, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
 #endif
@@ -309,17 +305,16 @@ bdb_dn2id(
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
-                       "<= bdb_dn2id: get failed %s (%d)\n", 
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( INDEX, ERR, "<= bdb_dn2id: get failed %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: get failed: %s (%d)\n",
                        db_strerror( rc ), rc, 0 );
 #endif
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, 
-                       "<= bdb_dn2id: got id=0x%08lx\n", *id ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_dn2id: got id=0x%08lx\n", *id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n",
                        *id, 0, 0 );
@@ -348,8 +343,8 @@ bdb_dn2id_matched(
        ID              cached_id;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, 
-               "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val ));
+       LDAP_LOG ( INDEX, ARGS, 
+               "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val, 0, 0 );
 #endif
@@ -395,8 +390,8 @@ bdb_dn2id_matched(
                                dnParent( &dn, &pdn );
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, 
-                                       "<= bdb_dn2id_matched: no match\n" ));
+                               LDAP_LOG ( INDEX, DETAIL1, 
+                                       "<= bdb_dn2id_matched: no match\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "<= bdb_dn2id_matched: no match\n",
@@ -412,10 +407,10 @@ bdb_dn2id_matched(
                } else if ( rc == 0 ) {
                        if( data.size != sizeof( ID ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, 
+                               LDAP_LOG ( INDEX, DETAIL1, 
                                        "<= bdb_dn2id_matched: get size mismatch:"
                                        "expected %ld, got %ld\n",
-                                       (long) sizeof(ID), (long) data.size ));
+                                       (long) sizeof(ID), (long) data.size, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "<= bdb_dn2id_matched: get size mismatch: "
@@ -429,9 +424,9 @@ bdb_dn2id_matched(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( INDEX, DETAIL1, 
                                "<= bdb_dn2id_matched: id=0x%08lx: %s %s\n",
-                               (long) *id, *id2 == 0 ? "entry" : "matched", dn.bv_val ));
+                               (long) *id, *id2 == 0 ? "entry" : "matched", dn.bv_val );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= bdb_dn2id_matched: id=0x%08lx: %s %s\n",
@@ -441,9 +436,9 @@ bdb_dn2id_matched(
 
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
+                       LDAP_LOG ( INDEX, ERR, 
                                "<= bdb_dn2id_matched: get failed: %s (%d)\n",
-                               db_strerror(rc), rc ));
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "<= bdb_dn2id_matched: get failed: %s (%d)\n",
@@ -471,8 +466,8 @@ bdb_dn2id_children(
        ID              id;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, 
-               "=> bdb_dn2id_children( %s )\n", dn->bv_val ));
+       LDAP_LOG ( INDEX, ARGS, 
+               "=> bdb_dn2id_children( %s )\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_children( %s )\n",
                dn->bv_val, 0, 0 );
@@ -496,10 +491,10 @@ bdb_dn2id_children(
        free( key.data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, 
+       LDAP_LOG ( INDEX, DETAIL1, 
                "<= bdb_dn2id_children( %s ): %schildren (%d)\n", 
                dn->bv_val, rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " :
-               db_strerror(rc)), rc ));
+               db_strerror(rc)), rc );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_children( %s ): %schildren (%d)\n",
                dn->bv_val,
@@ -523,8 +518,8 @@ bdb_dn2idl(
        DB *db = bdb->bi_dn2id->bdi_db;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, 
-               "=> bdb_dn2ididl( \"%s\" )\n", dn->bv_val ));
+       LDAP_LOG ( INDEX, ARGS, 
+               "=> bdb_dn2ididl( \"%s\" )\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2idl( \"%s\" )\n", dn->bv_val, 0, 0 );
 #endif
@@ -547,9 +542,8 @@ bdb_dn2idl(
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, 
-                       "<= bdb_dn2ididl: get failed: %s (%d)\n", 
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( INDEX, ERR, 
+                       "<= bdb_dn2ididl: get failed: %s (%d)\n", db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_dn2idl: get failed: %s (%d)\n",
@@ -558,10 +552,10 @@ bdb_dn2idl(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, 
+               LDAP_LOG ( INDEX, RESULTS, 
                        "<= bdb_dn2ididl: id=%ld first=%ld last=%ld\n", 
                        (long) ids[0], (long) BDB_IDL_FIRST( ids ), 
-                       (long) BDB_IDL_LAST( ids ) ));
+                       (long) BDB_IDL_LAST( ids ) );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_dn2idl: id=%ld first=%ld last=%ld\n",
index ba96309a390940ed192a23323aaa66ea22ac7cd7..c34b277df1316bdf3b19da4d4c4d09016fbfda2c 100644 (file)
@@ -16,7 +16,7 @@
 void bdb_errcall( const char *pfx, char * msg )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "error", LDAP_LEVEL_INFO, "bdb(%s): %s\n", pfx, msg ));
+       LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
 #endif
index a09bc1e3f4b578dcec590e8befcd484512c263a7..53289e7ffaf3ddf3356d583456b8853e933a1d68 100644 (file)
@@ -52,7 +52,7 @@ bdb_filter_candidates(
 {
        int rc = -1;
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_filter_candidates\n"));
+       LDAP_LOG ( INDEX, ENTRY, "=> bdb_filter_candidates\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 );
 #endif
@@ -60,7 +60,7 @@ bdb_filter_candidates(
        switch ( f->f_choice ) {
        case SLAPD_FILTER_DN_ONE:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tDN ONE\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN ONE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
 #endif
@@ -73,7 +73,7 @@ bdb_filter_candidates(
 
        case SLAPD_FILTER_DN_SUBTREE:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 );
 #endif
@@ -82,7 +82,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_PRESENT:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tPRESENT\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
 #endif
@@ -91,7 +91,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tEQUALITY\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
 #endif
@@ -100,7 +100,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_APPROX:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tAPPROX\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
 #endif
@@ -109,7 +109,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -119,7 +119,7 @@ bdb_filter_candidates(
        case LDAP_FILTER_GE:
                /* no GE index, use pres */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tGE\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
 #endif
@@ -129,7 +129,7 @@ bdb_filter_candidates(
        case LDAP_FILTER_LE:
                /* no LE index, use pres */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tLE\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
 #endif
@@ -139,7 +139,7 @@ bdb_filter_candidates(
        case LDAP_FILTER_NOT:
                /* no indexing to support NOT filters */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tNOT\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n",0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
 #endif
@@ -147,7 +147,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_AND:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tAND\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
 #endif
@@ -157,7 +157,7 @@ bdb_filter_candidates(
 
        case LDAP_FILTER_OR:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tOR\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
 #endif
@@ -167,7 +167,7 @@ bdb_filter_candidates(
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n"));
+               LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN %lu\n",
                        (unsigned long) f->f_choice, 0, 0 );
@@ -175,7 +175,9 @@ bdb_filter_candidates(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_filter_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+       LDAP_LOG ( INDEX, RESULTS, 
+               "=> bdb_filter_candidates: id=%ld first=%ld last=%ld\n", 
+               (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ));
 #else
        Debug( LDAP_DEBUG_FILTER,
                "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
@@ -201,7 +203,7 @@ list_candidates(
        Filter  *f;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_list_candidates: 0x%x\n", ftype));
+       LDAP_LOG ( INDEX, ARGS, "=> bdb_list_candidates: 0x%x\n", ftype, 0 , 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> bdb_list_candidates 0x%x\n", ftype, 0, 0 );
 #endif
@@ -237,7 +239,10 @@ list_candidates(
 
        if( rc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
+                       (long) ids[0], (long) BDB_IDL_FIRST( ids ), 
+                       (long) BDB_IDL_LAST( ids ) );
 #else
                Debug( LDAP_DEBUG_FILTER,
                        "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
@@ -248,7 +253,7 @@ list_candidates(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "<= bdb_list_candidates: rc=%d\n", rc));
+               LDAP_LOG ( INDEX, ARGS, "<= bdb_list_candidates: rc=%d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER,
                        "<= bdb_list_candidates: undefined rc=%d\n",
@@ -272,7 +277,7 @@ presence_candidates(
        struct berval prefix = {0};
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_presence_candidates\n"));
+       LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates\n", 0, 0, 0 );
 #endif
@@ -287,7 +292,8 @@ presence_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_presence_candidates: index_parm returned=%d\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "=> bdb_presence_candidates: index_parm returned=%d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_presence_candidates: index_param returned=%d\n",
@@ -299,7 +305,8 @@ presence_candidates(
        if( db == NULL ) {
                /* not indexed */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: not indexed\n" ));
+               LDAP_LOG(INDEX, RESULTS, 
+                       "<= bdb_presence_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_presence_candidates: not indexed\n",
@@ -310,7 +317,8 @@ presence_candidates(
 
        if( prefix.bv_val == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: no prefix\n" ));
+               LDAP_LOG(INDEX, RESULTS, 
+                       "<= bdb_presence_candidates: no prefix\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_presence_candidates: no prefix\n",
@@ -326,7 +334,8 @@ presence_candidates(
                rc = 0;
        } else if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: key read failed (%d)\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_presence_candidates: key read failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_presense_candidates: key read failed (%d)\n",
@@ -336,7 +345,9 @@ presence_candidates(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+       LDAP_LOG ( INDEX, RESULTS, 
+               "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
+               (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long)BDB_IDL_LAST( ids ) );
 #else
        Debug(LDAP_DEBUG_TRACE,
                "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
@@ -365,7 +376,7 @@ equality_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> equality_candidates\n"));
+       LDAP_LOG ( INDEX, ENTRY, "=> equality_candidates\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates\n", 0, 0, 0 );
 #endif
@@ -375,7 +386,8 @@ equality_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: index_param failed (%d)\n", rc));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "=> bdb_equality_candidates: index_param failed (%d)\n", rc, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_equality_candidates: index_param failed (%d)\n",
@@ -386,7 +398,8 @@ equality_candidates(
 
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: not indexed\n"));
+               LDAP_LOG(INDEX, RESULTS, 
+                       "=> bdb_equality_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_equality_candidates: not indexed\n", 0, 0, 0 );
@@ -414,7 +427,8 @@ equality_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: MR filter failed (%d)\n", rc));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "=> bdb_equality_candidates: MR filter failed (%d)\n", rc, 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_equality_candidates: MR filter failed (%d)\n",
@@ -425,7 +439,8 @@ equality_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: no keys\n"));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "=> bdb_equality_candidates: no keys\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_equality_candidates: no keys\n",
@@ -442,7 +457,8 @@ equality_candidates(
                        rc = 0;
                } else if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_equality_candidates: key read failed (%d)\n", rc));
+                       LDAP_LOG ( INDEX, RESULTS, 
+                               "<= bdb_equality_candidates: key read failed (%d)\n", rc, 0, 0);
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= bdb_equality_candidates key read failed (%d)\n",
@@ -453,7 +469,7 @@ equality_candidates(
 
                if( BDB_IDL_IS_ZERO( tmp ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: NULL\n"));
+                       LDAP_LOG ( INDEX, RESULTS, "=> bdb_equality_candidates: NULL\n", 0, 0, 0);
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= bdb_equality_candidates NULL\n",
@@ -472,7 +488,10 @@ equality_candidates(
        ber_bvarray_free( keys );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+       LDAP_LOG ( INDEX, RESULTS, 
+               "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n", 
+               (long) ids[0], (long) BDB_IDL_FIRST( ids ), 
+               (long) BDB_IDL_LAST( ids ) );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "<= bdb_equality_candidates id=%ld, first=%ld, last=%ld\n",
@@ -500,7 +519,7 @@ approx_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_approx_candidates\n"));
+       LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates\n", 0, 0, 0 );
 #endif
@@ -510,7 +529,8 @@ approx_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: index_param failed (%d)\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_approx_candidates: index_param failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_approx_candidates: index_param failed (%d)\n",
@@ -521,7 +541,8 @@ approx_candidates(
 
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: not indexed\n" ));
+               LDAP_LOG(INDEX, RESULTS, 
+                       "<= bdb_approx_candidates: not indexed\n",0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_approx_candidates: not indexed\n", 0, 0, 0 );
@@ -554,7 +575,8 @@ approx_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: MR filter failed (%d)\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_approx_candidates: MR filter failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_approx_candidates: (%s) MR filter failed (%d)\n",
@@ -565,7 +587,8 @@ approx_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: no keys (%s)\n", prefix.bv_val ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_approx_candidates: no keys (%s)\n", prefix.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_approx_candidates: no keys (%s)\n",
@@ -583,7 +606,8 @@ approx_candidates(
                        break;
                } else if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: key read failed (%d)\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_approx_candidates: key read failed (%d)\n", rc, 0, 0);
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates key read failed (%d)\n",
                                rc, 0, 0 );
@@ -593,7 +617,8 @@ approx_candidates(
 
                if( BDB_IDL_IS_ZERO( tmp ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: NULL\n" ));
+                       LDAP_LOG ( INDEX, RESULTS, 
+                               "<= bdb_approx_candidates: NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates NULL\n",
                                0, 0, 0 );
@@ -611,7 +636,10 @@ approx_candidates(
        ber_bvarray_free( keys );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+       LDAP_LOG ( INDEX, RESULTS, 
+               "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n", 
+               (long) ids[0], (long) BDB_IDL_FIRST( ids ), 
+               (long) BDB_IDL_LAST( ids ) );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n",
                (long) ids[0],
@@ -637,7 +665,7 @@ substring_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_substring_candidates\n"));
+       LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates\n", 0, 0, 0 );
 #endif
@@ -647,7 +675,8 @@ substring_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: index_param failed (%d)\n", rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_substring_candidates: index_param failed (%d)\n", rc, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_substring_candidates: index_param failed (%d)\n",
@@ -658,7 +687,8 @@ substring_candidates(
 
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: not indexed\n"));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_substring_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_substring_candidates not indexed\n",
@@ -688,7 +718,9 @@ substring_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n", sub->sa_desc->ad_cname.bv_val, rc ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n", 
+                       sub->sa_desc->ad_cname.bv_val, rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n",
@@ -699,7 +731,9 @@ substring_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n", mask, sub->sa_desc->ad_cname.bv_val ));
+               LDAP_LOG ( INDEX, RESULTS, 
+                       "<= bdb_substring_candidates: (%d) MR filter failed (%s)\n", 
+                       mask, sub->sa_desc->ad_cname.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
@@ -717,7 +751,8 @@ substring_candidates(
                        break;
                } else if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: key read failed (%d)\n", rc));
+                       LDAP_LOG ( INDEX, RESULTS, 
+                               "<= bdb_substring_candidates: key read failed (%d)\n", rc, 0,0);
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates key read failed (%d)\n",
                                rc, 0, 0 );
@@ -727,7 +762,8 @@ substring_candidates(
 
                if( BDB_IDL_IS_ZERO( tmp ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: NULL \n" ));
+                       LDAP_LOG ( INDEX, RESULTS, 
+                               "<= bdb_substring_candidates: NULL \n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates NULL\n",
                                0, 0, 0 );
@@ -745,7 +781,10 @@ substring_candidates(
        ber_bvarray_free( keys );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ));
+       LDAP_LOG ( INDEX, RESULTS, 
+               "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n",
+               (long) ids[0], (long) BDB_IDL_FIRST( ids ), 
+               (long) BDB_IDL_LAST( ids ) );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates %ld, first=%ld, last=%ld\n",
                (long) ids[0],
index 6c2cdf11330a3c7f9035248c16555a65ffa41101..59a33e94b387b6d93699bc98394b1fd4206fc281 100644 (file)
@@ -54,9 +54,9 @@ bdb_group(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( BACK_BDB, ENTRY, 
                "bdb_group: check (%s) member of (%s), oc %s\n",
-               op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ));
+               op_ndn->bv_val, gr_ndn->bv_val, group_oc_name );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_group: gr dn: \"%s\"\n",
@@ -88,8 +88,8 @@ bdb_group(
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "bdb_group: target is group (%s)\n", gr_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, DETAIL1, 
+                       "bdb_group: target is group (%s)\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> bdb_group: target is group: \"%s\"\n",
@@ -112,9 +112,8 @@ dn2entry_retry:
                }
                if (e == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "bdb_group: cannot find group (%s)\n",
-                               gr_ndn->bv_val ));
+                       LDAP_LOG( BACK_BDB, DETAIL1, 
+                               "bdb_group: cannot find group (%s)\n", gr_ndn->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> bdb_group: cannot find group: \"%s\"\n",
@@ -126,8 +125,8 @@ dn2entry_retry:
                        return( 1 );
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "bdb_group: found group (%s)\n", gr_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, DETAIL1, 
+                       "bdb_group: found group (%s)\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> bdb_group: found group: \"%s\"\n",
@@ -144,8 +143,8 @@ dn2entry_retry:
 #ifdef BDB_ALIASES
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_group: group (%s) is an alias\n", gr_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_group: group (%s) is an alias\n", gr_ndn->bv_val, 0, 0);
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_group: group is an alias\n", 0, 0, 0 );
@@ -156,8 +155,8 @@ dn2entry_retry:
 
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_group: group (%s) is a referral.\n", gr_ndn->bv_val ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_group: group (%s) is a referral.\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_group: group is a referral\n", 0, 0, 0 );
@@ -167,9 +166,9 @@ dn2entry_retry:
 
        if( !is_entry_objectclass( e, group_oc, 0 ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "bdb_group: failed to find %s in objectClass.\n",
-                       group_oc_name ));
+               LDAP_LOG( BACK_BDB, ERR, 
+                       "bdb_group: failed to find %s in objectClass.\n", 
+                       group_oc_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_group: failed to find %s in objectClass\n", 
@@ -180,8 +179,8 @@ dn2entry_retry:
 
        if ((attr = attr_find(e->e_attrs, group_at)) == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "bdb_group: failed to find %s\n", group_at_name ));
+               LDAP_LOG( BACK_BDB, INFO, 
+                       "bdb_group: failed to find %s\n", group_at_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_group: failed to find %s\n",
@@ -191,9 +190,9 @@ dn2entry_retry:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( BACK_BDB, ENTRY, 
                "bdb_group: found objectClass %s and %s\n",
-               group_oc_name, group_at_name ));
+               group_oc_name, group_at_name, 0 );
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= bdb_group: found objectClass %s and %s\n",
@@ -202,9 +201,9 @@ dn2entry_retry:
 
        if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BACK_BDB, DETAIL1, 
                        "bdb_group: \"%s\" not in \"%s\": %s\n",
-                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
+                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_group: \"%s\" not in \"%s\": %s\n", 
@@ -214,9 +213,8 @@ dn2entry_retry:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-               "bdb_group: %s is in %s: %s\n",
-               op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
+       LDAP_LOG( BACK_BDB, DETAIL1, "bdb_group: %s is in %s: %s\n",
+               op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= bdb_group: \"%s\" is in \"%s\": %s\n", 
@@ -236,8 +234,7 @@ return_results:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "bdb_group: rc=%d\n", rc ));
+       LDAP_LOG( BACK_BDB, ENTRY, "bdb_group: rc=%d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "bdb_group: rc=%d\n", rc, 0, 0 ); 
 #endif
index 175faa0bbdc742db7766b81ceebd02d4016c5670..4c445dbc271ac7669fd4fe76ab398ae56bdcdfc8 100644 (file)
@@ -36,9 +36,9 @@ static void idl_dump( ID *ids )
 {
        if( BDB_IDL_IS_RANGE( ids ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "IDL: range (%ld - %ld)\n",
+               LDAP_LOG( INDEX, INFO, "IDL: range (%ld - %ld)\n",
                        (long) BDB_IDL_RANGE_FIRST( ids ),
-                       (long) BDB_IDL_RANGE_LAST( ids ) ));
+                       (long) BDB_IDL_RANGE_LAST( ids ), 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "IDL: range ( %ld - %ld )\n",
@@ -49,8 +49,7 @@ static void idl_dump( ID *ids )
        } else {
                ID i;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "IDL: size %ld",
-                       (long) ids[0] ));
+               LDAP_LOG( INDEX, INFO, "IDL: size %ld", (long) ids[0], 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "IDL: size %ld", (long) ids[0], 0, 0 );
 #endif
@@ -60,7 +59,7 @@ static void idl_dump( ID *ids )
                                Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 );
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "%02lx",(long)ids[i] ));
+                       LDAP_LOG( INDEX, INFO, "%02lx",(long)ids[i], 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "  %02lx", (long) ids[i], 0, 0 );
 #endif
@@ -139,8 +138,7 @@ int bdb_idl_insert( ID *ids, ID id )
 
 #if IDL_DEBUG > 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "insert: %04lx at %d\n",
-                       (long) id, x ));
+       LDAP_LOG( INDEX, DETAIL1, "insert: %04lx at %d\n", (long) id, x, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "insert: %04lx at %d\n", (long) id, x, 0 );
        idl_dump( ids );
@@ -193,8 +191,7 @@ static int idl_delete( ID *ids, ID id )
 
 #if IDL_DEBUG > 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "delete: %04lx at %d\n",
-                       (long) id, x ));
+       LDAP_LOG( INDEX, DETAIL1, "delete: %04lx at %d\n", (long) id, x, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "delete: %04lx at %d\n", (long) id, x, 0 );
        idl_dump( ids );
@@ -267,7 +264,9 @@ bdb_idl_fetch_key(
                rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: cursor failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_fetch_key: cursor failed: %s (%d)\n", 
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                                "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
@@ -296,7 +295,10 @@ bdb_idl_fetch_key(
                        if (ids[1] == 0) {
                                if (ids[0] != BDB_IDL_RANGE_SIZE) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "=> bdb_idl_fetch_key: range size mismatch: expected %ld, got %ld\n", BDB_IDL_RANGE_SIZE, ids[0] ));
+                                       LDAP_LOG( INDEX, ERR, 
+                                               "=> bdb_idl_fetch_key: range size mismatch: "
+                                               "expected %ld, got %ld\n", 
+                                               BDB_IDL_RANGE_SIZE, ids[0], 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                                                "range size mismatch: expected %d, got %ld\n",
@@ -312,7 +314,9 @@ bdb_idl_fetch_key(
                rc2 = cursor->c_close( cursor );
                if (rc2) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: close failed: %s (%d)\n", db_strerror(rc2), rc2 ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_fetch_key: close failed: %s (%d)\n", 
+                               db_strerror(rc2), rc2, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                                "close failed: %s (%d)\n", db_strerror(rc2), rc2, 0 );
@@ -333,7 +337,9 @@ bdb_idl_fetch_key(
 
        } else if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: get failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_fetch_key: get failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                        "get failed: %s (%d)\n",
@@ -344,7 +350,9 @@ bdb_idl_fetch_key(
        } else if ( data.size == 0 || data.size % sizeof( ID ) ) {
                /* size not multiple of ID size */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: odd size: expected %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_fetch_key: odd size: expected %ld multiple, got %ld\n", 
+                       (long) sizeof( ID ), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                        "odd size: expected %ld multiple, got %ld\n",
@@ -355,7 +363,9 @@ bdb_idl_fetch_key(
        } else if ( data.size != BDB_IDL_SIZEOF(ids) ) {
                /* size mismatch */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: get size mismatch: expected %ld, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_fetch_key: get size mismatch: expected %ld, got %ld\n", 
+                       (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
                        "get size mismatch: expected %ld, got %ld\n",
@@ -385,7 +395,8 @@ bdb_idl_insert_key(
 #if 0
        /* for printable keys only */
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "idl", LDAP_LEVEL_ARGS, "bdb_idl_insert_key: %s %ld\n", (char *)key->data, (long) id ));
+       LDAP_LOG( INDEX, ARGS, "bdb_idl_insert_key: %s %ld\n", 
+               (char *)key->data, (long) id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_idl_insert_key: %s %ld\n",
@@ -409,7 +420,9 @@ bdb_idl_insert_key(
                rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
                if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: cursor failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_insert_key: cursor failed: %s (%d)\n", 
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                                "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
@@ -518,7 +531,9 @@ put1:                       data.data = &id;
                        /* initial c_get failed, nothing was done */
 fail:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: %s failed: %s (%d)\n", err, db_strerror(rc), rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_insert_key: %s failed: %s (%d)\n", 
+                               err, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                                "%s failed: %s (%d)\n", err, db_strerror(rc), rc );
@@ -543,7 +558,8 @@ fail:
 
        } else if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: get failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( INDEX, ERR, "bdb_idl_insert_key: get failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                        "get failed: %s (%d)\n",
@@ -554,7 +570,9 @@ fail:
        } else if ( data.size == 0 || data.size % sizeof( ID ) ) {
                /* size not multiple of ID size */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", 
+                       (long) sizeof( ID ), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                        "odd size: expected %ld multiple, got %ld\n",
@@ -565,7 +583,9 @@ fail:
        } else if ( data.size != BDB_IDL_SIZEOF(ids) ) {
                /* size mismatch */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", 
+                       (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                        "get size mismatch: expected %ld, got %ld\n",
@@ -587,7 +607,7 @@ fail:
 
                if( rc == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "bdb_idl_insert_key: dup\n" ));
+                       LDAP_LOG( INDEX, DETAIL1, "bdb_idl_insert_key: dup\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "=> bdb_idl_insert_key: dup\n",
                                0, 0, 0 );
@@ -596,7 +616,8 @@ fail:
                }
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: insert failed: (%d)\n", rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_insert_key: insert failed: (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                                "bdb_idl_insert failed (%d)\n",
@@ -616,7 +637,9 @@ fail:
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: put failed: (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_insert_key: put failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
                        "put failed: %s (%d)\n",
@@ -644,7 +667,8 @@ bdb_idl_delete_key(
 #if 0
        /* for printable keys only */
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "idl", LDAP_LEVEL_ARGS, "bdb_idl_delete_key: %s %ld\n", (char *)key->data, (long) id ));
+       LDAP_LOG( INDEX, ARGS, "bdb_idl_delete_key: %s %ld\n", 
+               (char *)key->data, (long) id, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_idl_delete_key: %s %ld\n",
@@ -669,7 +693,9 @@ bdb_idl_delete_key(
                rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
                if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: cursor failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_delete_key: cursor failed: %s (%d)\n", 
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                                "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
@@ -752,7 +778,9 @@ bdb_idl_delete_key(
                        /* initial c_get failed, nothing was done */
 fail:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: %s failed: %s (%d)\n", err, db_strerror(rc), rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_delete_key: %s failed: %s (%d)\n", 
+                               err, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                                "%s failed: %s (%d)\n", err, db_strerror(rc), rc );
@@ -772,7 +800,8 @@ fail:
 
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: get failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: get failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                        "get failed: %s (%d)\n",
@@ -783,7 +812,9 @@ fail:
        } else if ( data.size == 0 || data.size % sizeof( ID ) ) {
                /* size not multiple of ID size */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: odd size: expected: %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_delete_key: odd size: expected: %ld multiple, got %ld\n", 
+                       (long) sizeof( ID ), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                        "odd size: expected %ld multiple, got %ld\n",
@@ -797,7 +828,9 @@ fail:
        } else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
                /* size mismatch */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: get size mismatch: expected: %ld, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size ));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_idl_delete_key: get size mismatch: expected: %ld, got %ld\n", 
+                       (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                        "get size mismatch: expected %ld, got %ld\n",
@@ -810,7 +843,8 @@ fail:
 
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: delete failed: (%d)\n", rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                               "bdb_idl_delete_key: delete failed: (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                                "idl_delete failed (%d)\n",
@@ -824,7 +858,9 @@ fail:
                        rc = db->del( db, tid, key, 0 );
                        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: delete failed: %s (%d)\n", db_strerror(rc), rc ));
+                               LDAP_LOG( INDEX, ERR, 
+                                       "bdb_idl_delete_key: delete failed: %s (%d)\n",
+                                       db_strerror(rc), rc, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                                        "delete failed: %s (%d)\n",
@@ -844,7 +880,8 @@ fail:
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: put failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: put failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_idl_delete_key: put failed: %s (%d)\n",
index c4bb090f5703d23cc757f2bd9a68d35d5211d091..907b0589026509316ede79c6f40a47abab878b09 100644 (file)
@@ -168,8 +168,8 @@ static int indexer(
        
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "index", LDAP_LEVEL_ERR,
-                       "bdb_index_read: Could not open DB %s\n", dbname));
+               LDAP_LOG( INDEX, ERR, 
+                       "bdb_index_read: Could not open DB %s\n", dbname, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "<= bdb_index_read NULL (could not open %s)\n",
@@ -345,10 +345,8 @@ bdb_index_entry(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-               "index_entry: %s (%s) %ld\n",
-               op == SLAP_INDEX_ADD_OP ? "add" : "del",
-               e->e_dn, (long) e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "index_entry: %s (%s) %ld\n",
+               op == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_dn, (long) e->e_id );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
                op == SLAP_INDEX_ADD_OP ? "add" : "del",
@@ -362,8 +360,8 @@ bdb_index_entry(
 
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                               "index_entry: failure (%d)\n", rc ));
+                       LDAP_LOG( INDEX, ENTRY, 
+                               "index_entry: failure (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= index_entry_%s( %ld, \"%s\" ) failure\n",
@@ -375,8 +373,7 @@ bdb_index_entry(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-               "index_entry: success\n" ));
+       LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0  );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
                op == SLAP_INDEX_ADD_OP ? "add" : "del",
index 8563b3ee83a88388177fda06395349a6d4c5835e..5fe8baa358ada6836e0cf5022f7d1333bf126754 100644 (file)
@@ -61,7 +61,7 @@ bdb_db_init( BackendDB *be )
        struct bdb_info *bdb;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "init", LDAP_LEVEL_ENTRY, "bdb_db_init" ));
+       LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_init", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "bdb_db_init: Initializing BDB database\n",
@@ -126,7 +126,8 @@ static void *lock_detect_task( void *arg )
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_init: aborted %d locks\n", aborted ));
+               LDAP_LOG( BACK_BDB, ERR, "bdb_db_init: aborted %d locks\n", 
+                       aborted, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_lock_detect: aborted %d locks\n",
@@ -171,7 +172,8 @@ bdb_db_open( BackendDB *be )
        u_int32_t flags;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "init", LDAP_LEVEL_ARGS, "bdb_db_open: %s\n", be->be_suffix[0].bv_val ));
+       LDAP_LOG( BACK_BDB, ARGS, 
+               "bdb_db_open: %s\n", be->be_suffix[0].bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "bdb_db_open: %s\n",
@@ -183,7 +185,9 @@ bdb_db_open( BackendDB *be )
        rc = db_env_create( &bdb->bi_dbenv, 0 );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_env_create failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( BACK_BDB, ERR, 
+                       "bdb_db_open: db_env_create failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_db_open: db_env_create failed: %s (%d)\n",
@@ -212,7 +216,9 @@ bdb_db_open( BackendDB *be )
                rc = bdb->bi_dbenv->set_tmp_dir( bdb->bi_dbenv, dir );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n", 
+                               dir, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n",
@@ -226,7 +232,9 @@ bdb_db_open( BackendDB *be )
                rc = bdb->bi_dbenv->set_lg_dir( bdb->bi_dbenv, dir );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n", 
+                               dir, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n",
@@ -240,7 +248,9 @@ bdb_db_open( BackendDB *be )
                rc = bdb->bi_dbenv->set_data_dir( bdb->bi_dbenv, dir );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n",
+                               dir, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n",
@@ -252,7 +262,8 @@ bdb_db_open( BackendDB *be )
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "init", LDAP_LEVEL_DETAIL1, "bdb_db_open: dbenv_open %s\n", bdb->bi_dbenv_home ));
+       LDAP_LOG( BACK_BDB, DETAIL1, 
+               "bdb_db_open: dbenv_open %s\n", bdb->bi_dbenv_home, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "bdb_db_open: dbenv_open(%s)\n",
@@ -265,7 +276,9 @@ bdb_db_open( BackendDB *be )
                bdb->bi_dbenv_mode );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: dbenv_open failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG( BACK_BDB, ERR, 
+                       "bdb_db_open: dbenv_open failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_db_open: dbenv_open failed: %s (%d)\n",
@@ -279,7 +292,9 @@ bdb_db_open( BackendDB *be )
                        bdb->bi_dbenv_xflags, 1);
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: dbenv_set_flags failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: dbenv_set_flags failed: %s (%d)\n", 
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: dbenv_set_flags failed: %s (%d)\n",
@@ -303,7 +318,9 @@ bdb_db_open( BackendDB *be )
                rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: db_create(%s) failed: %s (%d)\n", 
+                               bdb->bi_dbenv_home, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: db_create(%s) failed: %s (%d)\n",
@@ -340,7 +357,9 @@ bdb_db_open( BackendDB *be )
 
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: db_create(%s) failed: %s (%d)\n", 
+                               bdb->bi_dbenv_home, db_strerror(rc), rc );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_open: db_open(%s) failed: %s (%d)\n",
@@ -360,7 +379,9 @@ bdb_db_open( BackendDB *be )
        rc = bdb_last_id( be, NULL );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: last_id(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_open: last_id(%s) failed: %s (%d)\n", 
+                               bdb->bi_dbenv_home, db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_db_open: last_id(%s) failed: %s (%d)\n",
@@ -419,7 +440,9 @@ bdb_db_destroy( BackendDB *be )
                rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
@@ -433,7 +456,9 @@ bdb_db_destroy( BackendDB *be )
                bdb->bi_dbenv = NULL;
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_destroy: close failed: %s (%d)\n", db_strerror(rc), rc ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_destroy: close failed: %s (%d)\n", 
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_destroy: close failed: %s (%d)\n",
@@ -490,7 +515,7 @@ bdb_initialize(
 
        /* initialize the underlying database system */
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "init", LDAP_LEVEL_ENTRY, "bdb_db_initialize\n" ));
+       LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_initialize\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n",
                0, 0, 0 );
@@ -505,7 +530,9 @@ bdb_initialize(
                        patch < DB_VERSION_PATCH )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_initialize: version mismatch: \texpected: %s \tgot: %s\n", DB_VERSION_STRING, version ));
+                       LDAP_LOG( BACK_BDB, ERR, 
+                               "bdb_db_initialize: version mismatch: "
+                               "\texpected: %s \tgot: %s\n", DB_VERSION_STRING, version, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_open: version mismatch\n"
@@ -515,7 +542,8 @@ bdb_initialize(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "init", LDAP_LEVEL_DETAIL1, "bdb_db_initialize: bdb_open: %s\n", version ));
+               LDAP_LOG( BACK_BDB, DETAIL1, 
+                       "bdb_db_initialize: bdb_open: %s\n", version, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n",
                        version, 0, 0 );
index a6b490f101cac5f2d2dcdc9f9e50987a9020face..46371dc519125a00ceb0e0b604787f1bda7c1662 100644 (file)
@@ -30,8 +30,7 @@ bdb_key_read(
        DBT key;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-               "key_read: enter\n" ));
+       LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
 #endif
@@ -45,17 +44,15 @@ bdb_key_read(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "index", LDAP_LEVEL_ERR,
-                       "bdb_key_read: failed (%d)\n",
-                       rc ));
+               LDAP_LOG( INDEX, ERR, "bdb_key_read: failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read: failed (%d)\n",
                        rc, 0, 0 );
 #endif
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "index", LDAP_LEVEL_DETAIL1,
-                       "bdb_key_read: %ld candidates\n", (long) BDB_IDL_N(ids) ));
+               LDAP_LOG( INDEX, DETAIL1, 
+                       "bdb_key_read: %ld candidates\n", (long)BDB_IDL_N(ids), 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read %ld candidates\n",
                        (long) BDB_IDL_N(ids), 0, 0 );
@@ -80,9 +77,8 @@ bdb_key_change(
        DBT     key;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_DETAIL1,
-               "key_change: %s ID %lx\n",
-               op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id ));
+       LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n",
+               op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
                op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
@@ -103,8 +99,7 @@ bdb_key_change(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_RESULTS,
-               "key_change: return %d\n", rc ));
+       LDAP_LOG( INDEX, RESULTS, "key_change: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
 #endif
index a6c80c3992387031425be0e5a378714532c7f43c..4f052e404ce7ad154f40c28389826ffcb1552116 100644 (file)
@@ -32,7 +32,8 @@ int bdb_modify_internal(
        Attribute       *ap;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY,"bdb_modify_internal: 0x%08lx: %s\n", e->e_id, e->e_dn ));
+       LDAP_LOG ( OPERATION, ENTRY, "bdb_modify_internal: 0x%08lx: %s\n", 
+               e->e_id, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "bdb_modify_internal: 0x%08lx: %s\n",
                e->e_id, e->e_dn, 0);
@@ -51,14 +52,15 @@ int bdb_modify_internal(
                switch ( mod->sm_op ) {
                case LDAP_MOD_ADD:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: add\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify_internal: add\n", 0,0,0);
 #else
                        Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: add\n", 0, 0, 0);
 #endif
                        err = modify_add_values( e, mod, text, textbuf, textlen );
                        if( err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: %d %s\n", err, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
                                        err, *text, 0);
@@ -68,7 +70,8 @@ int bdb_modify_internal(
 
                case LDAP_MOD_DELETE:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: delete\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_modify_internal: delete\n", 0, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: delete\n", 0, 0, 0);
 #endif
@@ -76,7 +79,8 @@ int bdb_modify_internal(
                        assert( err != LDAP_TYPE_OR_VALUE_EXISTS );
                        if( err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: %d %s\n", err, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
                                        err, *text, 0);
@@ -86,14 +90,16 @@ int bdb_modify_internal(
 
                case LDAP_MOD_REPLACE:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: replace\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_modify_internal: replace\n", 0, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: replace\n", 0, 0, 0);
 #endif
                        err = modify_replace_values( e, mod, text, textbuf, textlen );
                        if( err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: %d %s\n", err, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
                                        err, *text, 0);
@@ -103,7 +109,8 @@ int bdb_modify_internal(
 
                case SLAP_MOD_SOFTADD:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: softadd\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_modify_internal: softadd\n",0,0,0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: softadd\n", 0, 0, 0);
 #endif
@@ -119,7 +126,8 @@ int bdb_modify_internal(
 
                        if( err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: %d %s\n", err, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
                                        err, *text, 0);
@@ -129,7 +137,8 @@ int bdb_modify_internal(
 
                default:
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: invalid op %d\n", mod->sm_op ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ANY, "bdb_modify_internal: invalid op %d\n",
                                mod->sm_op, 0, 0);
@@ -137,7 +146,8 @@ int bdb_modify_internal(
                        *text = "Invalid modify operation";
                        err = LDAP_OTHER;
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: %d %s\n", err, *text, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
                                err, *text, 0);
@@ -173,7 +183,9 @@ int bdb_modify_internal(
                attrs_free( e->e_attrs );
                e->e_attrs = save_attrs;
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: entry failed schema check %s\n", *text ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: entry failed schema check %s\n", 
+                                       *text, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
                        *text, 0, 0 );
@@ -192,7 +204,9 @@ int bdb_modify_internal(
                                attrs_free( e->e_attrs );
                                e->e_attrs = save_attrs;
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: attribute index delete failure\n" ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: attribute index delete failure\n",
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "Attribute index delete failure",
@@ -213,7 +227,9 @@ int bdb_modify_internal(
                                attrs_free( e->e_attrs );
                                e->e_attrs = save_attrs;
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: attribute index add failure\n" ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modify_internal: attribute index add failure\n", 
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "Attribute index add failure",
@@ -253,7 +269,7 @@ bdb_modify(
        DB_LOCK         lock;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "bdb_modify: %s\n", dn->bv_val ));
+       LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "bdb_modify: %s\n", dn->bv_val, 0, 0 );
 #endif
@@ -265,7 +281,7 @@ retry:      /* transaction retry */
                        bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: retrying...\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: retrying...\n", 0, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "bdb_modify: retrying...\n", 0, 0, 0);
@@ -287,7 +303,8 @@ retry:      /* transaction retry */
        text = NULL;
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: txn_begin failed: %s (%d)\n",
@@ -310,7 +327,8 @@ retry:      /* transaction retry */
 
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: dn2entry failed: (%d)\n", rc ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_modify: dn2entry failed: (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: dn2entry failed (%d)\n",
@@ -365,7 +383,7 @@ retry:      /* transaction retry */
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: entry is referral\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: entry is referral\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: entry is referral\n",
@@ -385,7 +403,8 @@ retry:      /* transaction retry */
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: modify failed (%d)\n", rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modify: modify failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: modify failed (%d)\n",
@@ -403,7 +422,8 @@ retry:      /* transaction retry */
        rc = bdb_id2entry_update( be, ltid, e );
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: id2entry update failed (%d)\n", rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modify: id2entry update failed (%d)\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: id2entry update failed (%d)\n",
@@ -428,7 +448,9 @@ retry:      /* transaction retry */
 
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: txn_%s failed %s (%d)\n", op->o_noop ? "abort (no_op)" : "commit", db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modify: txn_%s failed %s (%d)\n", 
+                       op->o_noop ? "abort (no_op)" : "commit", db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: txn_%s failed: %s (%d)\n",
@@ -440,7 +462,9 @@ retry:      /* transaction retry */
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no_op)" : "", e->e_id, e->e_dn ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", 
+                       op->o_noop ? " (no_op)" : "", e->e_id, e->e_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modify: updated%s id=%08lx dn=\"%s\"\n",
index 439fcc2b5de47df2dca37c46af60cc96ffe7398d..da4ab3ec95b9e11bda48e4c8a4166554c5d6b649 100644 (file)
@@ -60,9 +60,8 @@ bdb_modrdn(
        DB_LOCK         lock;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "==>bdb_modrdn(%s,%s,%s)\n",
-               dn->bv_val,newrdn->bv_val,
-               newSuperior ? newSuperior->bv_val : "NULL" ));
+       LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", 
+               dn->bv_val,newrdn->bv_val, newSuperior ? newSuperior->bv_val : "NULL" );
 #else
        Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
                dn->bv_val, newrdn->bv_val,
@@ -90,7 +89,7 @@ retry:        /* transaction retry */
                        bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: retrying...\n"));
+               LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 );
 #endif
@@ -111,7 +110,9 @@ retry:      /* transaction retry */
        text = NULL;
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: txn_begin failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "==>bdb_modrdn: txn_begin failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_delete: txn_begin failed: %s (%d)\n",
@@ -181,7 +182,8 @@ retry:      /* transaction retry */
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry %s is referral \n", e->e_dn ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "==>bdb_modrdn: entry %s is referral \n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n",
                        e->e_dn, 0, 0 );
@@ -224,7 +226,8 @@ retry:      /* transaction retry */
 
                if( p == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: parent does not exist\n" ));
+                       LDAP_LOG ( OPERATION, ERR, 
+                               "==>bdb_modrdn: parent does not exist\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent does not exist\n",
                                0, 0, 0);
@@ -238,7 +241,8 @@ retry:      /* transaction retry */
                        children, NULL, ACL_WRITE, NULL ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" ));
+                       LDAP_LOG ( OPERATION, ERR, 
+                               "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
                                0, 0 );
@@ -249,7 +253,8 @@ retry:      /* transaction retry */
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modrdn: wr to children of entry %s OK\n",
@@ -263,7 +268,8 @@ retry:      /* transaction retry */
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modrdn: parent dn=%s\n",
@@ -288,7 +294,8 @@ retry:      /* transaction retry */
                                if ( ! rc )
                                {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" ));
+                                       LDAP_LOG ( OPERATION, ERR, 
+                                               "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE, 
                                                "no access to parent\n", 
@@ -301,7 +308,9 @@ retry:      /* transaction retry */
                                }
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children of entry \"\" OK\n", p_dn.bv_val ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: wr to children of entry \"%s\" OK\n", 
+                                       p_dn.bv_val, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: wr to children of entry \"\" OK\n",
@@ -312,7 +321,8 @@ retry:      /* transaction retry */
                                p_dn.bv_len = 0;
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=\"\" \n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: parent dn=\"\"\n",
@@ -321,7 +331,9 @@ retry:      /* transaction retry */
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no parent, not root &\"\" is not suffix\n" ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "==>bdb_modrdn: no parent, not root &\"\" is not "
+                                       "suffix\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: no parent, not root "
@@ -338,7 +350,9 @@ retry:      /* transaction retry */
 
        if ( newSuperior != NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: new parent \"%s\" requested...\n", newSuperior->bv_val ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "==>bdb_modrdn: new parent \"%s\" requested...\n", 
+                       newSuperior->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, 
                        "bdb_modrdn: new parent \"%s\" requested...\n",
@@ -373,7 +387,9 @@ retry:      /* transaction retry */
 
                        if( np == NULL) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: newSup(ndn=%s) not here!\n", np_ndn->bv_val ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: newSup(ndn=%s) not here!\n", 
+                                       np_ndn->bv_val, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: newSup(ndn=%s) not here!\n",
@@ -384,7 +400,9 @@ retry:      /* transaction retry */
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", np, (long) np->e_id ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", 
+                               np, (long) np->e_id, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
@@ -394,7 +412,8 @@ retry:      /* transaction retry */
                        /* check newSuperior for "children" acl */
                        if ( !access_allowed( be, conn, op, np, children, NULL, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: no wr to newSup children\n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: no wr to newSup children\n",
@@ -408,7 +427,8 @@ retry:      /* transaction retry */
                        if ( is_entry_alias( np ) ) {
                                /* parent is an alias, don't allow add */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is alias\n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: entry is alias\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n",
                                        0, 0, 0 );
@@ -422,7 +442,8 @@ retry:      /* transaction retry */
                        if ( is_entry_referral( np ) ) {
                                /* parent is a referral, don't allow add */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is referral\n" ));
+                               LDAP_LOG ( OPERATION, DETAIL1, 
+                                       "==>bdb_modrdn: entry is referral\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is referral\n",
                                        0, 0, 0 );
@@ -454,7 +475,8 @@ retry:      /* transaction retry */
                                        if ( ! rc )
                                        {
 #ifdef NEW_LOGGING
-                                               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to superior\n" ));
+                                               LDAP_LOG ( OPERATION, ERR, 
+                                                       "==>bdb_modrdn: no access to superior\n", 0, 0, 0 );
 #else
                                                Debug( LDAP_DEBUG_TRACE, 
                                                        "no access to new superior\n", 
@@ -467,7 +489,8 @@ retry:      /* transaction retry */
                                        }
 
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to children entry \"\" OK\n" ));
+                                       LDAP_LOG ( OPERATION, DETAIL1, 
+                                               "bdb_modrdn: wr to children entry \"\" OK\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "bdb_modrdn: wr to children of entry \"\" OK\n",
@@ -476,7 +499,9 @@ retry:      /* transaction retry */
                
                                } else {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new superior=\"\", not root & \"\" is not suffix\n" ));
+                                       LDAP_LOG ( OPERATION, ERR, 
+                                               "bdb_modrdn: new superior=\"\", not root & \"\" "
+                                               "is not suffix\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "bdb_modrdn: new superior=\"\", not root "
@@ -489,7 +514,8 @@ retry:      /* transaction retry */
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: new superior=\"\"\n" ));
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_modrdn: new superior=\"\"\n",
@@ -498,7 +524,8 @@ retry:      /* transaction retry */
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to new parent's children OK\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modrdn: wr to new parent's children OK\n",
@@ -514,7 +541,8 @@ retry:      /* transaction retry */
        dnNormalize2( NULL, &new_dn, &new_ndn );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val ));
+       LDAP_LOG ( OPERATION, RESULTS, 
+               "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s\n",
                new_ndn.bv_val, 0, 0 );
@@ -537,7 +565,8 @@ retry:      /* transaction retry */
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val ));
+       LDAP_LOG ( OPERATION, ERR, 
+               "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "bdb_modrdn: new ndn=%s does not exist\n",
@@ -551,7 +580,9 @@ retry:      /* transaction retry */
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of newrdn\n" ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modrdn: can't figure out type(s)/values(s) of newrdn\n", 
+                       0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modrdn: can't figure out type(s)/values(s) "
@@ -563,7 +594,9 @@ retry:      /* transaction retry */
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val ));
+       LDAP_LOG ( OPERATION, RESULTS, 
+               "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
+               new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
@@ -574,7 +607,9 @@ retry:      /* transaction retry */
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of old_rdn\n" ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modrdn: can't figure out type(s)/values(s) of old_rdn\n", 
+                       0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_back_modrdn: can't figure out the old_rdn "
@@ -591,7 +626,9 @@ retry:      /* transaction retry */
                                ( const char ** )new_rdn_types ) != 0 ) {
                /* Not a big deal but we may say something */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n", old_rdn_types[ 0 ], new_rdn_types[ 0 ] ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n",
+                   old_rdn_types[ 0 ], new_rdn_types[ 0 ], 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s "
@@ -611,7 +648,8 @@ retry:      /* transaction retry */
 
                if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (new)\n", text, new_rdn[0][a_cnt]->la_attr.bv_val ));
+                       LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (new)\n", 
+                               text, new_rdn[0][a_cnt]->la_attr.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_modrdn: %s: %s (new)\n",
@@ -624,7 +662,9 @@ retry:      /* transaction retry */
                if ( !access_allowed( be, conn, op, e, desc,
                        &new_rdn[0][ a_cnt ]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (new) not allowed\n", new_rdn[0][a_cnt]->la_attr.bv_val ));
+                       LDAP_LOG ( OPERATION, ERR, 
+                               "bdb_modrdn: access to attr \"%s\" (new) not allowed\n", 
+                               new_rdn[0][a_cnt]->la_attr.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_modrdn: access to attr \"%s\" "
@@ -652,7 +692,9 @@ retry:      /* transaction retry */
                /* Get value of old rdn */
                if ( old_rdn == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out old RDN values(s) from old RDN\n" ));
+                       LDAP_LOG ( OPERATION, ERR, 
+                               "bdb_modrdn: can't figure out old RDN values(s) "
+                               "from old RDN\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_modrdn: can't figure out old RDN value(s) "
@@ -673,7 +715,8 @@ retry:      /* transaction retry */
 
                        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (old)\n", text, old_rdn[0][d_cnt]->la_attr.bv_val ));
+                               LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (old)\n", 
+                                       text, old_rdn[0][d_cnt]->la_attr.bv_val, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: %s: %s (old)\n",
@@ -686,7 +729,9 @@ retry:      /* transaction retry */
                        if ( !access_allowed( be, conn, op, e, desc,
                                &old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (old) not allowed\n", old_rdn[0][d_cnt]->la_attr.bv_val ));
+                               LDAP_LOG ( OPERATION, ERR, 
+                                       "bdb_modrdn: access to attr \"%s\" (old) not allowed\n", 
+                                       old_rdn[0][d_cnt]->la_attr.bv_val, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_modrdn: access to attr \"%s\" "
@@ -813,7 +858,9 @@ retry:      /* transaction retry */
  
        if( rc == LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ));
+               LDAP_LOG ( OPERATION, RESULTS, 
+                       "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", 
+                       op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
@@ -824,7 +871,8 @@ retry:      /* transaction retry */
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: %s : %s (%d)\n", text, db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n", 
+                       text, db_strerror(rc), rc );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
                        text, db_strerror(rc), rc );
index f5d0e618b17508df03e4b6e47f82f37fcc9da5df..b9e4151b34aa715c2b2b1a72f9baff38f6591e5a 100644 (file)
@@ -58,9 +58,8 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid )
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "nextid", LDAP_LEVEL_ERR, 
-                       "bdb_last_id: get failed: %s (%d)\n",
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( INDEX, ERR, "bdb_last_id: get failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_last_id: get failed: %s (%d)\n",
index 9cff5cb3fc42316eced86b2192872d310e0372f9..cfcf17cdb3d02ec46f62cdd2c1354923b7ffca93 100644 (file)
@@ -33,7 +33,7 @@ bdb_operational(
        Attribute       **aa = a;
        int             rc;
        DB_TXN          *ltid = NULL;
-        struct bdb_op_info opinfo;
+    struct bdb_op_info opinfo;
        
        assert( e );
 
@@ -50,8 +50,8 @@ retry:        /* transaction retry */
                }
 #endif
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operational", LDAP_LEVEL_DETAIL1,
-                       "=> bdb_operational: retrying...\n" ));
+               LDAP_LOG ( OPERATION, DETAIL1, 
+                       "=> bdb_operational: retrying...\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "==> bdb_operational: retrying...\n", 
                                0, 0, 0 );
@@ -70,9 +70,9 @@ retry:        /* transaction retry */
        rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &ltid, bdb->bi_db_opflags );
        if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operational", LDAP_LEVEL_ERR,
+               LDAP_LOG ( OPERATION, ERR, 
                        "=> bdb_operational: txn_begin failed: %s (%d)\n",
-                        db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_operational: txn_begin failed: %s (%d)\n",
@@ -104,9 +104,9 @@ retry:      /* transaction retry */
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operational", LDAP_LEVEL_ERR,
+               LDAP_LOG ( OPERATION, ERR, 
                        "=> bdb_operational: has_children failed: %s (%d)\n",
-                        db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS, 
                        "<=- bdb_operational: has_children failed: %s (%d)\n", 
index 25f0c654ed7513a2184c6684b29b49dc0af7abc9..17d54cacc5a733022e1a2d18e0d5cc17a4040e53 100644 (file)
@@ -51,8 +51,8 @@ bdb_exop_passwd(
                &id, NULL, &new, text );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "passwd", LDAP_LEVEL_ENTRY, "==>bdb_exop_passwd: \"%s\"\n",
-               id.bv_val ? id.bv_val : "" ));
+       LDAP_LOG ( ACL, ENTRY, 
+               "==>bdb_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0, 0  );
 #else
        Debug( LDAP_DEBUG_ARGS, "==> bdb_exop_passwd: \"%s\"\n",
                id.bv_val ? id.bv_val : "", 0, 0 );
@@ -89,8 +89,8 @@ bdb_exop_passwd(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "passwd", LDAP_LEVEL_DETAIL1, "bdb_exop_passwd: \"%s\"%s\"\n",
-               dn.bv_val, id.bv_len ? " (proxy)" : "" ));
+       LDAP_LOG ( ACL, DETAIL1, "bdb_exop_passwd: \"%s\"%s\"\n",
+               dn.bv_val, id.bv_len ? " (proxy)" : "", 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: \"%s\"%s\n",
                dn.bv_val, id.bv_len ? " (proxy)" : "", 0 );
@@ -115,7 +115,7 @@ retry:      /* transaction retry */
                        bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "passwd", LDAP_LEVEL_DETAIL1, "bdb_exop_passwd: retrying...\n" ));
+               LDAP_LOG ( ACL, DETAIL1, "bdb_exop_passwd: retrying...\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: retrying...\n", 0, 0, 0 );
 #endif
@@ -136,7 +136,9 @@ retry:      /* transaction retry */
        *text = NULL;
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "passwd", LDAP_LEVEL_ERR, "bdb_exop_passwd: txn_begin failed: %s (%d)\n", db_strerror(rc), rc ));
+               LDAP_LOG ( ACL, ERR, 
+                       "bdb_exop_passwd: txn_begin failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_exop_passwd: txn_begin failed: %s (%d)\n",
index 4d60f68d0e83030029b78329c7c41b3424ea4b3f..07c85df4b360f08e9ecdb8430e91542cbb169ec7 100644 (file)
@@ -66,9 +66,9 @@ dn2entry_retry:
                goto dn2entry_retry;
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "referral", LDAP_LEVEL_ERR,
-                       "bdb_referrals: dn2entry failed: %s (%d)\n",
-                       db_strerror(rc), rc ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "bdb_referrals: dn2entry failed: %s (%d)\n", 
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_referrals: dn2entry failed: %s (%d)\n",
@@ -94,9 +94,9 @@ dn2entry_retry:
                        matched_dn = ch_strdup( matched->e_dn );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "referral", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG ( OPERATION, DETAIL1, 
                        "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       (long) op->o_tag, dn->bv_val, matched_dn ));
+                       (long) op->o_tag, dn->bv_val, matched_dn );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
@@ -139,9 +139,9 @@ dn2entry_retry:
                        refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "referral", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG ( OPERATION, DETAIL1, 
                        "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       (long) op->o_tag, dn->bv_val, e->e_dn ));
+                       (long) op->o_tag, dn->bv_val, e->e_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
index a68e17fb646e90400b4058bb1f660c30aea5f04b..44076d7abeed248791f8c46787c854fbf38065b1 100644 (file)
@@ -63,7 +63,7 @@ bdb_search(
        DB_LOCK         lock;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"bdb_back_search\n"));
+       LDAP_LOG ( OPERATION, ENTRY, "bdb_back_search\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_back_search\n",
                0, 0, 0);
@@ -175,7 +175,8 @@ dn2entry_retry:
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: entry is referral\n"));
+               LDAP_LOG ( OPERATION, RESULTS, 
+                       "bdb_search: entry is referral\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_search: entry is referral\n",
                        0, 0, 0 );
@@ -288,7 +289,7 @@ dn2entry_retry:
 
        if ( candidates[0] == 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: no candidates\n"));
+       LDAP_LOG ( OPERATION, RESULTS, "bdb_search: no candidates\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "bdb_search: no candidates\n",
                        0, 0, 0 );
@@ -349,7 +350,8 @@ id2entry_retry:
                        if( !BDB_IDL_IS_RANGE(candidates) ) {
                                /* only complain for non-range IDLs */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: candidate %ld not found\n", (long) id));
+                               LDAP_LOG ( OPERATION, RESULTS,
+                                       "bdb_search: candidate %ld not found\n", (long) id, 0, 0);
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_search: candidate %ld not found\n",
@@ -411,7 +413,8 @@ id2entry_retry:
                        } else if ( dnIsSuffix( &e->e_nname, &realbase ) ) {
                                /* alias is within scope */
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: \"%s\" in subtree\n", e->edn));
+                               LDAP_LOG ( OPERATION, RESULTS,
+                                       "bdb_search: \"%s\" in subtree\n", e->edn, 0, 0);
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_search: \"%s\" in subtree\n",
@@ -466,9 +469,9 @@ id2entry_retry:
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2,
+                               LDAP_LOG(OPERATION, DETAIL2, 
                                        "bdb_search: candidate referral %ld scope not okay\n",
-                                       id ));
+                                       id, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_search: candidate referral %ld scope not okay\n",
@@ -536,7 +539,8 @@ id2entry_retry:
                                }
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: %ld scope not okay\n", (long) id));
+                               LDAP_LOG ( OPERATION, RESULTS,
+                                       "bdb_search: %ld scope not okay\n", (long) id, 0, 0);
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "bdb_search: %ld scope not okay\n",
@@ -545,7 +549,8 @@ id2entry_retry:
                        }
                } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: %ld does match filter\n", (long) id));
+                               LDAP_LOG ( OPERATION, RESULTS,
+                                       "bdb_search: %ld does match filter\n", (long) id, 0, 0);
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "bdb_search: %ld does match filter\n",
@@ -589,7 +594,8 @@ static int base_candidate(
        ID              *ids )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"base_candidate: base: \"%s\" (0x%08lx)\n", e->e_dn, (long) e->e_id));
+       LDAP_LOG ( OPERATION, ENTRY,
+               "base_candidate: base: \"%s\" (0x%08lx)\n", e->e_dn, (long) e->e_id, 0);
 #else
        Debug(LDAP_DEBUG_ARGS, "base_candidates: base: \"%s\" (0x%08lx)\n",
                e->e_dn, (long) e->e_id, 0);
@@ -669,7 +675,9 @@ static int search_candidates(
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", e->e_dn, (long) e->e_id, scope));
+       LDAP_LOG ( OPERATION, ENTRY,
+               "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", 
+               e->e_dn, (long) e->e_id, scope);
 #else
        Debug(LDAP_DEBUG_TRACE,
                "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n",
@@ -741,7 +749,8 @@ static int search_candidates(
 
        if( rc ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "search", LDAP_LEVEL_DETAIL1,"bdb_search_candidates: failed (rc=%d)\n", rc));
+               LDAP_LOG ( OPERATION, DETAIL1,
+                       "bdb_search_candidates: failed (rc=%d)\n", rc, 0, 0  );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "bdb_search_candidates: failed (rc=%d)\n",
@@ -750,7 +759,10 @@ static int search_candidates(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "search", LDAP_LEVEL_DETAIL1,"bdb_search_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids)));
+               LDAP_LOG ( OPERATION, DETAIL1,
+                       "bdb_search_candidates: id=%ld first=%ld last=%ld\n",
+                       (long) ids[0], (long) BDB_IDL_FIRST(ids), 
+                       (long) BDB_IDL_LAST(ids));
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "bdb_search_candidates: id=%ld first=%ld last=%ld\n",
index 0203ef71068b7ede316b0f0bc60d540f3d00abc4..1056944ebd255be7170b73275a5ca7b9c41ac04c 100644 (file)
@@ -126,9 +126,8 @@ ID bdb_tool_entry_put(
        assert( text->bv_val[0] == '\0' );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "tools", LDAP_LEVEL_ARGS,
-               "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
-               (long) e->e_id, e->e_dn ));
+       LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
+               (long) e->e_id, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
                (long) e->e_id, e->e_dn, 0 );
@@ -141,8 +140,7 @@ ID bdb_tool_entry_put(
                        "txn_begin failed: %s (%d)",
                        db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-               "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+       LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n",
@@ -157,8 +155,8 @@ ID bdb_tool_entry_put(
                                "next_id failed: %s (%d)",
                                db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                       "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+               LDAP_LOG ( TOOLS, ERR, 
+                       "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
@@ -178,8 +176,8 @@ ID bdb_tool_entry_put(
                                "dn2id_add failed: %s (%d)",
                                db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                       "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+               LDAP_LOG ( TOOLS, ERR, 
+                       "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
@@ -194,8 +192,8 @@ ID bdb_tool_entry_put(
                                "id2entry_add failed: %s (%d)",
                                db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                       "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+               LDAP_LOG ( TOOLS, ERR, 
+                       "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
@@ -209,8 +207,8 @@ ID bdb_tool_entry_put(
                                "index_entry_add failed: %s (%d)",
                                db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                       "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+               LDAP_LOG ( TOOLS, ERR, 
+                       "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
@@ -226,8 +224,8 @@ done:
                                        "txn_commit failed: %s (%d)",
                                        db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                               "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+                       LDAP_LOG ( TOOLS, ERR, 
+                               "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_tool_entry_put: %s\n",
@@ -242,8 +240,8 @@ done:
                        "txn_aborted! %s (%d)",
                        db_strerror(rc), rc );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-                       "=> bdb_tool_entry_put: %s\n", text->bv_val ));
+               LDAP_LOG ( TOOLS, ERR, 
+                       "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_put: %s\n",
@@ -266,8 +264,8 @@ int bdb_tool_entry_reindex(
        struct berval pdn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "tools", LDAP_LEVEL_ARGS,
-               "=> bdb_tool_entry_reindex( %ld )\n", (long) id ));
+       LDAP_LOG ( TOOLS, ARGS, 
+               "=> bdb_tool_entry_reindex( %ld )\n", (long) id, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "=> bdb_tool_entry_reindex( %ld )\n",
                (long) id, 0, 0 );
@@ -277,9 +275,9 @@ int bdb_tool_entry_reindex(
 
        if( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG ( TOOLS, DETAIL1, 
                        "bdb_tool_entry_reindex:: could not locate id=%ld\n", 
-                       (long) id ));
+                       (long) id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "bdb_tool_entry_reindex:: could not locate id=%ld\n",
@@ -291,9 +289,9 @@ int bdb_tool_entry_reindex(
        rc = TXN_BEGIN( bi->bi_dbenv, NULL, &tid, bi->bi_db_opflags );
        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
+               LDAP_LOG ( TOOLS, ERR, 
                        "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n", 
-                       db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n",
@@ -310,9 +308,8 @@ int bdb_tool_entry_reindex(
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
-               "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", 
-                       (long) id, e->e_dn ));
+       LDAP_LOG ( TOOLS, ERR, 
+               "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", (long) id, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n",
                (long) id, e->e_dn, 0 );
@@ -327,9 +324,9 @@ int bdb_tool_entry_reindex(
        rc = bdb_dn2id_add( be, tid, &pdn, e );
        if( rc != 0 && rc != DB_KEYEXIST ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
+               LDAP_LOG ( TOOLS, ERR, 
                        "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n", 
-                       db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n",
@@ -345,9 +342,9 @@ done:
                rc = TXN_COMMIT( tid, 0 );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "tools", LDAP_LEVEL_ERR,
+                       LDAP_LOG ( TOOLS, ERR, 
                                "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n", 
-                               db_strerror(rc), rc ));
+                               db_strerror(rc), rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n",
@@ -359,9 +356,9 @@ done:
        } else {
                TXN_ABORT( tid );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "tools", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG ( TOOLS, DETAIL1, 
                        "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n", 
-                       db_strerror(rc), rc ));
+                       db_strerror(rc), rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n",
index 2eb05502b127b9b0e7b2d3ec5272a0916eeb70cb..b947441efb5721e68411cbe377d4eb3fa66ddd61 100644 (file)
@@ -62,8 +62,7 @@ ldap_back_add(
        struct berval mdn = { 0, NULL };
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "ldap_back_add: %s\n",
-                               e->e_dn ));
+       LDAP_LOG( BACK_LDAP, ENTRY, "ldap_back_add: %s\n", e->e_dn, 0, 0 );
 #else /* !NEW_LOGGING */
        Debug(LDAP_DEBUG_ARGS, "==> ldap_back_add: %s\n", e->e_dn, 0, 0);
 #endif /* !NEW_LOGGING */
@@ -86,9 +85,8 @@ ldap_back_add(
                        mdn = e->e_name;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] addDn: \"%s\" -> \"%s\"\n",
-                                       e->e_dn, mdn.bv_val ));         
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] addDn: \"%s\" -> \"%s\"\n", e->e_dn, mdn.bv_val, 0 );             
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s", 
                                e->e_dn, mdn.bv_val, "" );
@@ -202,10 +200,9 @@ ldap_dnattr_rewrite(
                                continue;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] bindDn (in add of dn-valued"
-                                       " attr): \"%s\" -> \"%s\"\n",
-                                       a_vals->bv_val, mattr ));
+                       LDAP_LOG( BACK_LDAP, DETAIL1, 
+                               "[rw] bindDn (in add of dn-valued"
+                               " attr): \"%s\" -> \"%s\"\n", a_vals->bv_val, mattr, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> bindDn (in add of dn-valued attr):"
index c0e532930a884995f4ddb0b0b37b2248651037fd..32d432c285c7c39496210860701bfde1c6b64d3b 100644 (file)
@@ -84,8 +84,8 @@ ldap_back_bind(
                        mdn.bv_val = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn.bv_val, "" );
@@ -258,11 +258,11 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                                        ber_dupbv( &lc->bound_dn, &lc->conn->c_dn );
                                }
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                               "[rw] bindDn: \"%s\" ->"
+                               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                                               "[rw] bindDn: \"%s\" ->" 
                                                " \"%s\"\n%s",
-                                               lc->conn->c_dn.bv_val,
-                                               lc->bound_dn.bv_val ));
+                                               lc->conn->c_dn.bv_val, 
+                                               lc->bound_dn.bv_val, "" );
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ARGS,
                                                "rw> bindDn: \"%s\" ->"
@@ -312,9 +312,8 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "ldap_back_getconn: conn %ld inserted\n",
-                               lc->conn->c_connid ));
+               LDAP_LOG( BACK_LDAP, INFO, 
+                       "ldap_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0);
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>ldap_back_getconn: conn %ld inserted\n%s%s",
@@ -330,9 +329,9 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                }
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "ldap_back_getconn: conn %ld inserted\n",
-                               lc->conn->c_connid ));
+               LDAP_LOG( BACK_LDAP, INFO, 
+                       "ldap_back_getconn: conn %ld inserted\n", 
+                       lc->conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>ldap_back_getconn: conn %ld fetched%s%s\n",
index b926639b26e9d3eba86680791a64b337039373c1..d7d1f77f9de07d4cd44fcea86eab010de127061b 100644 (file)
@@ -75,9 +75,8 @@ ldap_back_compare(
                        mdn.bv_val = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] compareDn: \"%s\" -> \"%s\"\n",
-                               dn->bv_val, mdn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] compareDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> compareDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn.bv_val, "" );
index 75873ec517465e9ce374fa4649cf5ab67ada264a..115252ba313134607722366733c7663653701bd1 100644 (file)
@@ -75,8 +75,8 @@ ldap_back_delete(
                        mdn.bv_val = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val ));
+       LDAP_LOG( BACK_LDAP, DETAIL1, 
+               "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s",
                        dn->bv_val, mdn.bv_val, "" );
index 5d8dd3a173b7f886464d2e74d5d7080ae986e254..374ffc2959ac4f1a8dfd95c775120549cebe4b7e 100644 (file)
@@ -100,9 +100,9 @@ ldap_back_group(
                        mop_ndn = *op_ndn;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] bindDn (op ndn in group):"
-                               " \"%s\" -> \"%s\"\n", op_ndn->bv_val, mop_ndn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] bindDn (op ndn in group): \"%s\" -> \"%s\"\n", 
+                       op_ndn->bv_val, mop_ndn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                        "rw> bindDn (op ndn in group): \"%s\" -> \"%s\"\n%s",
@@ -126,9 +126,9 @@ ldap_back_group(
                        mgr_ndn = *gr_ndn;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] searchBase (gr ndn in group):"
-                               " \"%s\" -> \"%s\"\n%s", gr_ndn->bv_val, mgr_ndn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] searchBase (gr ndn in group): \"%s\" -> \"%s\"\n%s", 
+                       gr_ndn->bv_val, mgr_ndn.bv_val, "" );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                        "rw> searchBase (gr ndn in group):"
index 4b46242c783d517e1582e0367dfd853682f02bf9..8e19960fe76f5191ca50d01adc8aa179b1edf67e 100644 (file)
@@ -79,8 +79,8 @@ ldap_back_modify(
                        mdn.bv_val = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> modifyDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn.bv_val, "" );
index 2930ad9a7389caa37bee90e2e6108abd976abd67..5caf780e8cfe9aadfefce41347b9a35e890bfb84 100644 (file)
@@ -84,10 +84,9 @@ ldap_back_modrdn(
                                mnewSuperior.bv_val = ( char * )newSuperior;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] newSuperiorDn:"
-                                       " \"%s\" -> \"%s\"\n",
-                                       newSuperior, mnewSuperior.bv_val ));
+                       LDAP_LOG( BACK_LDAP, DETAIL1, 
+                               "[rw] newSuperiorDn:" " \"%s\" -> \"%s\"\n",
+                               newSuperior, mnewSuperior.bv_val, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> newSuperiorDn:"
                                        " \"%s\" -> \"%s\"\n%s",
@@ -125,8 +124,8 @@ ldap_back_modrdn(
                        mdn.bv_val = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> modrDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn.bv_val, "" );
index 4f107a4f38f9cc23d401e755954522865753ee99..65d9b8110704f907ec4ba4839085682ffebdd2e4 100644 (file)
@@ -153,9 +153,9 @@ ldap_back_search(
                        mbase = *base;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] searchBase: \"%s\" -> \"%s\"\n%",
-                               base->bv_val, mbase.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] searchBase: \"%s\" -> \"%s\"\n", 
+                       base->bv_val, mbase.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> searchBase: \"%s\" -> \"%s\"\n%s",
                                base->bv_val, mbase.bv_val, "" );
@@ -191,9 +191,9 @@ ldap_back_search(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] searchFilter: \"%s\" -> \"%s\"\n",
-                               filterstr->bv_val, mfilter.bv_val ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "[rw] searchFilter: \"%s\" -> \"%s\"\n",
+                       filterstr->bv_val, mfilter.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> searchFilter: \"%s\" -> \"%s\"\n%s",
@@ -300,10 +300,8 @@ fail:;
                                mmatch = ( char * )match;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw]  matchedDn:"
-                                       " \"%s\" -> \"%s\"\n",
-                                       match, mmatch ));
+                       LDAP_LOG( BACK_LDAP, DETAIL1, 
+                               "[rw]  matchedDn:" " \"%s\" -> \"%s\"\n", match, mmatch, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
                                        " \"%s\" -> \"%s\"\n%s",
@@ -389,9 +387,9 @@ ldap_send_entry(
                        ent.e_name = bdn;
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] searchResult: \"%s\""
-                                       " -> \"%s\"\n", bdn.bv_val, ent.e_dn ));
+                       LDAP_LOG( BACK_LDAP, DETAIL1, 
+                               "[rw] searchResult: \"%s\"" " -> \"%s\"\n", 
+                               bdn.bv_val, ent.e_dn, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> searchResult: \"%s\""
                                        " -> \"%s\"\n%s", bdn.bv_val, ent.e_dn, "" );
@@ -428,9 +426,8 @@ ldap_send_entry(
                        if (slap_bv2undef_ad(&mapped, &attr->a_desc, &text) 
                                        != LDAP_SUCCESS) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                               "slap_bv2undef_ad(%s):  "
-                                               "%s\n", mapped.bv_val, text ));
+                               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                                       "slap_bv2undef_ad(%s):  %s\n", mapped.bv_val, text, 0 );
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ANY, 
                                                "slap_bv2undef_ad(%s):  "
@@ -506,14 +503,10 @@ ldap_send_entry(
                                        }
                                        newval.bv_len = strlen( newval.bv_val );
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend",
-                                                       LDAP_LEVEL_DETAIL1,
-                                                       "[rw] searchResult on"
-                                                       " attr=%s:"
-                                                       " \"%s\" -> \"%s\"\n",
-                                                       attr->a_desc->ad_type->sat_cname.bv_val,
-                                                       bv->bv_val, 
-                                                       newval.bv_val ));
+                                       LDAP_LOG( BACK_LDAP, DETAIL1, 
+                                               "[rw] searchResult on attr=%s: \"%s\" -> \"%s\"\n",
+                                               attr->a_desc->ad_type->sat_cname.bv_val,
+                                               bv->bv_val, newval.bv_val );
 #else /* !NEW_LOGGING */
                                        Debug( LDAP_DEBUG_ARGS,
                "rw> searchResult on attr=%s: \"%s\" -> \"%s\"\n",
index d24af0e275af0e3ca6b868cf1271e71d70894e0b..c392207b3a0f2ca242eb2ffd9d57f8373e1f20ad 100644 (file)
@@ -99,9 +99,9 @@ ldap_back_dn_massage(
                         strncpy( res->bv_val, dn->bv_val, diff );
                         strcpy( &res->bv_val[diff], li->suffix_massage[i+dst].bv_val );
 #ifdef NEW_LOGGING
-                                       LDAP_LOG (( "suffixmassage", LDAP_LEVEL_ARGS,
+                                       LDAP_LOG ( BACK_LDAP, ARGS, 
                                                "ldap_back_dn_massage: converted \"%s\" to \"%s\"\n",
-                                               dn->bv_val, res->bv_val ));
+                                               dn->bv_val, res->bv_val, 0 );
 #else
                         Debug( LDAP_DEBUG_ARGS,
                                 "ldap_back_dn_massage:"
index a15452721a2dde7092f5269fa1e77d2da13cdd13..a5aa5f1f9245f117b8e9b1b9e73a2e7f301f0f93 100644 (file)
@@ -55,9 +55,8 @@ ldap_back_conn_destroy(
        struct ldapconn *lc, lc_curr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldap_back_conn_destroy: fetching conn %ld\n",
-                       conn->c_connid ));
+       LDAP_LOG( BACK_LDAP, INFO,
+               "ldap_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_TRACE,
                "=>ldap_back_conn_destroy: fetching conn %ld\n",
@@ -72,9 +71,9 @@ ldap_back_conn_destroy(
 
        if (lc) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldap_back_conn_destroy: destroying conn %ld\n",
-                       conn->c_connid ));
+               LDAP_LOG( BACK_LDAP, DETAIL1, 
+                       "ldap_back_conn_destroy: destroying conn %ld\n", 
+                       conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>ldap_back_conn_destroy: destroying conn %ld\n",
index 876f8deae5110b04d8543894a00ce03268b67dcc..64854753fa332688e76e1f087fa0721501d02c4d 100644 (file)
@@ -35,8 +35,7 @@ ldbm_back_add(
        size_t textlen = sizeof textbuf;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,"ldbm_back_add: %s\n",
-               e->e_dn ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_add: %s\n", e->e_dn, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_dn, 0, 0);
 #endif
@@ -59,9 +58,8 @@ ldbm_back_add(
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "ldbm_back_add: entry (%s) failed schema check.\n",
-                       e->e_dn ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "ldbm_back_add: entry (%s) failed schema check.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry failed schema check: %s\n",
                        text, 0, 0 );
@@ -107,9 +105,9 @@ ldbm_back_add(
                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                               "ldbm_back_add: Parent of (%s) does not exist.\n",
-                               e->e_dn ));
+                       LDAP_LOG( BACK_LDBM, ERR, 
+                               "ldbm_back_add: Parent of (%s) does not exist.\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
                                0, 0, 0 );
@@ -133,9 +131,9 @@ ldbm_back_add(
                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                  "ldbm_back_add: No write access to parent (%s).\n",
-                                  e->e_dn ));
+                       LDAP_LOG( BACK_LDBM, ERR, 
+                               "ldbm_back_add: No write access to parent (%s).\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "no write access to parent\n", 0,
                            0, 0 );
@@ -155,8 +153,8 @@ ldbm_back_add(
                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                  "ldbm_back_add:  Parent is an alias.\n"));
+                       LDAP_LOG(BACK_LDBM, ERR, 
+                               "ldbm_back_add:  Parent is an alias.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "parent is alias\n", 0,
                            0, 0 );
@@ -181,8 +179,8 @@ ldbm_back_add(
                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                  "ldbm_back_add: Parent is referral.\n" ));
+                       LDAP_LOG( BACK_LDBM, ERR,
+                                  "ldbm_back_add: Parent is referral.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "parent is referral\n", 0,
                            0, 0 );
@@ -214,9 +212,9 @@ ldbm_back_add(
                                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                                       LDAP_LOG( BACK_LDBM, ERR,
                                                "ldbm_back_add: No write "
-                                               "access to parent (\"\").\n" ));
+                                               "access to parent (\"\").\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE, 
                                                "no write access to parent\n", 
@@ -236,10 +234,10 @@ ldbm_back_add(
                                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                               LDAP_LOG( BACK_LDBM, ERR,
                                           "ldbm_back_add: %s add denied.\n",
                                           pdn.bv_val == NULL ? "suffix" 
-                                          : "entry at root" ));
+                                          : "entry at root", 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "%s add denied\n",
                                                pdn.bv_val == NULL ? "suffix" 
@@ -264,8 +262,8 @@ ldbm_back_add(
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "ldbm_back_add: next_id failed.\n" ));
+               LDAP_LOG( BACK_LDBM, ERR,
+                       "ldbm_back_add: next_id failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ldbm_add: next_id failed\n",
                        0, 0, 0 );
@@ -291,8 +289,8 @@ ldbm_back_add(
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_add: cache_add_entry_lock failed.\n" ));
+               LDAP_LOG( BACK_LDBM, ERR,
+                       "ldbm_back_add: cache_add_entry_lock failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "cache_add_entry_lock failed\n", 0, 0,
                    0 );
@@ -310,8 +308,8 @@ ldbm_back_add(
        /* attribute indexes */
        if ( index_entry_add( be, e, e->e_attrs ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_add: index_entry_add failed.\n" ));
+               LDAP_LOG( BACK_LDBM, ERR,
+                       "ldbm_back_add: index_entry_add failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "index_entry_add failed\n", 0,
                    0, 0 );
@@ -326,8 +324,8 @@ ldbm_back_add(
        /* dn2id index */
        if ( dn2id_add( be, &e->e_nname, e->e_id ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_add: dn2id_add failed.\n" ));
+               LDAP_LOG( BACK_LDBM, ERR,
+                       "ldbm_back_add: dn2id_add failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "dn2id_add failed\n", 0,
                    0, 0 );
@@ -343,8 +341,8 @@ ldbm_back_add(
        /* id2entry index */
        if ( id2entry_add( be, e ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_add: id2entry_add failed.\n" ));
+               LDAP_LOG( BACK_LDBM, ERR,
+                          "ldbm_back_add: id2entry_add failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "id2entry_add failed\n", 0,
                    0, 0 );
index 7b570c819770e1c6750267e90839abf5ff8f63f1..6bfa9824b4a12a096fe6e6b15697924b852d99be 100644 (file)
@@ -15,7 +15,6 @@
 #include "slap.h"
 #include "back-ldbm.h"
 
-
 /* for the cache of attribute information (which are indexed, etc.) */
 typedef struct ldbm_attrinfo {
        AttributeDescription *ai_desc; /* attribute description cn;lang-en */
@@ -182,9 +181,9 @@ attr_index_config(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "attr_index_config: index %s 0x%04lx\n",
-                          ad->ad_cname.bv_val, mask ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "attr_index_config: index %s 0x%04lx\n", 
+                       ad->ad_cname.bv_val, mask, 0 );
 #else
                Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n",
                        ad->ad_cname.bv_val, mask, 0 ); 
index eaa8d3e116e2cece0b479d0b0cb8c1f4605e0b89..0dc5daf03a20fb31a7e4f2f50743b0f0b0145520 100644 (file)
@@ -16,7 +16,6 @@
 #include "back-ldbm.h"
 #include "proto-back-ldbm.h"
 
-
 /* return LDAP_SUCCESS IFF we can retrieve the attributes
  * of entry with e_ndn
  */
@@ -41,13 +40,12 @@ ldbm_back_attribute(
        int nvals = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "ldbm_back_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val ));
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "ldbm_back_attribute: at: \"%s\"\n", entry_at_name));
-       LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "ldbm_back_attribute: tr dn: \"%s\"\n",
-               target ? target->e_ndn : "" ));
+       LDAP_LOG( BACK_LDBM, ARGS,
+               "ldbm_back_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val, 0, 0 );
+       LDAP_LOG( BACK_LDBM, ARGS, 
+               "ldbm_back_attribute: at: \"%s\"\n", entry_at_name, 0, 0);
+       LDAP_LOG( BACK_LDBM, ARGS, "ldbm_back_attribute: tr dn: \"%s\"\n",
+               target ? target->e_ndn : "", 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_attribute: gr dn: \"%s\"\n",
@@ -65,9 +63,9 @@ ldbm_back_attribute(
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_attribute: target is LOCKED (%s)\n",
-                       entry_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "ldbm_back_attribute: target is LOCKED (%s)\n", 
+                       entry_ndn->bv_val, 0, 0);
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> ldbm_back_attribute: target is entry: \"%s\"\n",
@@ -79,9 +77,9 @@ ldbm_back_attribute(
                /* can we find entry with reader lock */
                if ((e = dn2entry_r(be, entry_ndn, NULL )) == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                       LDAP_LOG( BACK_LDBM, INFO, 
                                "ldbm_back_attribute: cannot find entry (%s)\n",
-                               entry_ndn->bv_val ));
+                               entry_ndn->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> ldbm_back_attribute: cannot find entry: \"%s\"\n",
@@ -92,9 +90,8 @@ ldbm_back_attribute(
                }
                
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_attribute: found entry (%s)\n",
-                       entry_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "ldbm_back_attribute: found entry (%s)\n", entry_ndn->bv_val, 0, 0);
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> ldbm_back_attribute: found entry: \"%s\"\n",
@@ -107,8 +104,8 @@ ldbm_back_attribute(
 
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: entry is an alias\n", 0, 0, 0 );
@@ -120,8 +117,8 @@ ldbm_back_attribute(
 
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: entry is an referral\n", 0, 0, 0 );
@@ -141,8 +138,8 @@ ldbm_back_attribute(
 
        if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_attribute: failed to find %s.\n", entry_at_name ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_attribute: failed to find %s.\n", entry_at_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: failed to find %s\n",
@@ -199,9 +196,8 @@ return_results:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_back_attribute: rc=%d nvals=%d.\n",
-                  rc, nvals ));
+       LDAP_LOG( BACK_LDBM, ENTRY, 
+               "ldbm_back_attribute: rc=%d nvals=%d.\n", rc, nvals, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "ldbm_back_attribute: rc=%d nvals=%d\n",
index 2ca018d03beb83048f4e8100903b4cb275409b20..766e31c0c693bcfbb1d56c3a8de190acddcd8ff4 100644 (file)
@@ -44,8 +44,8 @@ ldbm_back_bind(
        AttributeDescription *password = slap_schema.si_ad_userPassword;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_back_bind: dn: %s.\n", dn->bv_val ));
+       LDAP_LOG( BACK_LDBM, ENTRY, 
+               "ldbm_back_bind: dn: %s.\n", dn->bv_val, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_bind: dn: %s\n", dn->bv_val, 0, 0);
 #endif
@@ -113,8 +113,8 @@ ldbm_back_bind(
        if ( is_entry_alias( e ) ) {
                /* entry is an alias, don't allow bind */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_bind: entry (%s) is an alias.\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_bind: entry (%s) is an alias.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0,
                    0, 0 );
@@ -134,8 +134,8 @@ ldbm_back_bind(
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_bind: entry(%s) is a referral.\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                          "ldbm_back_bind: entry(%s) is a referral.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                    0, 0 );
index 72ec35e9b72cb6ef6b74670f54e47ac8e924430f..4a26488a4e8bf3831a7ab06e4f6808fb1458f110 100644 (file)
@@ -116,9 +116,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
-                          id, rw ? "w" : "r", refcnt ));
+                          id, rw ? "w" : "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> cache_return_entry_%s( %ld ): created (%d)\n",
@@ -131,9 +131,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                        ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "cache_return_entry_rw: %ld, delete pending (%d).\n",
-                                  id, refcnt ));
+                                  id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> cache_return_entry_%s( %ld ): delete pending (%d)\n",
@@ -150,9 +150,8 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                        ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                                  "cache_return_entry_rw: (%ld): deleted (%d)\n",
-                                  id, refcnt ));
+                       LDAP_LOG( CACHE, DETAIL1,
+                               "cache_return_entry_rw: (%ld): deleted (%d)\n", id, refcnt, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "====> cache_return_entry_%s( %ld ): deleted (%d)\n",
@@ -165,9 +164,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_return_entry_rw: ID %ld:%s returned (%d)\n",
-                          id, rw ? "w": "r", refcnt ));
+                          id, rw ? "w": "r", refcnt );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> cache_return_entry_%s( %ld ): returned (%d)\n",
@@ -218,9 +217,9 @@ cache_add_entry_rw(
        Entry   *ee;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( CACHE, ENTRY, 
                   "cache_add_entry_rw: add (%s):%s to cache\n",
-                  e->e_dn, rw ? "w" : "r" ));
+                  e->e_dn, rw ? "w" : "r", 0 );
 #endif
        /* set cache mutex */
        ldap_pvt_thread_mutex_lock( &cache->c_mutex );
@@ -232,9 +231,9 @@ cache_add_entry_rw(
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_ERR,
+               LDAP_LOG( CACHE, ERR, 
                           "cache_add_entry_rw: add (%s):%ld private init failed!\n",
-                          e->e_dn, e->e_id ));
+                          e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> cache_add_entry( %ld ): \"%s\": private init failed!\n",
@@ -251,9 +250,9 @@ cache_add_entry_rw(
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "cache_add_entry: (%s):%ld already in cache.\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "cache_add_entry: (%s):%ld already in cache.\n", 
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> cache_add_entry( %ld ): \"%s\": already in dn cache\n",
@@ -270,9 +269,9 @@ cache_add_entry_rw(
                (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "cache_add_entry: (%s):%ls already in cache.\n",
-                          e->e_dn, e->e_id ));
+               LDAP_LOG( CACHE, DETAIL1, 
+                       "cache_add_entry: (%s):%ls already in cache.\n", 
+                       e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> cache_add_entry( %ld ): \"%s\": already in id cache\n",
@@ -284,9 +283,9 @@ cache_add_entry_rw(
                        (AVL_CMP) entry_dn_cmp ) == NULL )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "cache_add_entry: can't delete (%s) from cache.\n",
-                                  e->e_dn ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "cache_add_entry: can't delete (%s) from cache.\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
                            0, 0, 0 );
@@ -372,9 +371,9 @@ cache_update_entry(
                (AVL_CMP) entry_dn_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_update_entry: (%s):%ld already in dn cache\n",
-                          e->e_dn, e->e_id ));
+                          e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "====> cache_update_entry( %ld ): \"%s\": already in dn cache\n",
@@ -391,9 +390,9 @@ cache_update_entry(
                (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_update_entry: (%s)%ld already in id cache\n",
-                          e->e_dn, e->e_id ));
+                          e->e_dn, e->e_id, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "====> cache_update_entry( %ld ): \"%s\": already in id cache\n",
@@ -405,9 +404,9 @@ cache_update_entry(
                        (AVL_CMP) entry_dn_cmp ) == NULL )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "cache_update_entry: can't delete (%s)%ld from dn cache.\n",
-                                  e->e_dn, e->e_id ));
+                       LDAP_LOG( CACHE, INFO, 
+                               "cache_update_entry: can't delete (%s)%ld from dn cache.\n",
+                               e->e_dn, e->e_id, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
                            0, 0, 0 );
@@ -511,9 +510,9 @@ try_again:
                        ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
+                       LDAP_LOG( CACHE, INFO, 
                                   "cache_find_entry_dn2id: (%s) %ld not ready: %d\n",
-                                  ndn->bv_val, id, state ));
+                                  ndn->bv_val, id, state );
 #else
                        Debug(LDAP_DEBUG_TRACE,
                                "====> cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n",
@@ -532,9 +531,9 @@ try_again:
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_find_entry_dn2id: (%s): %ld %d tries\n",
-                          ndn->bv_val, id, count ));
+                          ndn->bv_val, id, count );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "====> cache_find_entry_dn2id(\"%s\"): %ld (%d tries)\n",
@@ -594,9 +593,9 @@ try_again:
                        ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
+                       LDAP_LOG( CACHE, INFO, 
                                   "cache_find_entry_id: (%ld)->%ld not ready (%d).\n",
-                                  id, ep_id, state ));
+                                  id, ep_id, state );
                                   
 #else
                        Debug(LDAP_DEBUG_TRACE,
@@ -618,9 +617,9 @@ try_again:
                ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CACHE, DETAIL1, 
                           "cache_find_entry_id: %ld -> %s  found %d tries.\n",
-                          ep_id, ep->e_dn, count ));
+                          ep_id, ep->e_dn, count );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "====> cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n",
@@ -661,8 +660,8 @@ cache_delete_entry(
        assert( e->e_private );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "cache_delete_entry: delete %ld.\n", e->e_id ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "cache_delete_entry: delete %ld.\n", e->e_id, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n",
                e->e_id, 0, 0 );
@@ -723,8 +722,7 @@ cache_release_all( Cache *cache )
        ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "cache_release_all: enter\n" ));
+       LDAP_LOG( CACHE, ENTRY, "cache_release_all: enter\n" , 0, 0, 0);
 #else
        Debug( LDAP_DEBUG_TRACE, "====> cache_release_all\n", 0, 0, 0 );
 #endif
@@ -740,8 +738,8 @@ cache_release_all( Cache *cache )
 
        if ( cache->c_cursize ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                          "cache_release_all: Entry cache could not be emptied.\n" ));
+               LDAP_LOG( CACHE, INFO,
+                        "cache_release_all: Entry cache could not be emptied.\n", 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "Entry-cache could not be emptied\n", 0, 0, 0 );
 #endif
index 7a2a83e12119d8a3a71125c2d2db77aee3d92d7a..383817a5d9baf36b9c4f7cb4ba5699c069b00191 100644 (file)
@@ -24,16 +24,16 @@ ldbm_back_db_close( Backend *be )
                ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL );
        }
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                  "ldbm_back_db_close: ldbm backend syncing\n" ));
+       LDAP_LOG( BACK_LDBM, CRIT,
+                  "ldbm_back_db_close: ldbm backend syncing\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
 #endif
 
        ldbm_cache_flush_all( be );
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                  "ldbm_back_db_close: ldbm backend synch'ed\n" ));
+       LDAP_LOG( BACK_LDBM, CRIT,
+                  "ldbm_back_db_close: ldbm backend synch'ed\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
 #endif
index 18b50dbf2e32c2cd5eff97930291e0e332ca72e0..b96dbd0163e45c2fa4061faa470396bb8bd5f76b 100644 (file)
@@ -69,8 +69,8 @@ ldbm_back_compare(
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_compare: entry (%s) is a referral.\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_compare: entry (%s) is a referral.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                    0, 0 );
index 2cb64aa675aa263749c569475003c23ccc26427c..527f3c4c43874ae1425a8a00e692f0901cb7b538 100644 (file)
@@ -107,9 +107,9 @@ ldbm_back_db_config(
                int i;
                if ( argc < 2 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: "
+                       LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: %s: "
                                "line %d: missing frequency value in \"dbsync <frequency> "
-                               "[<wait-times> [wait-interval]]\" line\n", fname, lineno ));
+                               "[<wait-times> [wait-interval]]\" line\n", fname, lineno, 0 );
 #else  
                        Debug( LDAP_DEBUG_ANY,
     "%s: line %d: missing frquency value in \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
@@ -122,10 +122,11 @@ ldbm_back_db_config(
 
                if( i < 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: "
+                       LDAP_LOG ( CONFIG, ERR, 
+                               "ldbm_back_db_config: %s: "
                                "line %d: frequency value (%d) invalid \"dbsync "
                                "<frequency> [<wait-times> [wait-interval]]\" line\n", 
-                               fname, lineno, i ));
+                               fname, lineno, i );
 #else  
                        Debug( LDAP_DEBUG_ANY,
     "%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
@@ -140,10 +141,10 @@ ldbm_back_db_config(
                        i = atoi( argv[2] );
                        if ( i < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "config",LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: "
+                               LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: "
                                        "line %d: frequency value (%d) invalid \"dbsync "
                                        "<frequency> [<wait-times> [wait-interval]]\" line\n", 
-                                       fname, lineno, i ));
+                                       fname, lineno, i );
 #else  
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
@@ -158,10 +159,10 @@ ldbm_back_db_config(
                        i = atoi( argv[3] );
                        if ( i <= 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "config",LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: "
+                               LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: "
                                        "line %d: frequency value (%d) invalid \"dbsync "
                                        "<frequency> [<wait-times> [wait-interval]]\" line\n", 
-                                       fname, lineno, i ));
+                                       fname, lineno, i );
 #else  
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
@@ -177,8 +178,8 @@ ldbm_back_db_config(
 
 #else
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: \"dbsync\""
-                       " policies not supported in non-threaded environments\n" ));
+               LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: \"dbsync\""
+                       " policies not supported in non-threaded environments\n", 0, 0, 0 );
 #else  
                Debug( LDAP_DEBUG_ANY,
     "\"dbsync\" policies not supported in non-threaded environments\n", 0, 0, 0);
index 1cf5bf9bd129513fa49c448866285521dda9d8c9..b9407f4d1a8461ea9e3e1c26c4ef1dce26bf596e 100644 (file)
@@ -54,8 +54,8 @@ ldbm_cache_open(
        }
        
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY,
-                  "ldbm_cache_open: \"%s\", %d, %o\n", buf, flags, li->li_mode ));
+       LDAP_LOG( CACHE, ENTRY, 
+               "ldbm_cache_open: \"%s\", %d, %o\n", buf, flags, li->li_mode );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> ldbm_cache_open( \"%s\", %d, %o )\n", buf,
            flags, li->li_mode );
@@ -101,8 +101,8 @@ ldbm_cache_open(
                                }
                                li->li_dbcache[i].dbc_refcnt++;
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                                          "ldbm_cache_open: cache %d\n", i ));
+                               LDAP_LOG( CACHE, DETAIL1, 
+                                       "ldbm_cache_open: cache %d\n", i, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                    "<= ldbm_cache_open (cache %d)\n", i, 0, 0 );
@@ -132,8 +132,9 @@ ldbm_cache_open(
                                li->li_dbcache[i].dbc_name = NULL;
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                          "ldbm_cache_open: no unused db to close - waiting\n" ));
+                               LDAP_LOG( CACHE, INFO,
+                                       "ldbm_cache_open: no unused db to close - waiting\n", 
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                    "ldbm_cache_open no unused db to close - waiting\n",
@@ -155,10 +156,10 @@ ldbm_cache_open(
        {
                int err = errno;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "cache", LDAP_LEVEL_ERR,
-                          "ldbm_cache_open: \"%s\" failed, errono=%d, reason=%s\n",
-                          buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] :
-                          "unknown" ));
+               LDAP_LOG( CACHE, ERR, 
+                       "ldbm_cache_open: \"%s\" failed, errono=%d, reason=%s\n",
+                       buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] :
+                       "unknown" );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= ldbm_cache_open NULL \"%s\" errno=%d reason=\"%s\")\n",
@@ -190,10 +191,10 @@ ldbm_cache_open(
        assert( li->li_dbcache[i].dbc_maxindirect < 256 );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_ARGS,
+       LDAP_LOG( CACHE, ARGS, 
                   "ldbm_cache_open: blksize:%ld  maxids:%d  maxindirect:%d\n",
                   li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids,
-                  li->li_dbcache[i].dbc_maxindirect ));
+                  li->li_dbcache[i].dbc_maxindirect );
 #else
        Debug( LDAP_DEBUG_ARGS,
            "ldbm_cache_open (blksize %ld) (maxids %d) (maxindirect %d)\n",
@@ -202,8 +203,7 @@ ldbm_cache_open(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                  "<= ldbm_cache_open: (opened %d)\n", i ));
+       LDAP_LOG( CACHE, DETAIL1, "<= ldbm_cache_open: (opened %d)\n", i, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open (opened %d)\n", i, 0, 0 );
 #endif
@@ -259,9 +259,9 @@ ldbm_cache_flush_all( Backend *be )
        for ( i = 0; i < MAXDBCACHE; i++ ) {
                if ( li->li_dbcache[i].dbc_name != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( CACHE, DETAIL1, 
                                   "ldbm_cache_flush_all: flushing db (%s)\n",
-                                  li->li_dbcache[i].dbc_name ));
+                                  li->li_dbcache[i].dbc_name, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n",
                            li->li_dbcache[i].dbc_name, 0, 0 );
@@ -271,9 +271,9 @@ ldbm_cache_flush_all( Backend *be )
                        li->li_dbcache[i].dbc_dirty = 0;
                        if ( li->li_dbcache[i].dbc_refcnt != 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                          "ldbm_cache_flush_all: couldn't close db (%s), refcnt=%d\n",
-                                          li->li_dbcache[i].dbc_name, li->li_dbcache[i].dbc_refcnt ));
+                               LDAP_LOG( CACHE, INFO, 
+                                       "ldbm_cache_flush_all: couldn't close db (%s), refcnt=%d\n",
+                                       li->li_dbcache[i].dbc_name, li->li_dbcache[i].dbc_refcnt,0);
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                       "refcnt = %d, couldn't close db (%s)\n",
@@ -283,9 +283,9 @@ ldbm_cache_flush_all( Backend *be )
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
+                               LDAP_LOG( CACHE, DETAIL1, 
                                           "ldbm_cache_flush_all: ldbm closing db (%s)\n",
-                                          li->li_dbcache[i].dbc_name ));
+                                          li->li_dbcache[i].dbc_name, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                       "ldbm closing db (%s)\n",
@@ -312,8 +312,8 @@ ldbm_cache_sync( Backend *be )
        for ( i = 0; i < MAXDBCACHE; i++ ) {
                if ( li->li_dbcache[i].dbc_name != NULL && li->li_dbcache[i].dbc_dirty ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync: "
-                               "ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name ));
+                       LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync: "
+                               "ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 );
 #else
                        Debug(  LDAP_DEBUG_TRACE, "ldbm syncing db (%s)\n",
                                li->li_dbcache[i].dbc_name, 0, 0 );
@@ -391,8 +391,8 @@ ldbm_cache_sync_daemon(
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "dbcache", LDAP_LEVEL_ARGS, "ldbm_cache_sync_daemon:"
-               " synchronizer starting for %s\n", li->li_directory ));
+       LDAP_LOG ( CACHE, ARGS, "ldbm_cache_sync_daemon:"
+               " synchronizer starting for %s\n", li->li_directory, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "synchronizer starting for %s\n", li->li_directory, 0, 0 );
 #endif
@@ -404,8 +404,8 @@ ldbm_cache_sync_daemon(
 
                while (i && ldap_pvt_thread_pool_backload(&connection_pool) != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:"
-                               " delay syncing %s\n", li->li_directory ));
+                       LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
+                               " delay syncing %s\n", li->li_directory, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "delay syncing %s\n", li->li_directory, 0, 0 );
 #endif
@@ -415,8 +415,8 @@ ldbm_cache_sync_daemon(
 
                if (!li->li_dbshutdown) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:"
-                               " syncing %s\n", li->li_directory ));
+                       LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
+                               " syncing %s\n", li->li_directory, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "syncing %s\n", li->li_directory, 0, 0 );
 #endif
@@ -425,8 +425,8 @@ ldbm_cache_sync_daemon(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:"
-                               " synchronizer stopping\n" ));
+       LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
+                               " synchronizer stopping\n", 0, 0, 0);
 #else
        Debug( LDAP_DEBUG_ANY, "synchronizer stopping\n", 0, 0, 0 );
 #endif
index 321799acd2f1fd55099a083da3facdb0c6f09bea..d33e957f678f6dd3d1457399c586200fe8060e6a 100644 (file)
@@ -34,8 +34,7 @@ ldbm_back_delete(
        AttributeDescription *children = slap_schema.si_ad_children;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_back_delete: %s\n", dn->bv_val ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_delete: %s\n", dn->bv_val, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", dn->bv_val, 0, 0);
 #endif
@@ -49,8 +48,8 @@ ldbm_back_delete(
                BerVarray refs;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_delete: no such object %s\n", dn->bv_val ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_delete: no such object %s\n", dn->bv_val, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
                        dn->bv_val, 0, 0);
@@ -86,9 +85,8 @@ ldbm_back_delete(
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_delete: entry (%s) is a referral.\n",
-                       e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_delete: entry (%s) is a referral.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                    0, 0 );
@@ -106,8 +104,8 @@ ldbm_back_delete(
 
        if ( has_children( be, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_delete: (%s) is a non-leaf node.\n", dn->bv_val ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                          "ldbm_back_delete: (%s) is a non-leaf node.\n", dn->bv_val, 0,0);
 #else
                Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: non leaf %s\n",
                        dn->bv_val, 0, 0);
@@ -123,8 +121,8 @@ ldbm_back_delete(
                pdn.bv_len) ) {
                if( (p = dn2entry_w( be, &pdn, NULL )) == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                               "ldbm_back_delete: parent of (%s) does not exist\n", dn ));
+                       LDAP_LOG( BACK_LDBM, ERR, 
+                               "ldbm_back_delete: parent of (%s) does not exist\n", dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<=- ldbm_back_delete: parent does not exist\n",
@@ -141,9 +139,9 @@ ldbm_back_delete(
                        children, NULL, ACL_WRITE, NULL ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                               "ldbm_back_delete: no access to parent of (%s)\n",
-                               dn->bv_val ));
+                       LDAP_LOG( BACK_LDBM, ERR, 
+                               "ldbm_back_delete: no access to parent of (%s)\n", 
+                               dn->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<=- ldbm_back_delete: no access to parent\n", 0,
@@ -168,9 +166,9 @@ ldbm_back_delete(
                                /* check parent for "children" acl */
                                if ( ! rc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                                       LDAP_LOG( BACK_LDBM, ERR,
                                                "ldbm_back_delete: no access "
-                                               "to parent of ("")\n" ));
+                                               "to parent of ("")\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "<=- ldbm_back_delete: no "
@@ -185,9 +183,9 @@ ldbm_back_delete(
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                               LDAP_LOG( BACK_LDBM, ERR, 
                                        "ldbm_back_delete: (%s) has no "
-                                       "parent & not a root.\n", dn ));
+                                       "parent & not a root.\n", dn, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "<=- ldbm_back_delete: no parent & "
@@ -205,9 +203,8 @@ ldbm_back_delete(
        /* delete from dn2id mapping */
        if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "ldbm_back_delete: (%s) operations error\n",
-                       dn->bv_val ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "ldbm_back_delete: (%s) operations error\n", dn->bv_val, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS,
                        "<=- ldbm_back_delete: operations error %s\n",
@@ -222,9 +219,8 @@ ldbm_back_delete(
        /* delete from disk and cache */
        if ( id2entry_delete( be, e ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "ldbm_back_delete: (%s) operations error\n",
-                       dn->bv_val ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "ldbm_back_delete: (%s) operations error\n", dn->bv_val, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ARGS,
                        "<=- ldbm_back_delete: operations error %s\n",
index 152ab7a7e3952812d21c20c5fb67af789f7bfb0d..757d4b0f7170158f9ec78c8c7769dfa510b42666 100644 (file)
@@ -30,8 +30,7 @@ dn2id_add(
        struct berval   ptr, pdn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id_add: (%s):%ld\n", dn->bv_val, id ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: (%s):%ld\n", dn->bv_val, id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn->bv_val, id, 0 );
 #endif
@@ -41,8 +40,8 @@ dn2id_add(
        if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "dn2id_add: couldn't open/create dn2id%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "dn2id_add: couldn't open/create dn2id%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create dn2id%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -104,8 +103,7 @@ dn2id_add(
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id_add: return %d\n", rc ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= dn2id_add %d\n", rc, 0, 0 );
 #endif
@@ -125,8 +123,7 @@ dn2id(
        Datum           key, data;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id: (%s)\n", dn->bv_val ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: (%s)\n", dn->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
 #endif
@@ -136,8 +133,7 @@ dn2id(
        /* first check the cache */
        if ( (*idp = cache_find_entry_ndn2id( be, &li->li_cache, dn )) != NOID ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "dn2id: (%s)%ld in cache.\n", dn, *idp ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, "dn2id: (%s)%ld in cache.\n", dn, *idp, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld (in cache)\n", *idp,
                        0, 0 );
@@ -149,8 +145,8 @@ dn2id(
        if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "dn2id: couldn't open dn2id%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                          "dn2id: couldn't open dn2id%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "<= dn2id could not open dn2id%s\n",
                        LDBM_SUFFIX, 0, 0 );
@@ -177,8 +173,7 @@ dn2id(
 
        if ( data.dptr == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "dn2id: (%s) NOID\n", dn ));
+               LDAP_LOG( BACK_LDBM, INFO, "dn2id: (%s) NOID\n", dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= dn2id NOID\n", 0, 0, 0 );
 #endif
@@ -194,8 +189,7 @@ dn2id(
        ldbm_datum_free( db->dbc_db, data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id: %ld\n", *idp ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: %ld\n", *idp, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", *idp, 0, 0 );
 #endif
@@ -215,8 +209,7 @@ dn2idl(
        Datum           key;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2idl: \"%c%s\"\n", prefix, dn->bv_val ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2idl: \"%c%s\"\n", prefix, dn->bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> dn2idl( \"%c%s\" )\n", prefix, dn->bv_val, 0 );
 #endif
@@ -232,8 +225,8 @@ dn2idl(
        if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "dn2idl: could not open dn2id%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                          "dn2idl: could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "<= dn2idl could not open dn2id%s\n",
                        LDBM_SUFFIX, 0, 0 );
@@ -272,8 +265,8 @@ dn2id_delete(
        struct berval   ptr, pdn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id_delete: (%s)%ld\n", dn->bv_val, id ));
+       LDAP_LOG( BACK_LDBM, ENTRY, 
+                  "dn2id_delete: (%s)%ld\n", dn->bv_val, id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn->bv_val, id, 0 );
 #endif
@@ -284,8 +277,8 @@ dn2id_delete(
        if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "dn2id_delete: couldn't open db2id%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                          "dn2id_delete: couldn't open db2id%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= dn2id_delete could not open dn2id%s\n", LDBM_SUFFIX,
@@ -342,8 +335,7 @@ dn2id_delete(
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2id_delete: return %d\n", rc ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_delete: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= dn2id_delete %d\n", rc, 0, 0 );
 #endif
@@ -369,9 +361,8 @@ dn2entry_rw(
        struct berval   pdn;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "dn2entry_rw: %s entry %s\n", rw ? "w" : "r",
-                  dn->bv_val ));
+       LDAP_LOG( BACK_LDBM, ENTRY, 
+                  "dn2entry_rw: %s entry %s\n", rw ? "w" : "r", dn->bv_val, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n",
                rw ? "w" : "r", dn->bv_val, 0);
@@ -394,9 +385,9 @@ dn2entry_rw(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "dn2entry_rw: no entry for valid id (%ld), dn (%s)\n",
-                          id, dn->bv_val ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "dn2entry_rw: no entry for valid id (%ld), dn (%s)\n", 
+                       id, dn->bv_val, 0 );
 #else
                Debug(LDAP_DEBUG_ANY,
                        "dn2entry_%s: no entry for valid id (%ld), dn \"%s\"\n",
index bc370f239b6916d167899796e692ca9e6c52cf62..c59145e296053538b536034e41210c794b75d965 100644 (file)
@@ -39,7 +39,7 @@ filter_candidates(
        ID_BLOCK        *result;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "filter_candidates: enter\n"));
+       LDAP_LOG( FILTER, ENTRY, "filter_candidates: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 );
 #endif
@@ -49,8 +49,8 @@ filter_candidates(
        switch ( f->f_choice ) {
        case SLAPD_FILTER_DN_ONE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  DN ONE (%s)\n", f->f_dn ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                          "filter_candidates:  DN ONE (%s)\n", f->f_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
 #endif
@@ -65,8 +65,8 @@ filter_candidates(
 
        case SLAPD_FILTER_DN_SUBTREE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  DN SUBTREE (%s)\n", f->f_dn ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                          "filter_candidates:  DN SUBTREE (%s)\n", f->f_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 );
 #endif
@@ -81,8 +81,9 @@ filter_candidates(
 
        case LDAP_FILTER_PRESENT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  Present (%s)\n", f->f_desc->ad_cname.bv_val ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "filter_candidates:  Present (%s)\n", 
+                       f->f_desc->ad_cname.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
 #endif
@@ -92,10 +93,10 @@ filter_candidates(
 
        case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( FILTER, DETAIL1, 
                           "filter_candidates:  EQUALITY (%s),(%s)\n",
                           f->f_ava->aa_desc->ad_cname.bv_val,
-                          f->f_ava->aa_value.bv_val ));
+                          f->f_ava->aa_value.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
 #endif
@@ -105,10 +106,10 @@ filter_candidates(
 
        case LDAP_FILTER_APPROX:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( FILTER, DETAIL1, 
                           "filter_candidates:  APPROX (%s), (%s)\n",
                           f->f_ava->aa_desc->ad_cname.bv_val,
-                          f->f_ava->aa_value.bv_val ));
+                          f->f_ava->aa_value.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
 #endif
@@ -118,8 +119,8 @@ filter_candidates(
 
        case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  SUBSTRINGS\n"));
+               LDAP_LOG( FILTER, DETAIL1,
+                          "filter_candidates:  SUBSTRINGS\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -129,8 +130,7 @@ filter_candidates(
 
        case LDAP_FILTER_GE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  GE\n"));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  GE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
 #endif
@@ -140,8 +140,7 @@ filter_candidates(
 
        case LDAP_FILTER_LE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  LE\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  LE\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
 #endif
@@ -151,8 +150,7 @@ filter_candidates(
 
        case LDAP_FILTER_AND:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  AND\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  AND\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
 #endif
@@ -162,8 +160,7 @@ filter_candidates(
 
        case LDAP_FILTER_OR:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  OR\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  OR\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
 #endif
@@ -173,8 +170,7 @@ filter_candidates(
 
        case LDAP_FILTER_NOT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  NOT\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  NOT\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
 #endif
@@ -189,8 +185,7 @@ filter_candidates(
                break;
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "filter_candidates:  UNKNOWN\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "filter_candidates:  UNKNOWN\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN\n", 0, 0, 0 );
 #endif
@@ -202,9 +197,9 @@ filter_candidates(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "filter_candidates: return %ld\n",
-                  result ? ID_BLOCK_NIDS(result) : 0 ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "filter_candidates: return %ld\n", 
+               result ? ID_BLOCK_NIDS(result) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= filter_candidates %ld\n",
            result ? ID_BLOCK_NIDS(result) : 0, 0, 0 );
@@ -227,8 +222,7 @@ presence_candidates(
        struct berval prefix = {0};
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "presence_candidates: enter\n" ));
+       LDAP_LOG( FILTER, ENTRY, "presence_candidates: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
 #endif
@@ -244,9 +238,8 @@ presence_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                          "presence_candidates: index_param returned %d\n",
-                          rc ));
+               LDAP_LOG( FILTER, INFO, 
+                          "presence_candidates: index_param returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= presence_candidates: index_param returned=%d\n",
@@ -259,8 +252,7 @@ presence_candidates(
        if( dbname == NULL ) {
                /* not indexed */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                          "presence_candidates: not indexed\n" ));
+               LDAP_LOG( FILTER, INFO, "presence_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= presense_candidates: not indexed\n",
@@ -274,9 +266,9 @@ presence_candidates(
        
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+               LDAP_LOG( FILTER, INFO, 
                           "presence_candidates: db open failed (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+                          dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= presense_candidates db open failed (%s%s)\n",
@@ -294,8 +286,8 @@ presence_candidates(
 
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                                  "presence_candidates: key read failed (%d)\n", rc ));
+                       LDAP_LOG( FILTER, ERR, 
+                                  "presence_candidates: key read failed (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= presense_candidates key read failed (%d)\n",
@@ -305,8 +297,7 @@ presence_candidates(
 
                } else if( idl == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                                  "presence_candidates: NULL\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "presence_candidates: NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= presense_candidates NULL\n",
@@ -319,9 +310,9 @@ presence_candidates(
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "presence_candidates:  return %ld\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "presence_candidates:  return %ld\n", 
+               idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
@@ -347,8 +338,7 @@ equality_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "equality_candidates: enter\n" ));
+       LDAP_LOG( FILTER, ENTRY, "equality_candidates: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> equality_candidates\n", 0, 0, 0 );
 #endif
@@ -361,8 +351,8 @@ equality_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "equality_candidates:  index_param returned %d\n", rc ));
+               LDAP_LOG( FILTER, ERR, 
+                          "equality_candidates:  index_param returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= equality_candidates: index_param returned=%d\n",
@@ -375,8 +365,7 @@ equality_candidates(
        if( dbname == NULL ) {
                /* not indexed */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "equality_candidates: not indexed\n" ));
+               LDAP_LOG( FILTER, ERR, "equality_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= equality_candidates: not indexed\n",
@@ -406,9 +395,9 @@ equality_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                           "equality_candidates: (%s%s) MR filter failed (%d\n",
-                          dbname, LDBM_SUFFIX, rc ));
+                          dbname, LDBM_SUFFIX, rc );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= equality_candidates: (%s%s) MR filter failed (%d)\n",
@@ -420,9 +409,8 @@ equality_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "equality_candidates: no keys (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+               LDAP_LOG( FILTER, ERR, 
+                  "equality_candidates: no keys (%s%s)\n", dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= equality_candidates: no keys (%s%s)\n",
@@ -436,9 +424,8 @@ equality_candidates(
        
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "equality_candidates: db open failed (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+               LDAP_LOG( FILTER, ERR, "equality_candidates: db open failed (%s%s)\n",
+                       dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= equality_candidates db open failed (%s%s)\n",
@@ -458,8 +445,8 @@ equality_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                                  "equality_candidates: key read failed (%d)\n", rc ));
+                       LDAP_LOG( FILTER, ERR, 
+                                  "equality_candidates: key read failed (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= equality_candidates key read failed (%d)\n",
@@ -473,8 +460,7 @@ equality_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                                  "equality_candidates NULL\n" ));
+                       LDAP_LOG( FILTER, INFO, "equality_candidates NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= equality_candidates NULL\n",
@@ -498,9 +484,9 @@ equality_candidates(
 
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "equality_candidates: return %ld\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+       LDAP_LOG( FILTER, ENTRY, 
+                  "equality_candidates: return %ld\n", 
+                  idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= equality_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
@@ -526,8 +512,7 @@ approx_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "approx_candidates: enter\n" ));
+       LDAP_LOG( FILTER, ENTRY, "approx_candidates: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> approx_candidates\n", 0, 0, 0 );
 #endif
@@ -540,8 +525,8 @@ approx_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "approx_candidates: index_param returned %d\n", rc ));
+               LDAP_LOG( FILTER, ERR, 
+                          "approx_candidates: index_param returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= approx_candidates: index_param returned=%d\n",
@@ -554,8 +539,7 @@ approx_candidates(
        if( dbname == NULL ) {
                /* not indexed */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "approx_candidates: not indexed\n" ));
+               LDAP_LOG( FILTER, ERR, "approx_candidates: not indexed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= approx_candidates: not indexed\n",
@@ -590,9 +574,9 @@ approx_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                           "approx_candidates: (%s%s) MR filter failed (%d)\n",
-                          dbname, LDBM_SUFFIX, rc ));
+                          dbname, LDBM_SUFFIX, rc );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= approx_candidates: (%s%s) MR filter failed (%d)\n",
@@ -604,9 +588,9 @@ approx_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+               LDAP_LOG( FILTER, INFO, 
                           "approx_candidates: no keys (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+                          dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= approx_candidates: no keys (%s%s)\n",
@@ -620,9 +604,9 @@ approx_candidates(
        
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "approx_candidates db open failed (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+               LDAP_LOG( FILTER, ERR, 
+                       "approx_candidates db open failed (%s%s)\n", 
+                       dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= approx_candidates db open failed (%s%s)\n",
@@ -642,8 +626,8 @@ approx_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                                  "approx_candidates: key read failed (%d)\n", rc ));
+                       LDAP_LOG( FILTER, ERR, 
+                                  "approx_candidates: key read failed (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= approx_candidates key read failed (%d)\n",
                            rc, 0, 0 );
@@ -656,8 +640,7 @@ approx_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                                  "approx_candidates: NULL\n" ));
+                       LDAP_LOG( FILTER, INFO, "approx_candidates: NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= approx_candidates NULL\n",
                            0, 0, 0 );
@@ -679,9 +662,9 @@ approx_candidates(
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "approx_candidates: return %ld\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "approx_candidates: return %ld\n", 
+               idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
@@ -701,8 +684,7 @@ list_candidates(
        Filter  *f;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "list_candidates: 0x%x\n", ftype ));
+       LDAP_LOG( FILTER, ENTRY, "list_candidates: 0x%x\n", ftype, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> list_candidates 0x%x\n", ftype, 0, 0 );
 #endif
@@ -713,8 +695,7 @@ list_candidates(
                if ( (tmp = filter_candidates( be, f )) == NULL &&
                    ftype == LDAP_FILTER_AND ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                                  "list_candidates: NULL\n" ));
+                       LDAP_LOG( FILTER, INFO, "list_candidates: NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                               "<= list_candidates NULL\n", 0, 0, 0 );
@@ -739,9 +720,8 @@ list_candidates(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "list_candidates: return %ld\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+       LDAP_LOG( FILTER, ENTRY, "list_candidates: return %ld\n",
+                  idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= list_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
@@ -767,8 +747,7 @@ substring_candidates(
        MatchingRule *mr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "substrings_candidates: enter\n" ));
+       LDAP_LOG( FILTER, ENTRY, "substrings_candidates: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> substrings_candidates\n", 0, 0, 0 );
 #endif
@@ -781,8 +760,8 @@ substring_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "substrings_candidates: index_param returned %d\n", rc ));
+               LDAP_LOG( FILTER, ERR, 
+                          "substrings_candidates: index_param returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= substrings_candidates: index_param returned=%d\n",
@@ -795,8 +774,7 @@ substring_candidates(
        if( dbname == NULL ) {
                /* not indexed */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                          "substrings_candidates: not indexed\n" ));
+               LDAP_LOG( FILTER, ERR, "substrings_candidates: not indexed\n", 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= substrings_candidates: not indexed\n",
@@ -827,9 +805,9 @@ substring_candidates(
 
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                           "substrings_candidates: (%s%s) MR filter failed (%d)\n",
-                          dbname, LDBM_SUFFIX, rc ));
+                          dbname, LDBM_SUFFIX, rc );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= substrings_candidates: (%s%s) MR filter failed (%d)\n",
@@ -841,9 +819,9 @@ substring_candidates(
 
        if( keys == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                           "substrings_candidates: (0x%04lx) no keys (%s%s)\n",
-                          mask, dbname, LDBM_SUFFIX ));
+                          mask, dbname, LDBM_SUFFIX );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "<= substrings_candidates: (0x%04lx) no keys (%s%s)\n",
@@ -857,9 +835,9 @@ substring_candidates(
        
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                           "substrings_candidates: db open failed (%s%s)\n",
-                          dbname, LDBM_SUFFIX ));
+                          dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= substrings_candidates db open failed (%s%s)\n",
@@ -879,9 +857,8 @@ substring_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                                  "substrings_candidates: key read failed (%d)\n",
-                                  rc ));
+                       LDAP_LOG( FILTER, ERR, 
+                                  "substrings_candidates: key read failed (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates key read failed (%d)\n",
                            rc, 0, 0 );
@@ -894,8 +871,7 @@ substring_candidates(
                        idl_free( idl );
                        idl = NULL;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                                  "substrings_candidates: NULL\n" ));
+                       LDAP_LOG( FILTER, INFO, "substrings_candidates: NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates NULL\n",
                            0, 0, 0 );
@@ -917,9 +893,9 @@ substring_candidates(
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( FILTER, ENTRY, 
                   "substrings_candidates: return %ld\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+                  idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
index 11f857b381ebeef3f04e40a682e7da419db4ea93..f8d5074bc8ff5dba34a8977ffe077b7a5fe9f6f3 100644 (file)
@@ -48,9 +48,9 @@ ldbm_back_group(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( BACK_LDBM, ENTRY, 
                "ldbm_back_group: check (%s) member of (%s), oc %s\n",
-               op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ));
+               op_ndn->bv_val, gr_ndn->bv_val, group_oc_name );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_group: gr dn: \"%s\"\n",
@@ -72,9 +72,8 @@ ldbm_back_group(
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_group: target is group (%s)\n",
-                       gr_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "ldbm_back_group: target is group (%s)\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> ldbm_back_group: target is group: \"%s\"\n",
@@ -86,9 +85,9 @@ ldbm_back_group(
                /* can we find group entry with reader lock */
                if ((e = dn2entry_r(be, gr_ndn, NULL )) == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "ldbm_back_group: cannot find group (%s)\n",
-                               gr_ndn->bv_val ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1, 
+                               "ldbm_back_group: cannot find group (%s)\n", 
+                               gr_ndn->bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> ldbm_back_group: cannot find group: \"%s\"\n",
@@ -99,8 +98,8 @@ ldbm_back_group(
                }
                
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> ldbm_back_group: found group: \"%s\"\n",
@@ -119,9 +118,8 @@ ldbm_back_group(
        
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_group: group (%s) is an alias\n",
-                       gr_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_group: group (%s) is an alias\n", gr_ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: group is an alias\n", 0, 0, 0 );
@@ -132,9 +130,8 @@ ldbm_back_group(
 
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_group: group (%s) is a referral.\n",
-                       gr_ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_group: group (%s) is a referral.\n", gr_ndn->bv_val,0,0);
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: group is an referral\n", 0, 0, 0 );
@@ -145,9 +142,9 @@ ldbm_back_group(
 
        if( !is_entry_objectclass( e, group_oc, 0 ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+               LDAP_LOG( BACK_LDBM, ERR, 
                        "ldbm_back_group: failed to find %s in objectClass.\n",
-                       group_oc_name ));
+                       group_oc_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: failed to find %s in objectClass\n", 
@@ -159,8 +156,8 @@ ldbm_back_group(
 
        if ((attr = attr_find(e->e_attrs, group_at)) == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_group: failed to find %s\n", group_at_name ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_group: failed to find %s\n", group_at_name, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: failed to find %s\n",
@@ -171,9 +168,9 @@ ldbm_back_group(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( BACK_LDBM, ENTRY, 
                   "ldbm_back_group: found objectClass %s and %s\n",
-                  group_oc_name, group_at_name ));
+                  group_oc_name, group_at_name, 0 );
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= ldbm_back_group: found objectClass %s and %s\n",
@@ -183,9 +180,9 @@ ldbm_back_group(
 
        if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
                        "ldbm_back_group: \"%s\" not in \"%s\": %s\n",
-                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
+                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: \"%s\" not in \"%s\": %s\n", 
@@ -197,9 +194,9 @@ ldbm_back_group(
 
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+       LDAP_LOG( BACK_LDBM, DETAIL1, 
                "ldbm_back_group: %s is in %s: %s\n",
-               op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
+               op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= ldbm_back_group: \"%s\" is in \"%s\": %s\n", 
@@ -216,8 +213,7 @@ return_results:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_back_group: rc=%d\n", rc ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_group: rc=%d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm_back_group: rc=%d\n", rc, 0, 0 ); 
 #endif
index c27496d5730b6f5a47e6370ee3ba6c71239f56a8..8c375a6c169b7b9df2c44d00cfb4a97899e0c4bd 100644 (file)
@@ -15,7 +15,6 @@
 #include "slap.h"
 #include "back-ldbm.h"
 
-
 int
 has_children(
     Backend    *be,
@@ -30,8 +29,7 @@ has_children(
        ldbm_datum_init( key );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2children", LDAP_LEVEL_ENTRY,
-                  "has_children: enter %ld\n", p->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "has_children: enter %ld\n", p->e_id, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
 #endif
@@ -40,9 +38,8 @@ has_children(
        if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX,
            LDBM_WRCREAT )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2children", LDAP_LEVEL_ERR,
-                          "has_children: could not open \"dn2id%s\"\n",
-                          LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                       "has_children: could not open \"dn2id%s\"\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= has_children -1 could not open \"dn2id%s\"\n",
@@ -68,9 +65,9 @@ has_children(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2children", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( INDEX, ENTRY, 
                   "has_children: id (%ld) %s children.\n",
-                  p->e_id, rc ? "has" : "doesn't have" ));
+                  p->e_id, rc ? "has" : "doesn't have", 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
                p->e_id, rc ? "yes" : "no", 0 );
index 0bcde14620a4f1e7ffdf4b15c6b32ab39be9702b..2f071b84420c002c7cdc9de2395138309111658e 100644 (file)
@@ -33,8 +33,7 @@ id2entry_add( Backend *be, Entry *e )
        ldbm_datum_init( data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
-                  "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %ld, \"%s\" )\n", e->e_id,
            e->e_dn, 0 );
@@ -44,9 +43,9 @@ id2entry_add( Backend *be, Entry *e )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
-                          "id2entry_add: could not open/create id2entry%s\n",
-                          LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                  "id2entry_add: could not open/create id2entry%s\n", 
+                  LDBM_SUFFIX, 0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -76,8 +75,7 @@ id2entry_add( Backend *be, Entry *e )
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
-                  "id2entry_add: return %d\n", rc ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_add: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_add %d\n", rc, 0, 0 );
 #endif
@@ -98,8 +96,7 @@ id2entry_delete( Backend *be, Entry *e )
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
-                  "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %ld, \"%s\" )\n", e->e_id,
            e->e_dn, 0 );
@@ -118,9 +115,9 @@ id2entry_delete( Backend *be, Entry *e )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_delete: could not open/create id2entry%s\n",
-                          LDBM_SUFFIX ));
+                          LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -131,9 +128,9 @@ id2entry_delete( Backend *be, Entry *e )
 
        if ( cache_delete_entry( &li->li_cache, e ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_delete: Could not delete (%s)%ld from cache\n",
-                          e->e_dn, e->e_id ));
+                          e->e_dn, e->e_id, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "could not delete %ld (%s) from cache\n",
                    e->e_id, e->e_dn, 0 );
@@ -154,8 +151,7 @@ id2entry_delete( Backend *be, Entry *e )
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
-                  "id2entry_delete: return %d\n", rc ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_delete: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_delete %d\n", rc, 0, 0 );
 #endif
@@ -179,9 +175,8 @@ id2entry_rw( Backend *be, ID id, int rw )
        ldbm_datum_init( data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
-                  "id2entry_rw: %s (%ld)\n",
-                  rw ? "write" : "read", id ));
+       LDAP_LOG( INDEX, ENTRY, 
+                  "id2entry_rw: %s (%ld)\n", rw ? "write" : "read", id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> id2entry_%s( %ld )\n",
                rw ? "w" : "r", id, 0 );
@@ -190,9 +185,9 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( INDEX, DETAIL1, 
                           "id2entry_rw: %s (%ld) 0x%lx (cache).\n",
-                          rw ? "write" : "read", id, (unsigned long)e ));
+                          rw ? "write" : "read", id, (unsigned long)e  );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
                        rw ? "w" : "r", id, (unsigned long) e );
@@ -204,8 +199,8 @@ id2entry_rw( Backend *be, ID id, int rw )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
-                          "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -226,8 +221,8 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( data.dptr == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
-                          "id2entry_rw: (%ld) not found\n", id ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: (%ld) not found\n", id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) not found\n",
                        rw ? "w" : "r", id, 0 );
@@ -243,9 +238,8 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
-                          "id2entry_rw: %s of %ld failed\n",
-                          rw ? "write" : "read", id ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: %s of %ld failed\n", rw ? "write" : "read", id, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (failed)\n",
                        rw ? "w" : "r", id, 0 );
@@ -265,9 +259,9 @@ id2entry_rw( Backend *be, ID id, int rw )
                 */
                if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "id2entry", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( INDEX, DETAIL1, 
                                   "id2entry_rw: %s of %ld 0x%lx (cache)\n",
-                                  rw ? "write" : "read", id, (unsigned long)e ));
+                                  rw ? "write" : "read", id, (unsigned long)e  );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
                                rw ? "w" : "r", id, (unsigned long) e );
@@ -277,9 +271,9 @@ id2entry_rw( Backend *be, ID id, int rw )
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_rw: %s of %ld (cache add failed)\n",
-                          rw ? "write" : "read", id ));
+                          rw ? "write" : "read", id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (cache add failed)\n",
                        rw ? "w" : "r", id, 0 );
@@ -289,9 +283,9 @@ id2entry_rw( Backend *be, ID id, int rw )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( INDEX, ENTRY, 
                   "id2entry_rw: %s of %ld 0x%lx (disk)\n",
-                  rw ? "write" : "read", id, (unsigned long)e ));
+                  rw ? "write" : "read", id, (unsigned long)e  );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (disk)\n",
                rw ? "w" : "r", id, (unsigned long) e );
index 60ca3e65946d383f7e63d8cc1c5a8d85bec41eda..a070f46adf399002cb42b59d386bad7cc9bb4f01 100644 (file)
@@ -104,8 +104,7 @@ idl_free( ID_BLOCK *idl )
 {
        if ( idl == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                          "idl_free: called with NULL pointer\n" ));
+               LDAP_LOG( INDEX, INFO, "idl_free: called with NULL pointer\n" , 0,0,0);
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "idl_free: called with NULL pointer\n",
@@ -217,8 +216,8 @@ idl_fetch(
 
                if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                                  "idl_fetch: idl_fetch_one returned NULL\n" ));
+                       LDAP_LOG( INDEX, INFO,
+                                  "idl_fetch: idl_fetch_one returned NULL\n", 0,0,0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_fetch: one returned NULL\n", 0, 0, 0 );
@@ -259,9 +258,9 @@ idl_fetch(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "idl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( INDEX, ENTRY, 
                   "idl_fetch: %ld ids (%ld max)\n",
-                  ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl) ));
+                  ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n",
               ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
@@ -408,8 +407,8 @@ idl_change_first(
        /* delete old key block */
        if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                          "idl_change_first: ldbm_cache_delete returned %d\n", rc ));
+               LDAP_LOG( INDEX, INFO, 
+                          "idl_change_first: ldbm_cache_delete returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: ldbm_cache_delete returned %d\n",
@@ -424,8 +423,8 @@ idl_change_first(
 
        if ( (rc = idl_store( be, db, bkey, b )) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                          "idl_change_first: idl_store returned %d\n", rc ));
+               LDAP_LOG( INDEX, INFO, 
+                          "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
@@ -438,8 +437,8 @@ idl_change_first(
        ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0);
        if ( (rc = idl_store( be, db, hkey, h )) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                          "idl_change_first: idl_store returned %s\n", rc ));
+               LDAP_LOG( INDEX, INFO, 
+                          "idl_change_first: idl_store returned %s\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
@@ -572,8 +571,8 @@ idl_insert_key(
 
        if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "idl", LDAP_LEVEL_ERR,
-                          "idl_insert_key: nonexistent continuation block\n" ));
+               LDAP_LOG( INDEX, ERR,
+                          "idl_insert_key: nonexistent continuation block\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "idl_insert_key: nonexistent continuation block\n",
                    0, 0, 0 );
@@ -589,8 +588,8 @@ idl_insert_key(
        case 0:         /* id inserted ok */
                if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_ERR,
-                                  "ids_insert_key: idl_store returned %d\n", rc ));
+                       LDAP_LOG( INDEX, ERR, 
+                                  "ids_insert_key: idl_store returned %d\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
@@ -632,8 +631,8 @@ idl_insert_key(
                        cont_id( &k2, ID_BLOCK_ID(idl, i) );
                        if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "idl", LDAP_LEVEL_ERR,
-                                          "idl_insert_key: idl_fetch_one returned NULL\n"));
+                               LDAP_LOG( INDEX, ERR,
+                                          "idl_insert_key: idl_fetch_one returned NULL\n", 0, 0, 0);
 #else
                                Debug( LDAP_DEBUG_ANY,
                                    "idl_insert_key: idl_fetch_one returned NULL\n",
@@ -661,8 +660,8 @@ idl_insert_key(
 
                            if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "idl", LDAP_LEVEL_ERR,
-                                              "idl_insert_key: idl_store returned %d\n", rc ));
+                               LDAP_LOG( INDEX, ERR, 
+                                       "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                            "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
@@ -692,9 +691,9 @@ idl_insert_key(
                                         */
                                if ( rc == 2 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( INDEX, INFO, 
                                                   "idl_insert_key: id %ld is already in next block\n", 
-                                                  id ));
+                                                  id, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                            "idl_insert_key: id %ld already in next block\n",
@@ -947,8 +946,8 @@ idl_delete_key (
 
                if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "idl", LDAP_LEVEL_INFO,
-                                  "idl_delete_key: idl_fetch_one returned NULL\n" ));
+                       LDAP_LOG( INDEX, INFO,
+                                  "idl_delete_key: idl_fetch_one returned NULL\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_delete_key: idl_fetch of returned NULL\n", 0, 0, 0 );
index 9257ebaabcd0f90fea8ff7962159a30a5c88bea5..f5078c0051313dffcc2ff3e3940e31349b07cba6 100644 (file)
@@ -160,9 +160,8 @@ static int indexer(
        
        if ( db == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "index", LDAP_LEVEL_ERR,
-                          "index_read: Could not open db %s%s\n",
-                          dbname, LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                          "index_read: Could not open db %s%s\n", dbname, LDBM_SUFFIX, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= index_read NULL (could not open %s%s)\n",
@@ -299,10 +298,9 @@ index_entry(
        Attribute *ap )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "index_entry: %s (%s)%ld\n",
-                  op == SLAP_INDEX_ADD_OP ? "add" : "del",
-                  e->e_dn, e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, 
+               "index_entry: %s (%s)%ld\n", op == SLAP_INDEX_ADD_OP ? "add" : "del",
+               e->e_dn, e->e_id );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
                op == SLAP_INDEX_ADD_OP ? "add" : "del",
@@ -315,8 +313,7 @@ index_entry(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "index_entry: success\n" ));
+       LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
            op == SLAP_INDEX_ADD_OP ? "add" : "del",
index d3e16e31c95b4b709180b1ca7e4aaf4f20a8e401..be55fac73c7de7d47d77186e5d3188493fb6bab5 100644 (file)
@@ -202,8 +202,8 @@ ldbm_back_db_open(
                if ( rc != 0 )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_ERR, "ldbm_back_db_open: sync "
-                       "ldap_pvt_thread_create failed (%d)\n", rc ));
+                       LDAP_LOG ( BACK_LDBM, ERR, "ldbm_back_db_open: sync "
+                               "ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
 #else  
                        Debug(  LDAP_DEBUG_ANY,
                                "sync ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
index f84dd62790f0e2e98e73b5e46cbd65e80e3bb460..0ea188a473bdf1c6f3d185da46c0ffa41495683c 100644 (file)
@@ -28,8 +28,7 @@ key_read(
        ID_BLOCK                *idl;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "key_read: enter\n" ));
+       LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
 #endif
@@ -42,9 +41,8 @@ key_read(
        idl = idl_fetch( be, db, key );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "key_read: %ld candidates\n",
-                  idl ? ID_BLOCK_NIDS(idl) : 0 ));
+       LDAP_LOG( INDEX, ENTRY, 
+                  "key_read: %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n",
               idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
@@ -69,9 +67,8 @@ key_change(
        Datum   key;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "key_change: %s ID %lx\n",
-                  op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id ));
+       LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n",
+                  op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
                op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
@@ -95,8 +92,7 @@ key_change(
 
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
-                  "key_change: return %d\n", rc ));
+       LDAP_LOG( INDEX, ENTRY, "key_change: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
 #endif
index 03f81b1687aa2675d3faa87f8f9577538e062331..a34cc06e979d6ed07a4d41966dd468b2f294f327 100644 (file)
@@ -41,8 +41,7 @@ int ldbm_modify_internal(
        Attribute       *ap;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_modify_internal: %s\n", dn ));
+       LDAP_LOG( BACK_LDBM, ENTRY,  "ldbm_modify_internal: %s\n", dn, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", dn, 0, 0);
 #endif
@@ -61,8 +60,7 @@ int ldbm_modify_internal(
                switch ( mod->sm_op ) {
                case LDAP_MOD_ADD:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "ldbm_modify_internal: add\n" ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: add\n", 0, 0, 0);
 #else
                        Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0);
 #endif
@@ -70,9 +68,8 @@ int ldbm_modify_internal(
                        rc = modify_add_values( e, mod, text, textbuf, textlen );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                       "ldbm_modify_internal: failed %d (%s)\n",
-                                       rc, *text ));
+                               LDAP_LOG( BACK_LDBM, INFO, 
+                                       "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
                                        rc, *text, 0);
@@ -82,8 +79,7 @@ int ldbm_modify_internal(
 
                case LDAP_MOD_DELETE:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "ldbm_modify_internal: delete\n" ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: delete\n", 0,0,0);
 #else
                        Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0);
 #endif
@@ -92,8 +88,8 @@ int ldbm_modify_internal(
                        assert( rc != LDAP_TYPE_OR_VALUE_EXISTS );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                       "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+                               LDAP_LOG( BACK_LDBM, INFO, 
+                                       "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
                                        rc, *text, 0);
@@ -103,8 +99,7 @@ int ldbm_modify_internal(
 
                case LDAP_MOD_REPLACE:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "ldbm_modify_internal:  replace\n" ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal:  replace\n",0,0,0);
 #else
                        Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0);
 #endif
@@ -112,8 +107,8 @@ int ldbm_modify_internal(
                        rc = modify_replace_values( e, mod, text, textbuf, textlen );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                       "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+                               LDAP_LOG( BACK_LDBM, INFO, 
+                                       "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
                                        rc, *text, 0);
@@ -123,8 +118,8 @@ int ldbm_modify_internal(
 
                case SLAP_MOD_SOFTADD:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "ldbm_modify_internal: softadd\n" ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1, 
+                               "ldbm_modify_internal: softadd\n", 0, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0);
 #endif
@@ -141,8 +136,8 @@ int ldbm_modify_internal(
 
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                          "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+                               LDAP_LOG( BACK_LDBM, INFO, 
+                                          "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
 #else
                                Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
                                        rc, *text, 0);
@@ -152,8 +147,8 @@ int ldbm_modify_internal(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                               "ldbm_modify_internal: invalid op %d\n", mod->sm_op ));
+                       LDAP_LOG( BACK_LDBM, ERR, 
+                               "ldbm_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n",
                                mod->sm_op, 0, 0);
@@ -162,8 +157,8 @@ int ldbm_modify_internal(
                        rc = LDAP_OTHER;
                        *text = "Invalid modify operation";
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "ldbm_modify_internal: %d (%s)\n", rc, *text ));
+                       LDAP_LOG( BACK_LDBM, INFO, 
+                               "ldbm_modify_internal: %d (%s)\n", rc, *text, 0 );
 #else
                        Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
                                rc, *text, 0);
@@ -194,9 +189,9 @@ int ldbm_modify_internal(
        rc = entry_schema_check( be, e, save_attrs, text, textbuf, textlen );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                       "ldbm_modify_internal: entry failed schema check: %s\n",
-                       *text ));
+               LDAP_LOG( BACK_LDBM, ERR, 
+                       "ldbm_modify_internal: entry failed schema check: %s\n", 
+                       *text, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
                        *text, 0, 0 );
@@ -220,8 +215,9 @@ int ldbm_modify_internal(
                                           SLAP_INDEX_DELETE_OP );
                        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                          "ldbm_modify_internal: Attribute index delete failure\n" ));
+                               LDAP_LOG( BACK_LDBM, ERR,
+                                       "ldbm_modify_internal: Attribute index delete failure\n",
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "Attribute index delete failure",
@@ -240,8 +236,9 @@ int ldbm_modify_internal(
                                           SLAP_INDEX_ADD_OP );
                        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                          "ldbm_modify_internal: Attribute index add failure\n" ));
+                               LDAP_LOG( BACK_LDBM, ERR,
+                                       "ldbm_modify_internal: Attribute index add failure\n",
+                                       0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "Attribute index add failure",
@@ -287,8 +284,7 @@ ldbm_back_modify(
        size_t textlen = sizeof textbuf;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_back_modify: enter\n" ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_modify: enter\n", 0, 0, 0);
 #else
        Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
 #endif
@@ -329,8 +325,8 @@ ldbm_back_modify(
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                          "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                    0, 0 );
index 59aee6894c5d6a2318369dc978ef29c46b4a4701..eb01cee71dfb28018ac3d06b4858fac0b735f0de 100644 (file)
@@ -74,11 +74,10 @@ ldbm_back_modrdn(
        int             manageDSAit = get_manageDSAit( op );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( BACK_LDBM, ENTRY, 
                "ldbm_back_modrdn: dn: %s newSuperior=%s\n", 
                dn->bv_len ? dn->bv_val : "NULL",
-               ( newSuperior && newSuperior->bv_len )
-                       ? newSuperior->bv_val : "NULL" ));
+               ( newSuperior && newSuperior->bv_len ) ? newSuperior->bv_val : "NULL",0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "==>ldbm_back_modrdn: dn: %s newSuperior=%s\n", 
@@ -124,8 +123,8 @@ ldbm_back_modrdn(
                        conn, op, e );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_modrdn: entry %s is a referral\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_modrdn: entry %s is a referral\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry %s is referral\n", e->e_dn,
                    0, 0 );
@@ -140,8 +139,8 @@ ldbm_back_modrdn(
 
        if ( has_children( be, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_modrdn: entry %s has children\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                       "ldbm_back_modrdn: entry %s has children\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "entry %s has children\n", e->e_dn,
                    0, 0 );
@@ -165,8 +164,9 @@ ldbm_back_modrdn(
 
                if( (p = dn2entry_w( be, &p_ndn, NULL )) == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "ldbm_back_modrdn: parent of %s does not exist\n", e->e_ndn ));
+                       LDAP_LOG( BACK_LDBM, INFO, 
+                               "ldbm_back_modrdn: parent of %s does not exist\n", 
+                               e->e_ndn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
                                0, 0, 0);
@@ -183,8 +183,9 @@ ldbm_back_modrdn(
                        children, NULL, ACL_WRITE, NULL ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                  "ldbm_back_modrdn: no access to parent of (%s)\n", e->e_dn ));
+                       LDAP_LOG( BACK_LDBM, INFO, 
+                               "ldbm_back_modrdn: no access to parent of (%s)\n", 
+                               e->e_dn, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
                                0, 0 );
@@ -196,9 +197,9 @@ ldbm_back_modrdn(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "ldbm_back_modrdn: wr to children of entry %s OK\n",
-                          p_ndn.bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                       "ldbm_back_modrdn: wr to children of entry %s OK\n", 
+                       p_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                       "ldbm_back_modrdn: wr to children of entry %s OK\n",
@@ -212,8 +213,8 @@ ldbm_back_modrdn(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val ));
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
+                          "ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: parent dn=%s\n",
                       p_dn.bv_val, 0, 0 );
@@ -233,9 +234,8 @@ ldbm_back_modrdn(
                                /* check parent for "children" acl */
                                if ( ! rc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                               "ldbm_back_modrdn: no access "
-                                               "to parent \"\"\n" ));
+                                       LDAP_LOG( BACK_LDBM, ERR,
+                                               "ldbm_back_modrdn: no access to parent \"\"\n", 0,0,0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "<=- ldbm_back_modrdn: no "
@@ -250,9 +250,9 @@ ldbm_back_modrdn(
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                          "ldbm_back_modrdn: (%s) has no "
-                                          "parent & not a root.\n", dn ));
+                               LDAP_LOG( BACK_LDBM, ERR, 
+                                       "ldbm_back_modrdn: (%s) has no parent & not a root.\n", 
+                                       dn, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "<=- ldbm_back_modrdn: no parent & "
@@ -267,8 +267,8 @@ ldbm_back_modrdn(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_modrdn: (%s) no parent, locked root.\n", e->e_dn ));
+               LDAP_LOG( BACK_LDBM, INFO, 
+                  "ldbm_back_modrdn: (%s) no parent, locked root.\n", e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                       "ldbm_back_modrdn: no parent, locked root\n",
@@ -280,9 +280,9 @@ ldbm_back_modrdn(
 
        if ( newSuperior != NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BACK_LDBM, DETAIL1, 
                        "ldbm_back_modrdn: new parent \"%s\" requested\n",
-                       newSuperior->bv_val ));
+                       newSuperior->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, 
                        "ldbm_back_modrdn: new parent \"%s\" requested...\n",
@@ -294,10 +294,9 @@ ldbm_back_modrdn(
                /* newSuperior == oldParent? */
                if ( dn_match( &p_ndn, np_ndn ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO, "ldbm_back_modrdn: "
+                       LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: "
                                "new parent\"%s\" seems to be the same as the "
-                               "old parent \"%s\"\n",
-                               newSuperior->bv_val, p_dn.bv_val ));
+                               "old parent \"%s\"\n", newSuperior->bv_val, p_dn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: "
                                "new parent\"%s\" seems to be the same as the "
@@ -316,8 +315,9 @@ ldbm_back_modrdn(
                if ( nnewSuperior->bv_len ) {
                        if( (np = dn2entry_w( be, np_ndn, NULL )) == NULL) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                       "ldbm_back_modrdn: newSup(ndn=%s) not found.\n", np_ndn->bv_val ));
+                               LDAP_LOG( BACK_LDBM, ERR, 
+                                       "ldbm_back_modrdn: newSup(ndn=%s) not found.\n", 
+                                       np_ndn->bv_val, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                    "ldbm_back_modrdn: newSup(ndn=%s) not here!\n",
@@ -330,9 +330,9 @@ ldbm_back_modrdn(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( BACK_LDBM, DETAIL1,
                                "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n",
-                               np, np->e_id ));
+                               np, np->e_id, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n",
@@ -344,8 +344,8 @@ ldbm_back_modrdn(
                                              ACL_WRITE, NULL ) )
                        {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                          "ldbm_back_modrdn: no wr to newSup children.\n" ));
+                               LDAP_LOG( BACK_LDBM, INFO,
+                                  "ldbm_back_modrdn: no wr to newSup children.\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                       "ldbm_back_modrdn: no wr to newSup children\n",
@@ -360,8 +360,8 @@ ldbm_back_modrdn(
                        if ( is_entry_alias( np ) ) {
                                /* parent is an alias, don't allow add */
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                          "ldbm_back_modrdn: entry (%s) is an alias.\n", np->e_dn ));
+                               LDAP_LOG( BACK_LDBM, INFO,
+                                  "ldbm_back_modrdn: entry (%s) is an alias.\n", np->e_dn,0,0);
 #else
                                Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 );
 #endif
@@ -376,9 +376,9 @@ ldbm_back_modrdn(
                        if ( is_entry_referral( np ) ) {
                                /* parent is a referral, don't allow add */
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                               LDAP_LOG( BACK_LDBM, INFO,
                                        "ldbm_back_modrdn: entry (%s) is a referral\n",
-                               np->e_dn ));
+                                       np->e_dn, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "entry (%s) is referral\n",
                                        np->e_dn, 0, 0 );
@@ -408,9 +408,9 @@ ldbm_back_modrdn(
                                        /* check parent for "children" acl */
                                        if ( ! rc ) {
 #ifdef NEW_LOGGING
-                                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                                               LDAP_LOG( BACK_LDBM, ERR,
                                                        "ldbm_back_modrdn: no access "
-                                                       "to new superior \"\"\n" ));
+                                                       "to new superior \"\"\n", 0, 0, 0 );
 #else
                                                Debug( LDAP_DEBUG_TRACE,
                                                        "<=- ldbm_back_modrdn: no "
@@ -425,9 +425,9 @@ ldbm_back_modrdn(
 
                                } else {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                                  "ldbm_back_modrdn: \"\" "
-                                                  "not allowed as new superior\n" ));
+                                       LDAP_LOG( BACK_LDBM, ERR,
+                                               "ldbm_back_modrdn: \"\" not allowed as new superior\n",
+                                               0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_TRACE,
                                                "<=- ldbm_back_modrdn: \"\" "
@@ -444,8 +444,8 @@ ldbm_back_modrdn(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_modrdn: wr to new parent's children OK.\n" ));
+               LDAP_LOG( BACK_LDBM, DETAIL1,
+                       "ldbm_back_modrdn: wr to new parent's children OK.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "ldbm_back_modrdn: wr to new parent's children OK\n",
@@ -460,8 +460,8 @@ ldbm_back_modrdn(
        dnNormalize2( NULL, &new_dn, &new_ndn );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-               "ldbm_back_modrdn: new ndn=%s\n", new_ndn.bv_val ));
+       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: new ndn=%s\n", 
+               new_ndn.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s\n",
            new_ndn.bv_val, 0, 0 );
@@ -481,8 +481,8 @@ ldbm_back_modrdn(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-               "ldbm_back_modrdn: new ndn (%s) does not exist\n", new_ndn.bv_val ));
+       LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: new ndn (%s) does not exist\n",
+               new_ndn.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
            "ldbm_back_modrdn: new ndn=%s does not exist\n",
@@ -497,8 +497,9 @@ ldbm_back_modrdn(
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n" ));
+               LDAP_LOG( BACK_LDBM, INFO,
+                       "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n",
+                       0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                    "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n",
@@ -511,9 +512,9 @@ ldbm_back_modrdn(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                  "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
-                  new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val ));
+       LDAP_LOG( BACK_LDBM, DETAIL1,
+               "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
+               new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
               "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
@@ -525,8 +526,9 @@ ldbm_back_modrdn(
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_modrdn: can't figure out the old_rdn type(s)/value(s).\n" ));
+               LDAP_LOG( BACK_LDBM, INFO,
+                       "ldbm_back_modrdn: can't figure out the old_rdn "
+                       "type(s)/value(s).\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                       "ldbm_back_modrdn: can't figure out the old_rdn type(s)/value(s)\n",
@@ -544,9 +546,9 @@ ldbm_back_modrdn(
        {
            /* Not a big deal but we may say something */
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+           LDAP_LOG( BACK_LDBM, INFO,
                       "ldbm_back_modrdn: old_rdn_type=%s new_rdn_type=%s\n",
-                      old_rdn_types[0], new_rdn_types[0] ));
+                      old_rdn_types[0], new_rdn_types[0], 0 );
 #else
            Debug( LDAP_DEBUG_TRACE,
                   "ldbm_back_modrdn: old_rdn_type=%s, new_rdn_type=%s!\n",
@@ -556,8 +558,7 @@ ldbm_back_modrdn(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                  "ldbm_back_modrdn:  DN_X500\n" ));
+       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn:  DN_X500\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DN_X500\n",
               0, 0, 0 );
@@ -573,9 +574,9 @@ ldbm_back_modrdn(
 
                if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                  "ldbm_back_modrdn: slap_bv2ad error: %s (%s)\n",
-                                  text, new_rdn[0][a_cnt]->la_attr.bv_val ));
+                       LDAP_LOG( BACK_LDBM, INFO,
+                               "ldbm_back_modrdn: slap_bv2ad error: %s (%s)\n",
+                               text, new_rdn[0][a_cnt]->la_attr.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_back_modrdn: %s: %s (new)\n",
@@ -591,10 +592,9 @@ ldbm_back_modrdn(
                if ( ! access_allowed( be, conn, op, e, 
                                desc, &new_rdn[0][a_cnt]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                  "ldbm_back_modrdn: access "
-                                  "not allowed to attr \"%s\"\n",
-                                  new_rdn[0][a_cnt]->la_attr.bv_val ));
+                       LDAP_LOG( BACK_LDBM, INFO,
+                               "ldbm_back_modrdn: access not allowed to attr \"%s\"\n",
+                                  new_rdn[0][a_cnt]->la_attr.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_back_modrdn: access not allowed "
@@ -624,8 +624,9 @@ ldbm_back_modrdn(
                /* Get value of old rdn */
                if ( old_rdn == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                  "ldbm_back_modrdn: can't figure out old RDN value(s) from old RDN\n" ));
+                       LDAP_LOG( BACK_LDBM, INFO,
+                          "ldbm_back_modrdn: can't figure out old RDN value(s) "
+                          "from old RDN\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                               "ldbm_back_modrdn: can't figure out oldRDN value(s) from old RDN\n",
@@ -646,9 +647,9 @@ ldbm_back_modrdn(
 
                        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                          "ldbm_back_modrdn: %s: %s (old)\n",
-                                          text, old_rdn[0][d_cnt]->la_attr.bv_val ));
+                               LDAP_LOG( BACK_LDBM, INFO,
+                                  "ldbm_back_modrdn: %s: %s (old)\n",
+                                       text, old_rdn[0][d_cnt]->la_attr.bv_val, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldbm_back_modrdn: %s: %s (old)\n",
@@ -664,10 +665,9 @@ ldbm_back_modrdn(
                        if ( ! access_allowed( be, conn, op, e, 
                                        desc, &old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                                          "ldbm_back_modrdn: access "
-                                          "not allowed to attr \"%s\"\n",
-                                          old_rdn[0][d_cnt]->la_attr.bv_val ));
+                               LDAP_LOG( BACK_LDBM, INFO,
+                                  "ldbm_back_modrdn: access not allowed to attr \"%s\"\n",
+                                          old_rdn[0][d_cnt]->la_attr.bv_val, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldbm_back_modrdn: access not allowed "
@@ -693,8 +693,9 @@ ldbm_back_modrdn(
                        mod = mod_tmp;
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                  "ldbm_back_modrdn: removing old_rdn_val=%s\n", old_rdn[0][d_cnt]->la_value.bv_val ));
+                       LDAP_LOG( BACK_LDBM, DETAIL1,
+                          "ldbm_back_modrdn: removing old_rdn_val=%s\n", 
+                          old_rdn[0][d_cnt]->la_value.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                               "ldbm_back_modrdn: removing old_rdn_val=%s\n",
index 80f6f0f61f89c022dde08a1817909b95dd57b94c..8159ccf39ba8abfd20d1a0703ed32fe815743676 100644 (file)
@@ -27,8 +27,8 @@ next_id_read( Backend *be, ID *idp )
        if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                          "next_id_read: could not open/create nextid%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, CRIT,
+                  "next_id_read: could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n",
                        0, 0, 0 );
@@ -66,8 +66,8 @@ next_id_write( Backend *be, ID id )
        if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                          "next_id_write: Could not open/create nextid%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, CRIT,
+                 "next_id_write: Could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n",
                    0, 0, 0 );
index ae0f245858baf04814381e36a3d84261622085b1..e7df1ae28fa5e3249901e93dace665fa0ff3eb1f 100644 (file)
@@ -48,9 +48,8 @@ ldbm_back_exop_passwd(
                &id, NULL, &new, text );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_back_exop_passwd: \"%s\"\n",
-                  id.bv_val ? id.bv_val : "" ));
+       LDAP_LOG( BACK_LDBM, ENTRY,
+                  "ldbm_back_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0,0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "==> ldbm_back_exop_passwd: \"%s\"\n",
                id.bv_val ? id.bv_val : "", 0, 0 );
@@ -88,9 +87,9 @@ ldbm_back_exop_passwd(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+       LDAP_LOG( BACK_LDBM, DETAIL1,
                "ldbm_back_exop_passwd: \"%s\"%s\n",
-               dn.bv_val, id.bv_len ? " (proxy)" : "" ));
+               dn.bv_val, id.bv_len ? " (proxy)" : "", 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "passwd: \"%s\"%s\n",
                dn.bv_val, id.bv_len ? " (proxy)" : "", 0 );
index 48bb7886cc53017d2b837fb7d9d9a152cff52b2c..a1e34bd5b830b4019ff9f4d2c88d52d3bfdc6746 100644 (file)
@@ -51,9 +51,9 @@ ldbm_back_referrals(
                        matched_dn = ch_strdup( matched->e_dn );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( BACK_LDBM, DETAIL1,
                                "ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                               op->o_tag, dn->bv_val, matched_dn ));
+                               op->o_tag, dn->bv_val, matched_dn );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
@@ -98,9 +98,9 @@ ldbm_back_referrals(
                        refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( BACK_LDBM, DETAIL1,
                        "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       op->o_tag, dn->bv_val, e->e_dn ));
+                       op->o_tag, dn->bv_val, e->e_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
index 91549f1b8b4c8d4a2d3b013df766e0e304ce1920..87f4b9278b1676360089b3b42d5fd18445464e53 100644 (file)
@@ -58,8 +58,7 @@ ldbm_back_search(
        int isroot = 0;
                
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_back_search: enter\n" ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_search: enter\n", 0, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "=> ldbm_back_search\n", 0, 0, 0);
 #endif
@@ -142,9 +141,9 @@ ldbm_back_search(
                ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+               LDAP_LOG( BACK_LDBM, INFO,
                        "ldbm_search: entry (%s) is a referral.\n",
-                       e->e_dn ));
+                       e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldbm_search: entry is referral\n",
@@ -198,8 +197,8 @@ searchit:
        if ( candidates == NULL ) {
                /* no candidates */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                       "ldbm_search: no candidates\n" ));
+               LDAP_LOG( BACK_LDBM, INFO,
+                       "ldbm_search: no candidates\n" , 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "ldbm_search: no candidates\n",
                        0, 0, 0 );
@@ -313,8 +312,8 @@ searchit:
 
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "ldbm_search: candidate %ld not found.\n", id ));
+                       LDAP_LOG( BACK_LDBM, INFO,
+                               "ldbm_search: candidate %ld not found.\n", id, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_search: candidate %ld not found\n",
@@ -352,8 +351,8 @@ searchit:
                        } else if ( dnIsSuffix( &e->e_nname, &realbase ) ) {
                                /* alias is within scope */
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "ldbm_search: alias \"%s\" in subtree\n", e->e_dn ));
+                               LDAP_LOG( BACK_LDBM, DETAIL1,
+                                       "ldbm_search: alias \"%s\" in subtree\n", e->e_dn, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldbm_search: alias \"%s\" in subtree\n",
@@ -408,9 +407,9 @@ searchit:
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2,
+                               LDAP_LOG( BACK_LDBM, DETAIL2,
                                        "ldbm_search: candidate referral %ld scope not okay\n",
-                                       id ));
+                                       id, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldbm_search: candidate referral %ld scope not okay\n",
@@ -470,8 +469,9 @@ searchit:
                                }
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2,
-                                       "ldbm_search: candidate entry %ld scope not okay\n", id ));
+                               LDAP_LOG( BACK_LDBM, DETAIL2,
+                                       "ldbm_search: candidate entry %ld scope not okay\n", 
+                                       id, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldbm_search: candidate entry %ld scope not okay\n",
@@ -481,8 +481,9 @@ searchit:
 
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2,
-                               "ldbm_search: candidate entry %ld does not match filter\n", id ));
+                       LDAP_LOG( BACK_LDBM, DETAIL2,
+                               "ldbm_search: candidate entry %ld does not match filter\n", 
+                               id, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_search: candidate entry %ld does not match filter\n",
@@ -525,8 +526,7 @@ base_candidate(
        ID_BLOCK                *idl;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "base_candidate: base (%s)\n", e->e_dn ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "base_candidate: base (%s)\n", e->e_dn, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "base_candidates: base: \"%s\"\n",
                e->e_dn, 0, 0);
@@ -555,9 +555,9 @@ search_candidates(
        struct berval bv_alias = { sizeof("ALIAS")-1, "ALIAS" };
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+       LDAP_LOG( BACK_LDBM, DETAIL1,
                   "search_candidates: base (%s) scope %d deref %d\n",
-                  e->e_ndn, scope, deref ));
+                  e->e_ndn, scope, deref );
 #else
        Debug(LDAP_DEBUG_TRACE,
                "search_candidates: base=\"%s\" s=%d d=%d\n",
index f8858c485bc507920a8d45d90875f70103685f89..5d0855bfe53ed749a95d6268b5d6b0854fa572e8 100644 (file)
@@ -47,8 +47,8 @@ int ldbm_tool_entry_open(
        if ( (id2entry = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, flags ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                          "Could not open/create id2entry%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( BACK_LDBM, CRIT,
+                          "Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry" LDBM_SUFFIX "\n",
                    0, 0, 0 );
@@ -189,8 +189,8 @@ ID ldbm_tool_entry_put(
        e->e_id = li->li_nextid++;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "ldbm_tool_entry_put: (%s)%ld\n", e->e_dn, e->e_id ));
+       LDAP_LOG( BACK_LDBM, ENTRY,
+               "ldbm_tool_entry_put: (%s)%ld\n", e->e_dn, e->e_id ,0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_put( %ld, \"%s\" )\n",
                e->e_id, e->e_dn, 0 );
@@ -204,9 +204,9 @@ ID ldbm_tool_entry_put(
 
        if( id != NOID ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+               LDAP_LOG( BACK_LDBM, ENTRY,
                        "ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n",
-                       e->e_dn, id ));
+                       e->e_dn, id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "<= ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n",
@@ -262,8 +262,8 @@ int ldbm_tool_entry_reindex(
        Entry *e;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_tool_entry_reindex: ID=%ld\n", (long)id ));
+       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_tool_entry_reindex: ID=%ld\n", 
+               (long)id, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "=> ldbm_tool_entry_reindex( %ld )\n",
                (long) id, 0, 0 );
@@ -274,9 +274,9 @@ int ldbm_tool_entry_reindex(
 
        if( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_tool_entry_reindex: could not locate id %ld\n", 
-                          (long)id ));
+               LDAP_LOG( BACK_LDBM, INFO,
+                  "ldbm_tool_entry_reindex: could not locate id %ld\n", 
+                  (long)id, 0, 0  );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "ldbm_tool_entry_reindex:: could not locate id=%ld\n",
@@ -294,8 +294,8 @@ int ldbm_tool_entry_reindex(
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_tool_entry_reindex: (%s) %ld\n", e->e_dn, id ));
+       LDAP_LOG( BACK_LDBM, ENTRY,
+                  "ldbm_tool_entry_reindex: (%s) %ld\n", e->e_dn, id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_reindex( %ld, \"%s\" )\n",
                id, e->e_dn, 0 );
index 07806e6ea848d32255b50f756ef2ae1b9ef45557..ce3d73fecdb4175218be7f7343a1fc638c5ee778 100644 (file)
@@ -92,8 +92,7 @@ meta_back_add(
        struct berval mdn = { 0, NULL }, mapped;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "meta_back_add: %s\n",
-                       e->e_dn ));
+       LDAP_LOG( BACK_META, ENTRY, "meta_back_add: %s\n", e->e_dn, 0, 0 );
 #else /* !NEW_LOGGING */
        Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n%s%s", e->e_dn, "", "");
 #endif /* !NEW_LOGGING */
@@ -122,9 +121,8 @@ meta_back_add(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] addDn: \"%s\" -> \"%s\"\n",
-                               e->e_dn, mdn.bv_val ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] addDn: \"%s\" -> \"%s\"\n", e->e_dn, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s", 
                                e->e_dn, mdn.bv_val, "" );
index 808bb689099217f02146fa397ce8166bf3095ee8..9dc738a87327d977d4bee30a420a2dd9b20d4df0 100644 (file)
@@ -102,8 +102,8 @@ meta_back_bind(
        int realmethod = method;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                       "meta_back_bind: dn: %s.\n", dn->bv_val ));
+       LDAP_LOG( BACK_META, ENTRY,
+                       "meta_back_bind: dn: %s.\n", dn->bv_val, 0, 0 );
 #else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s", dn->bv_val, "", "" );
 #endif /* !NEW_LOGGING */
@@ -117,9 +117,8 @@ meta_back_bind(
        lc = meta_back_getconn( li, conn, op, op_type, ndn, NULL );
        if ( !lc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_NOTICE,
-                               "meta_back_bind: no target for dn %s.\n",
-                               dn->bv_val ));
+               LDAP_LOG( BACK_META, NOTICE,
+                               "meta_back_bind: no target for dn %s.\n", dn->bv_val, 0, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ANY,
                                "meta_back_bind: no target for dn %s.\n%s%s",
@@ -153,10 +152,10 @@ meta_back_bind(
                         * ONE CANDIDATE ONLY!
                         */
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_WARNING,
+                       LDAP_LOG( BACK_META, WARNING,
                                        "==>meta_back_bind: more than one"
                                        " candidate is attempting to bind"
-                                       " ...\n" ));
+                                       " ...\n" , 0, 0, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_bind: more than one"
@@ -248,8 +247,8 @@ meta_back_do_single_bind(
                        mdn = *dn;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> bindDn: \"%s\" -> \"%s\"\n%s",
@@ -334,12 +333,12 @@ meta_back_dobind( struct metaconn *lc, Operation *op )
                if ( rc != LDAP_SUCCESS ) {
                        
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_WARNING,
+                       LDAP_LOG( BACK_META, WARNING,
                                        "meta_back_dobind: (anonymous)"
                                        " bind as \"%s\" failed"
                                        " with error \"%s\"\n",
                                        lsc[ 0 ]->bound_dn.bv_val,
-                                       ldap_err2string( rc ) ));
+                                       ldap_err2string( rc ), 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_dobind: (anonymous)"
@@ -424,12 +423,12 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
                        err = ldap_back_map_result( err );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_RESULTS,
+                       LDAP_LOG( BACK_META, RESULTS,
                                        "meta_back_op_result: target"
                                        " <%d> sending msg \"%s\""
                                        " (matched \"%s\")\n",
                                        i, ( msg ? msg : "" ),
-                                       ( match ? match : "" ) ));
+                                       ( match ? match : "" ) );
 #else /* !NEW_LOGGING */
                        Debug(LDAP_DEBUG_ANY,
                                        "==> meta_back_op_result: target"
index 653a951e249067ccdfdb6eee4d8d5af99e7dfa46..40cc65159ace4f554e7a14785b47ae1ec535423a 100644 (file)
@@ -127,9 +127,8 @@ meta_back_compare(
                                mdn = ( char * )dn->bv_val;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] compareDn: \"%s\" -> \"%s\"\n",
-                                       dn->bv_val, mdn ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] compareDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> compareDn: \"%s\" -> \"%s\"\n%s",
@@ -314,9 +313,8 @@ finish:;
                                mmatch = ( char * )match;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] matchedDn: \"%s\" -> \"%s\"\n",
-                                       match, mmatch ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] matchedDn: \"%s\" -> \"%s\"\n", match, mmatch, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
                                        " \"%s\" -> \"%s\"\n%s",
index 8f17f60590917869eb9784313da395c6e2916e26..739af0e44b5ab6c1ebf767d319027dfdac17327d 100644 (file)
@@ -289,9 +289,9 @@ init_one_conn(
                                ber_dupbv( &lsc->bound_dn, &conn->c_dn );
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] bindDn: \"%s\" -> \"%s\"\n",
-                                       conn->c_dn.bv_val, lsc->bound_dn.bv_val ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] bindDn: \"%s\" -> \"%s\"\n",
+                               conn->c_dn.bv_val, lsc->bound_dn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> bindDn: \"%s\" -> \"%s\"\n",
@@ -402,10 +402,9 @@ meta_back_getconn(
                }
                                
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "meta_back_getconn: got target %d"
-                               " for ndn=\"%s\" from cache\n", 
-                               i, ndn->bv_val ));
+               LDAP_LOG( BACK_META, INFO,
+                       "meta_back_getconn: got target %d for ndn=\"%s\" from cache\n", 
+                       i, ndn->bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_CACHE,
        "==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n%s",
@@ -513,9 +512,8 @@ meta_back_getconn(
                ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "meta_back_getconn: conn %ld inserted\n",
-                               lc->conn->c_connid ));
+               LDAP_LOG( BACK_META, INFO,
+                       "meta_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0);
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_getconn: conn %ld inserted\n%s%s",
@@ -533,9 +531,8 @@ meta_back_getconn(
                }
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "meta_back_getconn: conn %ld fetched\n",
-                               lc->conn->c_connid ));
+               LDAP_LOG( BACK_META, INFO,
+                       "meta_back_getconn: conn %ld fetched\n", lc->conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_getconn: conn %ld fetched\n%s%s",
index 7f2087347bde557ccbfefe6f478270a75b7c8fe8..21613c591df294cce871d3b1d0e83c36f0ec2673 100644 (file)
@@ -108,9 +108,8 @@ meta_back_delete(
                        mdn = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] deleteDn: \"%s\" -> \"%s\"\n",
-                               dn->bv_val, mdn ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn, "" );
index 53b5ed5aee298853e73f080fe2f80d98ca875eb2..14d624aa30b31097a33cb3d2b48eb77714caf4dc 100644 (file)
@@ -75,7 +75,6 @@
 #include "../back-ldap/back-ldap.h"
 #include "back-meta.h"
 
-
 /* return 0 IFF op_dn is a value in group_at (member) attribute
  * of entry with gr_dn AND that entry has an objectClass
  * value of group_oc (groupOfNames)
@@ -171,10 +170,9 @@ meta_back_group(
                        mop_ndn = *op_ndn;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] bindDn (op ndn in group):"
-                               " \"%s\" -> \"%s\"\n",
-                                op_ndn->bv_val, mop_ndn.bv_val));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] bindDn (op ndn in group): \"%s\" -> \"%s\"\n",
+                       op_ndn->bv_val, mop_ndn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> bindDn (op ndn in group):"
@@ -203,10 +201,9 @@ meta_back_group(
                        mgr_ndn = *gr_ndn;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] searchBase (gr ndn in group):"
-                               " \"%s\" -> \"%s\"\n",
-                               gr_ndn->bv_val, mgr_ndn.bv_val ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] searchBase (gr ndn in group): \"%s\" -> \"%s\"\n",
+                       gr_ndn->bv_val, mgr_ndn.bv_val, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> searchBase (gr ndn in group):"
index fb1b676e01ab319c7cfd2aac251feb7403ad5262..9a2813e38c8d58afb8ce6ad5dbf8966896c4aace 100644 (file)
@@ -112,9 +112,8 @@ meta_back_modify(
                        mdn = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] modifyDn: \"%s\" -> \"%s\"\n",
-                               dn->bv_val, mdn ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> modifyDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn, "" );
index c790e52bf56864115dfb57c60b7312f0676d70e2..1ce1c53146c9849c8b48dcb5cf297a66b80b269e 100644 (file)
@@ -143,10 +143,9 @@ meta_back_modrdn(
                                mnewSuperior = ( char * )newSuperior;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] newSuperiorDn:"
-                                       " \"%s\" -> \"%s\"\n",
-                                       newSuperior, mnewSuperior ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] newSuperiorDn: \"%s\" -> \"%s\"\n",
+                               newSuperior, mnewSuperior, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> newSuperiorDn:"
                                        " \"%s\" -> \"%s\"\n%s",
@@ -176,9 +175,8 @@ meta_back_modrdn(
                        mdn = ( char * )dn->bv_val;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] modrDn: \"%s\" -> \"%s\"\n",
-                               dn->bv_val, mdn ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> modrDn: \"%s\" -> \"%s\"\n%s",
                                dn->bv_val, mdn, "" );
index 7d00e2a2ff4cb5579f5145059a8a326b2a72c686..55c05a746d62c78b9b725738e2c3c2b428ba675d 100644 (file)
@@ -77,6 +77,7 @@
 #include "back-meta.h"
 #include "ldap_pvt.h"
 #undef ldap_debug      /* silence a warning in ldap-int.h */
+#include "ldap_log.h"
 #include "../../../libraries/libldap/ldap-int.h"
 
 static void
@@ -277,9 +278,8 @@ meta_back_search(
                        mbase = realbase;
                }
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                               "[rw] searchBase: \"%s\" -> \"%s\"\n",
-                               base->bv_val, mbase ));
+               LDAP_LOG( BACK_META, DETAIL1,
+                       "[rw] searchBase: \"%s\" -> \"%s\"\n", base->bv_val, mbase, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> searchBase: \"%s\" -> \"%s\"\n%s",
                                base->bv_val, mbase, "" );
@@ -317,9 +317,9 @@ meta_back_search(
                                mfilter = *filterstr;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] searchFilter: \"%s\" -> \"%s\"\n",
-                                       filterstr->bv_val, mfilter.bv_val ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] searchFilter: \"%s\" -> \"%s\"\n",
+                               filterstr->bv_val, mfilter.bv_val, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                "rw> searchFilter: \"%s\" -> \"%s\"\n%s",
@@ -464,10 +464,9 @@ meta_back_search(
                                                LDAP_OPT_MATCHED_DN, &match );
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                                               "meta_back_search [%d]"
-                                               " match=\"%s\" err=\"%s\"\n",
-                                               i, match, err ));
+                               LDAP_LOG( BACK_META, ERR,
+                                       "meta_back_search [%d] match=\"%s\" err=\"%s\"\n",
+                                       i, match, err );
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ANY,
        "=>meta_back_search [%d] match=\"%s\" err=\"%s\"\n",
@@ -521,9 +520,8 @@ meta_back_search(
                                mmatch = ( char * )match;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] matchedDn: \"%s\" -> \"%s\"\n",
-                                       match, mmatch ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] matchedDn: \"%s\" -> \"%s\"\n", match, mmatch, 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
                                       " \"%s\" -> \"%s\"\n%s",
@@ -602,10 +600,9 @@ meta_send_entry(
 
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                       "[rw] searchResult[%d]:"
-                                       " \"%s\" -> \"%s\"\n",
-                                       target, bdn.bv_val, ent.e_name.bv_val ));
+                       LDAP_LOG( BACK_META, DETAIL1,
+                               "[rw] searchResult[%d]: \"%s\" -> \"%s\"\n",
+                               target, bdn.bv_val, ent.e_name.bv_val );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> searchResult[%d]: \"%s\""
                                        " -> \"%s\"\n", target, bdn.bv_val, ent.e_name.bv_val );
@@ -653,9 +650,8 @@ meta_send_entry(
                        if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text ) 
                                        != LDAP_SUCCESS) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                               "slap_bv2undef_ad(%s): "
-                                               "%s\n", mapped.bv_val, text ));
+                               LDAP_LOG( BACK_META, DETAIL1,
+                                       "slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 );
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ANY,
                                                "slap_bv2undef_ad(%s): "
@@ -723,13 +719,10 @@ meta_send_entry(
                                                break;
                                        }
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "backend",
-                                                       LDAP_LEVEL_DETAIL1,
-                                                       "[rw] searchResult on"
-                                                       " attr=%s:"
-                                                       " \"%s\" -> \"%s\"\n",
-                                       attr->a_desc->ad_type->sat_cname.bv_val,
-                                                       bv->bv_val, newval ));
+                                       LDAP_LOG( BACK_META, DETAIL1,
+                                               "[rw] searchResult on attr=%s: \"%s\" -> \"%s\"\n",
+                                               attr->a_desc->ad_type->sat_cname.bv_val,
+                                               bv->bv_val, newval );
 #else /* !NEW_LOGGING */
                                        Debug( LDAP_DEBUG_ARGS,
                                                "rw> searchResult on attr=%s:"
index 7460a020f018c982f04612c4c80cad1041ad9636..84b36adb21fa555aa7c3fdc47ecbb1231c5c8890 100644 (file)
@@ -85,9 +85,8 @@ meta_back_conn_destroy(
        struct metaconn *lc, lc_curr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                       "meta_back_conn_destroy: fetching conn %ld\n",
-                       conn->c_connid ));
+       LDAP_LOG( BACK_META, ENTRY,
+               "meta_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_TRACE,
                "=>meta_back_conn_destroy: fetching conn %ld\n%s%s",
@@ -105,9 +104,9 @@ meta_back_conn_destroy(
                int i;
                
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                               "meta_back_conn_destroy: destroying conn %ld\n",
-                               lc->conn->c_connid ));
+               LDAP_LOG( BACK_META, INFO,
+                       "meta_back_conn_destroy: destroying conn %ld\n",
+                       lc->conn->c_connid, 0, 0 );
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_conn_destroy: destroying conn %ld\n%s%s",
index bd65f90639b2b2df3f995200e1137b6583fe763c..d147929abe6027f6682651a4d5ecf0da48f743a0 100644 (file)
@@ -58,10 +58,10 @@ monitor_subsys_backend_init(
                                &monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn, 
                                &e_backend ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_backend_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_backend_init: "
@@ -91,11 +91,10 @@ monitor_subsys_backend_init(
                e = str2entry( buf );
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_backend_init: "
                                "unable to create entry 'cn=Backend %d,%s'\n",
-                               i, 
-                               monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_backend_init: "
@@ -124,11 +123,10 @@ monitor_subsys_backend_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_backend_init: "
                                "unable to add entry 'cn=Backend %d,%s'\n",
-                               i,
-                               monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_backend_init: "
index ab2576a41733e733dd940da9e6f1004c33b3972a..9c0cd468ba325ac4fbceb37c2838923a6991c834 100644 (file)
@@ -60,8 +60,8 @@ monitor_back_bind(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "monitor_back_bind: dn: %s.\n", dn->bv_val ));
+       LDAP_LOG( BACK_MON, ENTRY,
+               "monitor_back_bind: dn: %s.\n", dn->bv_val, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n%s%s", 
                        dn->bv_val, "", "");
index 43ba3dc4e4fe951f19601e3bac973da08adc280a..685df216d4d5c2a6253754665af0ca919aa9e481 100644 (file)
@@ -59,10 +59,10 @@ monitor_subsys_conn_init(
        if ( monitor_cache_get( mi,
                        &monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn, &e_conn ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_init: "
@@ -87,10 +87,10 @@ monitor_subsys_conn_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_init: "
                        "unable to create entry 'cn=Total,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_init: "
@@ -117,10 +117,10 @@ monitor_subsys_conn_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_init: "
                        "unable to add entry 'cn=Total,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_init: "
@@ -145,10 +145,10 @@ monitor_subsys_conn_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_init: "
                        "unable to create entry 'cn=Current,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_init: "
@@ -175,10 +175,10 @@ monitor_subsys_conn_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_init: "
                        "unable to add entry 'cn=Current,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_init: "
@@ -273,12 +273,11 @@ conn_create(
 
        if ( e == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_conn_create: "
                        "unable to create entry "
                        "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n",
-                       c->c_connid, 
-                       monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val ));
+                       c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_conn_create: "
index 66b0b0bce4520035df9c579c5888c08ca19aa27e..2ed5225faaee3241d69aa143d380b7c9c5b03b56 100644 (file)
@@ -61,10 +61,10 @@ monitor_subsys_database_init(
                                &monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn, 
                                &e_database ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_database_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_database_init: "
@@ -99,11 +99,10 @@ monitor_subsys_database_init(
                e = str2entry( buf );
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_database_init: "
                                "unable to create entry 'cn=Database %d,%s'\n",
-                               i, 
-                               monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_database_init: "
@@ -155,11 +154,10 @@ monitor_subsys_database_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_database_init: "
                                "unable to add entry 'cn=Database %d,%s'\n",
-                               i, 
-                               monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_database_init: "
index b8637dd0d800d6c88ad4c30f6bd7cad7b5b23a26..240f64e1119801307a6734fcd20d571e14c6f990 100644 (file)
@@ -236,8 +236,8 @@ monitor_back_db_init(
         */
        if ( be_monitor ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                       "only one monitor backend is allowed\n" ));
+               LDAP_LOG( OPERATION, CRIT,
+                       "only one monitor backend is allowed\n" , 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "only one monitor backend is allowed\n%s%s%s",
@@ -256,8 +256,8 @@ monitor_back_db_init(
        rc = dnNormalize2( NULL, &dn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                       "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" ));
+               LDAP_LOG( OPERATION, CRIT,
+                       "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" , 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n",
@@ -275,8 +275,8 @@ monitor_back_db_init(
 
        if ( slap_str2ad( "description", &monitor_ad_desc, &text ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                       "monitor_back_db_init: %s\n", text ));
+               LDAP_LOG( OPERATION, CRIT,
+                       "monitor_back_db_init: %s\n", text, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_backend_init: %s\n%s%s", 
@@ -302,9 +302,9 @@ monitor_back_db_init(
                free( dn.bv_val );
                if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor RDN \"%s\" is invalid\n", 
-                               dn.bv_val ));
+                               dn.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor RDN \"%s\" is invalid\n", 
@@ -322,9 +322,9 @@ monitor_back_db_init(
                free( dn.bv_val );
                if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor DN \"%s\" is invalid\n", 
-                               dn.bv_val ));
+                               dn.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor DN \"%s\" is invalid\n", 
@@ -344,9 +344,9 @@ monitor_back_db_init(
                
                if ( e == NULL) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "unable to create '%s' entry\n", 
-                               monitor_subsys[ i ].mss_dn.bv_val ));
+                               monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "unable to create '%s' entry\n", 
@@ -364,9 +364,9 @@ monitor_back_db_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "unable to add entry '%s' to cache\n",
-                               monitor_subsys[ i ].mss_dn.bv_val ));
+                               monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "unable to add entry '%s' to cache\n",
@@ -392,9 +392,9 @@ monitor_back_db_init(
        e = str2entry( buf );
        if ( e == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "unable to create '%s' entry\n",
-                       SLAPD_MONITOR_DN ));
+                       SLAPD_MONITOR_DN, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "unable to create '%s' entry\n%s%s",
@@ -412,9 +412,9 @@ monitor_back_db_init(
        }
        if ( attr_merge( e, monitor_ad_desc, bv ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "unable to add description to '%s' entry\n",
-                       SLAPD_MONITOR_DN ));
+                       SLAPD_MONITOR_DN, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "unable to add description to '%s' entry\n%s%s",
@@ -432,9 +432,9 @@ monitor_back_db_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "unable to add entry '%s' to cache\n",
-                       SLAPD_MONITOR_DN ));
+                       SLAPD_MONITOR_DN, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "unable to add entry '%s' to cache\n%s%s",
@@ -465,8 +465,8 @@ monitor_back_open(
        rc = dnNormalize2( NULL, &dn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                       "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n" ));
+               LDAP_LOG( OPERATION, CRIT,
+                       "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n" , 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n",
@@ -480,8 +480,8 @@ monitor_back_open(
 
        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                       "unable to get monitor backend\n" ));
+               LDAP_LOG( OPERATION, CRIT,
+                       "unable to get monitor backend\n" , 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "unable to get monitor backend\n", 0, 0, 0 );
@@ -523,8 +523,8 @@ monitor_back_db_config(
 )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-               "line %d of file '%s' will be ignored\n", lineno, fname ));
+       LDAP_LOG( CONFIG, INFO,
+               "line %d of file '%s' will be ignored\n", lineno, fname, 0 );
 #else
        Debug( LDAP_DEBUG_CONFIG, 
                "line %d of file '%s' will be ignored\n%s", lineno, fname, "" );
index 7dc98bed559ee3533e4e648968b320f8b6e7b354..2f8b3b8037b204461434778aeb008d0286ebcbe4 100644 (file)
@@ -58,10 +58,10 @@ monitor_subsys_listener_init(
                                &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn, 
                                &e_listener ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_listener_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_listener_init: "
@@ -74,9 +74,9 @@ monitor_subsys_listener_init(
 
        if ( ( l = slapd_get_listeners() ) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_listener_init: "
-                       "unable to get listeners\n" ));
+                       "unable to get listeners\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_listener_init: "
@@ -106,11 +106,10 @@ monitor_subsys_listener_init(
                e = str2entry( buf );
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_listener_init: "
                                "unable to create entry 'cn=Listener, %d,%s'\n",
-                               i,
-                               monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_listener_init: "
@@ -151,11 +150,10 @@ monitor_subsys_listener_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_listener_init: "
                                "unable to add entry 'cn=Listener %d,%s'\n",
-                               i,
-                               monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val ));
+                               i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_listener_init: "
index aef5d34caaefb8190be07aeedd64e6bfac728acc..1c12104b2f80c0dcffafbbe61af6f0543128f46c 100644 (file)
@@ -95,10 +95,10 @@ monitor_subsys_log_init(
        if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn, 
                                &e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_log_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_log_init: "
index de6485d2d2b7cacf86d0a0f1c600a6763c78d5d8..5cf4e29c8ff4faaa9d46da8e4cc22c36e3760e02 100644 (file)
@@ -58,8 +58,8 @@ monitor_back_modify(
        Entry           *e;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-               "monitor_back_modify: enter\n" ));
+       LDAP_LOG( BACK_MON, ENTRY,
+               "monitor_back_modify: enter\n", 0, 0, 0 );
 #else
        Debug(LDAP_DEBUG_ARGS, "monitor_back_modify:\n", 0, 0, 0);
 #endif
index b8a0ff4fb417004912dc69c27d1a94120de3c38f..7686bde2bbfa31162b688022e4307f6e9185930f 100644 (file)
@@ -75,10 +75,10 @@ monitor_subsys_ops_init(
        if ( monitor_cache_get( mi,
                        &monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn, &e_op ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_ops_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_ops_init: "
@@ -105,11 +105,11 @@ monitor_subsys_ops_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_ops_init: "
                        "unable to create entry 'cn=%s,%s'\n",
                        bv_initiated.bv_val,
-                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_ops_init: "
@@ -136,11 +136,11 @@ monitor_subsys_ops_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_ops_init: "
                        "unable to add entry 'cn=%s,%s'\n",
                        bv_initiated.bv_val,
-                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_ops_init: "
@@ -172,12 +172,12 @@ monitor_subsys_ops_init(
                e = str2entry( buf );
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_ops_init: "
                                "unable to create entry 'cn=%s,cn=%s,%s'\n",
                                bv_op[ i ].bv_val,
                                bv_initiated.bv_val,
-                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_ops_init: "
@@ -204,12 +204,12 @@ monitor_subsys_ops_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_ops_init: "
                                "unable to add entry 'cn=%s,cn=%s,%s'\n",
                                bv_op[ i ].bv_val,
                                bv_initiated.bv_val,
-                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_ops_init: "
@@ -241,11 +241,11 @@ monitor_subsys_ops_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_ops_init: "
                        "unable to create entry 'cn=%s,%s'\n",
                        bv_completed.bv_val,
-                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_ops_init: "
@@ -271,11 +271,11 @@ monitor_subsys_ops_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_ops_init: "
                        "unable to add entry 'cn=%s,%s'\n",
                        bv_completed.bv_val,
-                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_ops_init: "
@@ -307,12 +307,12 @@ monitor_subsys_ops_init(
                e = str2entry( buf );
                if ( e == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_ops_init: "
                                "unable to create entry 'cn=%s,cn=%s,%s'\n",
                                bv_op[ i ].bv_val,
                                bv_completed.bv_val,
-                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_ops_init: "
@@ -338,12 +338,12 @@ monitor_subsys_ops_init(
 
                if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( OPERATION, CRIT,
                                "monitor_subsys_ops_init: "
                                "unable to add entry 'cn=%s,cn=%s,%s'\n",
                                bv_op[ i ].bv_val,
                                bv_completed.bv_val,
-                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ));
+                               monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_subsys_ops_init: "
index cfc199e4fdd96e52cd430a13c2bd23291b06b345..16d49e849531cba546a19240906956d1a78b8222 100644 (file)
@@ -157,8 +157,8 @@ monitor_back_search(
        int             nentries = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "monitor_back_search: enter\n" ));
+       LDAP_LOG( BACK_MON, ENTRY,
+                  "monitor_back_search: enter\n", 0, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "=> monitor_back_search\n%s%s%s", "", "", "");
 #endif
index 39926e338d25a2f03b2625681e4e4292f6d245b0..673fd63a126600fd2bc93352c4e4336a8d6b0c1e 100644 (file)
@@ -57,10 +57,10 @@ monitor_subsys_sent_init(
        if ( monitor_cache_get( mi,
                        &monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn, &e_sent ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -85,10 +85,10 @@ monitor_subsys_sent_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to create entry 'cn=Entries,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -114,10 +114,10 @@ monitor_subsys_sent_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to add entry 'cn=Entries,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -142,10 +142,10 @@ monitor_subsys_sent_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to create entry 'cn=Referrals,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -170,10 +170,10 @@ monitor_subsys_sent_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to add entry 'cn=Referrals,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -198,10 +198,10 @@ monitor_subsys_sent_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to create entry 'cn=PDU,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -226,10 +226,10 @@ monitor_subsys_sent_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to add entry 'cn=PDU,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -254,10 +254,10 @@ monitor_subsys_sent_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to create entry 'cn=Bytes,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
@@ -282,10 +282,10 @@ monitor_subsys_sent_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_sent_init: "
                        "unable to add entry 'cn=Bytes,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_sent_init: "
index 63b747627093b781f555232b4f3a126b45ca04b3..112ada7efc844f80229df0d06882ea493c44b70e 100644 (file)
@@ -57,9 +57,9 @@ monitor_subsys_thread_init(
                &monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, &e ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_thread_init: unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_thread_init: unable to get entry '%s'\n",
index 8bd0b8045d4401dbfdc1eb768fd0279b75c19a0c..ea76d6ee8d006150745d5cfa666ac519f9284c57 100644 (file)
@@ -73,10 +73,10 @@ monitor_subsys_time_init(
        if ( monitor_cache_get( mi,
                        &monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn, &e_time ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_time_init: "
                        "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_time_init: "
@@ -118,10 +118,10 @@ monitor_subsys_time_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_time_init: "
                        "unable to create entry 'cn=Start,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_time_init: "
@@ -142,10 +142,10 @@ monitor_subsys_time_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_time_init: "
                        "unable to add entry 'cn=Start,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_time_init: "
@@ -179,10 +179,10 @@ monitor_subsys_time_init(
        e = str2entry( buf );
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_time_init: "
                        "unable to create entry 'cn=Current,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_time_init: "
@@ -203,10 +203,10 @@ monitor_subsys_time_init(
 
        if ( monitor_cache_add( mi, e ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+               LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_time_init: "
                        "unable to add entry 'cn=Current,%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val ));
+                       monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_time_init: "
index a962aabd063fc36a540a56ec07f20cda21495b4c..a9d5253785d82ff7fa097fc12912c75f1d59eaf1 100644 (file)
@@ -124,8 +124,8 @@ int backend_init(void)
        if((nBackendInfo != 0) || (backendInfo != NULL)) {
                /* already initialized */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "backend_init:  backend already initialized\n" ));
+               LDAP_LOG( BACKEND, ERR, 
+                       "backend_init:  backend already initialized\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "backend_init: already initialized.\n", 0, 0, 0 );
@@ -141,9 +141,9 @@ int backend_init(void)
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                       LDAP_LOG( BACKEND, INFO, 
                                "backend_init:  initialized for type \"%s\"\n",
-                               binfo[nBackendInfo].bi_type ));
+                               binfo[nBackendInfo].bi_type, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_init: initialized for type \"%s\"\n",
@@ -173,8 +173,7 @@ int backend_init(void)
 #else
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-               "backend_init: failed\n" ));
+       LDAP_LOG( BACKEND, ERR, "backend_init: failed\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "backend_init: failed\n",
@@ -191,9 +190,9 @@ int backend_add(BackendInfo *aBackendInfo)
 
    if ((rc = aBackendInfo->bi_init(aBackendInfo)) != 0) {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+               LDAP_LOG( BACKEND, ERR, 
                   "backend_add:  initialization for type \"%s\" failed\n",
-                  aBackendInfo->bi_type ));
+                  aBackendInfo->bi_type, 0, 0 );
 #else
       Debug( LDAP_DEBUG_ANY,
             "backend_add: initialization for type \"%s\" failed\n",
@@ -232,9 +231,8 @@ int backend_startup(Backend *be)
        if( ! ( nBackendDB > 0 ) ) {
                /* no databases */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "backend_startup: %d databases to startup. \n",
-                          nBackendDB ));
+               LDAP_LOG( BACKEND, INFO, 
+                       "backend_startup: %d databases to startup. \n", nBackendDB, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "backend_startup: %d databases to startup.\n",
@@ -246,9 +244,8 @@ int backend_startup(Backend *be)
        if(be != NULL) {
                /* startup a specific backend database */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "backend_startup:  starting \"%s\"\n",
-                          be->be_suffix[0].bv_val ));
+               LDAP_LOG( BACKEND, DETAIL1, "backend_startup:  starting \"%s\"\n",
+                          be->be_suffix[0].bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "backend_startup: starting \"%s\"\n",
@@ -261,8 +258,7 @@ int backend_startup(Backend *be)
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                                  "backend_startup: bi_open failed!\n" ));
+                       LDAP_LOG( BACKEND, CRIT, "backend_startup: bi_open failed!\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_startup: bi_open failed!\n",
@@ -278,8 +274,8 @@ int backend_startup(Backend *be)
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                               "backend_startup: bi_db_open failed! (%d)\n", rc ));
+                       LDAP_LOG( BACKEND, CRIT, 
+                               "backend_startup: bi_db_open failed! (%d)\n", rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_startup: bi_db_open failed! (%d)\n",
@@ -305,8 +301,8 @@ int backend_startup(Backend *be)
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                                  "backend_startup: bi_open %d failed!\n", i ));
+                       LDAP_LOG( BACKEND, CRIT, 
+                               "backend_startup: bi_open %d failed!\n", i, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_startup: bi_open %d failed!\n",
@@ -328,9 +324,8 @@ int backend_startup(Backend *be)
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                               "backend_startup: bi_db_open(%d) failed! (%d)\n",
-                               i, rc ));
+                       LDAP_LOG( BACKEND, CRIT, 
+                               "backend_startup: bi_db_open(%d) failed! (%d)\n", i, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_startup: bi_db_open(%d) failed! (%d)\n",
@@ -388,9 +383,9 @@ int backend_shutdown( Backend *be )
 
                if(rc != 0) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_NOTICE,
-                                  "backend_shutdown: bi_close %s failed!\n",
-                                  backendDB[i].be_type ));
+                       LDAP_LOG( BACKEND, NOTICE, 
+                               "backend_shutdown: bi_close %s failed!\n",
+                               backendDB[i].be_type, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "backend_close: bi_close %s failed!\n",
index 15055120b4e5ca95d24336b916bfb50a5e83a81b..45c2fab3fbe77f6a3ddf6fb0caf914acca2e1a2b 100644 (file)
@@ -48,8 +48,7 @@ do_bind(
        Backend *be;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_bind: conn %d\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 );
 #endif
@@ -97,8 +96,8 @@ do_bind(
 
        if ( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_bind: conn %d  ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_bind: conn %d  ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -144,8 +143,8 @@ do_bind(
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "do_bind: conn %d  get_ctrls failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "do_bind: conn %d  get_ctrls failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -155,9 +154,9 @@ do_bind(
        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "do_bind: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, dn.bv_val ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "do_bind: conn %d  invalid dn (%s)\n", 
+                       conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n",
                        dn.bv_val, 0, 0 );
@@ -169,9 +168,9 @@ do_bind(
 
        if( method == LDAP_AUTH_SASL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation",  LDAP_LEVEL_DETAIL1,
-                       "do_sasl_bind: conn %d  dn (%s) mech %s\n", conn->c_connid,
-                       pdn.bv_val, mech.bv_val ));
+               LDAP_LOG( OPERATION,     DETAIL1, 
+                       "do_sasl_bind: conn %d  dn (%s) mech %s\n", 
+                       conn->c_connid, pdn.bv_val, mech.bv_val );
 #else
                Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n",
                        pdn.bv_val, mech.bv_val, NULL );
@@ -179,10 +178,9 @@ do_bind(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                       "do_bind: conn %d  version=%ld dn=\"%s\" method=%ld\n",
-                       conn->c_connid, (unsigned long) version,
-                       pdn.bv_val, (unsigned long)method ));
+               LDAP_LOG( OPERATION, DETAIL1, 
+                       "do_bind: version=%ld dn=\"%s\" method=%ld\n",
+                       (unsigned long) version, pdn.bv_val, (unsigned long)method );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "do_bind: version=%ld dn=\"%s\" method=%ld\n",
@@ -196,9 +194,9 @@ do_bind(
 
        if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_bind: conn %d  unknown version = %ld\n",
-                       conn->c_connid, (unsigned long)version ));
+                       conn->c_connid, (unsigned long)version, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n",
                        (unsigned long) version, 0, 0 );
@@ -236,9 +234,9 @@ do_bind(
 
                if ( version < LDAP_VERSION3 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                       LDAP_LOG( OPERATION, INFO, 
                                "do_bind: conn %d  sasl with LDAPv%ld\n",
-                               conn->c_connid, (unsigned long)version ));
+                               conn->c_connid, (unsigned long)version , 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n",
                                (unsigned long) version, 0, 0 );
@@ -251,9 +249,9 @@ do_bind(
 
                if( mech.bv_len == 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                       LDAP_LOG( OPERATION, INFO, 
                                   "do_bind: conn %d  no SASL mechanism provided\n",
-                                  conn->c_connid ));
+                                  conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "do_bind: no sasl mechanism provided\n",
@@ -378,9 +376,9 @@ do_bind(
                        send_ldap_result( conn, op, rc,
                                NULL, text, NULL, NULL );
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( OPERATION, DETAIL1, 
                                   "do_bind: conn %d  v%d anonymous bind\n",
-                                  conn->c_connid, version ));
+                                  conn->c_connid, version , 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n",
                                version, 0, 0 );
@@ -395,9 +393,9 @@ do_bind(
                        send_ldap_result( conn, op, rc,
                                NULL, text, NULL, NULL );
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                       LDAP_LOG( OPERATION, INFO, 
                                   "do_bind: conn %d  v%d simple bind(%s) disallowed\n",
-                                  conn->c_connid, version, ndn.bv_val ));
+                                  conn->c_connid, version, ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "do_bind: v%d simple bind(%s) disallowed\n",
@@ -416,9 +414,9 @@ do_bind(
                                NULL, text, NULL, NULL );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_bind: conn %d  "
+                       LDAP_LOG( OPERATION, INFO, "do_bind: conn %d  "
                                "v%d unprotected simple bind(%s) disallowed\n",
-                               conn->c_connid, version, ndn.bv_val ));
+                               conn->c_connid, version, ndn.bv_val );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "do_bind: v%d unprotected simple bind(%s) disallowed\n",
@@ -437,9 +435,9 @@ do_bind(
                        send_ldap_result( conn, op, rc,
                                NULL, text, NULL, NULL );
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( OPERATION, DETAIL1, 
                                   "do_bind: conn %d  v%d Kerberos V4 bind\n",
-                                  conn->c_connid, version ));
+                                  conn->c_connid, version , 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 bind\n",
                                version, 0, 0 );
@@ -455,9 +453,9 @@ do_bind(
                send_ldap_result( conn, op, rc,
                        NULL, text, NULL, NULL );
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                           "do_bind: conn %ld  v%d unknown authentication method (%ld)\n",
-                          conn->c_connid, version, method ));
+                          conn->c_connid, version, method );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "do_bind: v%d unknown authentication method (%ld)\n",
@@ -534,9 +532,9 @@ do_bind(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                               "do_bind: conn %d  v%d bind: \"%s\" to \"%s\" \n",
-                               conn->c_connid, version, dn.bv_val, conn->c_dn.bv_val ));
+                       LDAP_LOG( OPERATION, DETAIL1, 
+                               "do_bind: v%d bind: \"%s\" to \"%s\" \n",
+                               version, conn->c_dn.bv_val, conn->c_dn.bv_val );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "do_bind: v%d bind: \"%s\" to \"%s\"\n",
index a1ea2d31ce4858134acf70449247f08e7e168122..c9af173946e0f06c03a56f9692ba91f180de5678 100644 (file)
@@ -29,9 +29,8 @@ ch_malloc(
 
        if ( (new = (void *) ber_memalloc( size )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "ch_malloc: allocation of %lu bytes failed\n",
-                          (long)size ));
+               LDAP_LOG( OPERATION, ERR, 
+                          "ch_malloc: allocation of %lu bytes failed\n", (long)size, 0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ch_malloc of %lu bytes failed\n",
                        (long) size, 0, 0 );
@@ -61,8 +60,8 @@ ch_realloc(
 
        if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "ch_realloc: reallocation of %lu bytes failed\n", (long)size ));
+               LDAP_LOG( OPERATION, ERR, 
+                          "ch_realloc: reallocation of %lu bytes failed\n", (long)size, 0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n",
                        (long) size, 0, 0 );
@@ -84,9 +83,9 @@ ch_calloc(
 
        if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+               LDAP_LOG( OPERATION, ERR, 
                           "ch_calloc: allocation of %lu elements of %lu bytes faild\n",
-                          (long)nelem, (long)size ));
+                          (long)nelem, (long)size, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ch_calloc of %lu elems of %lu bytes failed\n",
                  (long) nelem, (long) size, 0 );
@@ -107,8 +106,8 @@ ch_strdup(
 
        if ( (new = ber_strdup( string )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "chr_strdup: duplication of \"%s\" failed\n", string ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "chr_strdup: duplication of \"%s\" failed\n", string, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ch_strdup(%s) failed\n", string, 0, 0 );
 #endif
index ead4af626e45d00cbc9611d403c19202e12178ff..b62d69dc4ad9410bfcb9271f1a460d1f65017576 100644 (file)
@@ -50,8 +50,7 @@ do_compare(
        ava.aa_desc = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_compare: conn %d\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "do_compare: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 );
 #endif
@@ -69,8 +68,8 @@ do_compare(
 
        if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_compare: conn %d  ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_compare: conn %d  ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -81,8 +80,8 @@ do_compare(
 
        if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_compare: conn %d  get ava failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_compare: conn %d  get ava failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_compare: get ava failed\n", 0, 0, 0 );
 #endif
@@ -94,8 +93,8 @@ do_compare(
 
        if ( ber_scanf( op->o_ber, /*{*/ "}" ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_compare: conn %d  ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_compare: conn %d  ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -107,8 +106,8 @@ do_compare(
 
        if( ( rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "do_compare: conn %d  get_ctrls failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "do_compare: conn %d  get_ctrls failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -118,9 +117,9 @@ do_compare(
        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_compare: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, dn.bv_val ));
+                       conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_compare: invalid dn (%s)\n", dn.bv_val, 0, 0 );
@@ -145,10 +144,9 @@ do_compare(
 
        if( strcasecmp( ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                       "do_compare: conn %d  dn (%s) attr(%s) value (%s)\n",
-                       conn->c_connid, pdn.bv_val,
-                       ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ));
+               LDAP_LOG( OPERATION, ARGS, 
+                       "do_compare: dn (%s) attr(%s) value (%s)\n",
+                       pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
 #else
                Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
                        pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
@@ -173,10 +171,10 @@ do_compare(
 
        } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                       "do_compare: conn %d  dn (%s) attr(%s) value (%s)\n",
-                       conn->c_connid, pdn.bv_val, ava.aa_desc->ad_cname.bv_val,
-                       ava.aa_value.bv_val ));
+               LDAP_LOG( OPERATION, ARGS, 
+                       "do_compare: dn (%s) attr(%s) value (%s)\n",
+                       pdn.bv_val, ava.aa_desc->ad_cname.bv_val,
+                       ava.aa_value.bv_val );
 #else
                Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
                        pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
@@ -249,10 +247,9 @@ do_compare(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_compare: conn %d     dn (%s) attr(%s) value (%s)\n",
-               conn->c_connid, pdn.bv_val, ava.aa_desc->ad_cname.bv_val,
-               ava.aa_value.bv_val ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "do_compare: dn (%s) attr(%s) value (%s)\n",
+               pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
 #else
        Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
            pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
index d3619af88924439ffdd6bbd6374e08adb490b455..656fb12d712e99cdcdc3f7fde7e8f4fd4c5b1284 100644 (file)
@@ -96,9 +96,9 @@ read_config( const char *fname )
        if ( (fp = fopen( fname, "r" )) == NULL ) {
                ldap_syslog = 1;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_ENTRY, "read_config: "
-                       "could not open config file \"%s\": %s (%d)\n",
-                   fname, strerror(errno), errno ));
+               LDAP_LOG( CONFIG, ENTRY, 
+                       "read_config: " "could not open config file \"%s\": %s (%d)\n",
+                   fname, strerror(errno), errno );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "could not open config file \"%s\": %s (%d)\n",
@@ -108,8 +108,8 @@ read_config( const char *fname )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "config", LDAP_LEVEL_ENTRY,
-               "read_config: reading config file %s\n", fname ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "read_config: reading config file %s\n", fname, 0, 0 );
 #else
        Debug( LDAP_DEBUG_CONFIG, "reading config file %s\n", fname, 0, 0 );
 #endif
@@ -132,9 +132,8 @@ read_config( const char *fname )
 
                if ( cargc < 1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                  "%s: line %d: bad config line (ignored)\n",
-                                  fname, lineno ));
+                       LDAP_LOG( CONFIG, INFO, 
+                               "%s: line %d: bad config line (ignored)\n", fname, lineno, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "%s: line %d: bad config line (ignored)\n",
@@ -147,9 +146,9 @@ read_config( const char *fname )
                if ( strcasecmp( cargv[0], "backend" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s : line %d: missing type in \"backend\" line.\n",
-                                          fname, lineno ));
+                                          fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                "%s: line %d: missing type in \"backend <type>\" line\n",
@@ -161,9 +160,9 @@ read_config( const char *fname )
 
                        if( be != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: backend line must appear before any "
-                                          "database definition.\n", fname, lineno ));
+                                          "database definition.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: backend line must appear before any database definition\n",
@@ -177,9 +176,9 @@ read_config( const char *fname )
 
                        if( bi == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "read_config: backend %s initialization failed.\n",
-                                          cargv[1] ));
+                                          cargv[1], 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "backend %s initialization failed.\n",
@@ -191,9 +190,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "database" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing type in \"database <type>\" line\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing type in \"database <type>\" line\n",
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                "%s: line %d: missing type in \"database <type>\" line\n",
@@ -208,9 +207,8 @@ read_config( const char *fname )
 
                        if( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "database %s initialization failed.\n",
-                                          cargv[1] ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "database %s initialization failed.\n", cargv[1], 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "database %s initialization failed.\n",
@@ -225,9 +223,9 @@ read_config( const char *fname )
                        int c;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing level in \"concurrency <level\" line\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing level in \"concurrency <level\" "
+                                       " line\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing level in \"concurrency <level>\" line\n",
@@ -241,10 +239,9 @@ read_config( const char *fname )
 
                        if( c < 1 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: invalid level (%d) in "
-                                          "\"concurrency <level>\" line.\n",
-                                          fname, lineno, c ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: invalid level (%d) in "
+                                       "\"concurrency <level>\" line.\n", fname, lineno, c );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: invalid level (%d) in \"concurrency <level>\" line\n",
@@ -261,9 +258,9 @@ read_config( const char *fname )
                        long max;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                  "%s: line %d: missing max in \"sockbuf_max_incoming "
+                                  "<bytes>\" line\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                           "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
@@ -277,10 +274,10 @@ read_config( const char *fname )
 
                        if( max < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: invalid max value (%ld) in "
                                           "\"sockbuf_max_incoming <bytes>\" line.\n",
-                                          fname, lineno, max ));
+                                          fname, lineno, max );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: invalid max value (%ld) in "
@@ -298,9 +295,9 @@ read_config( const char *fname )
                        long max;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing max in \"sockbuf_max_incoming_auth <bytes>\" line\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                  "%s: line %d: missing max in \"sockbuf_max_incoming_auth "
+                                  "<bytes>\" line\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                           "%s: line %d: missing max in \"sockbuf_max_incoming_auth <bytes>\" line\n",
@@ -314,10 +311,10 @@ read_config( const char *fname )
 
                        if( max < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: invalid max value (%ld) in "
                                           "\"sockbuf_max_incoming_auth <bytes>\" line.\n",
-                                          fname, lineno, max ));
+                                          fname, lineno, max );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: invalid max value (%ld) in "
@@ -334,9 +331,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "defaultSearchBase" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing dn in \"defaultSearchBase <dn\" "
-                                       "line\n", fname, lineno ));
+                                       "line\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "missing dn in \"defaultSearchBase <dn>\" line\n",
@@ -347,10 +344,10 @@ read_config( const char *fname )
 
                        } else if ( cargc > 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: extra cruft after <dn> in "
                                        "\"defaultSearchBase %s\" line (ignored)\n",
-                                       fname, lineno, cargv[1] ));
+                                       fname, lineno, cargv[1] );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "extra cruft after <dn> in \"defaultSearchBase %s\", "
@@ -361,10 +358,10 @@ read_config( const char *fname )
 
                        if ( bi != NULL || be != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: defaultSearchBase line must appear "
                                        "prior to any backend or database definitions\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "defaultSearchBaase line must appear prior to "
@@ -377,10 +374,10 @@ read_config( const char *fname )
 
                        if ( default_search_nbase.bv_len ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: "
+                               LDAP_LOG( CONFIG, INFO, "%s: line %d: "
                                        "default search base \"%s\" already defined "
                                        "(discarding old)\n", fname, lineno,
-                                       default_search_base.bv_val ));
+                                       default_search_base.bv_val );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "default search base \"%s\" already defined "
@@ -406,9 +403,9 @@ read_config( const char *fname )
 
                                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                "%s: line %d: defaultSearchBase DN is invalid.\n",
-                                               fname, lineno ));
+                                               fname, lineno, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "%s: line %d: defaultSearchBase DN is invalid\n",
@@ -423,9 +420,9 @@ read_config( const char *fname )
                        int c;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing count in \"threads <count>\" line\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing count in \"threads <count>\" line\n",
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing count in \"threads <count>\" line\n",
@@ -439,9 +436,9 @@ read_config( const char *fname )
 
                        if( c < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: invalid level (%d) in \"threads <count>\""
-                                          "line\n",fname, lineno, c ));
+                                          "line\n", fname, lineno, c );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: invalid level (%d) in \"threads <count>\" line\n",
@@ -460,9 +457,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "pidfile" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d missing file name in \"pidfile <file>\" line.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d missing file name in \"pidfile <file>\" "
+                                       "line.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing file name in \"pidfile <file>\" line\n",
@@ -478,10 +475,10 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "argsfile" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: %d: missing file name in "
                                           "\"argsfile <file>\" line.\n",
-                                          fname, lineno ));
+                                          fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing file name in \"argsfile <file>\" line\n",
@@ -497,10 +494,10 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "password-hash" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: missing hash in "
                                           "\"password-hash <hash>\" line.\n",
-                                          fname, lineno ));
+                                          fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing hash in \"password-hash <hash>\" line\n",
@@ -511,9 +508,9 @@ read_config( const char *fname )
                        }
                        if ( default_passwd_hash != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: already set default password_hash!\n",
-                                          fname, lineno ));
+                                          fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: already set default password_hash!\n",
@@ -526,9 +523,9 @@ read_config( const char *fname )
 
                        if ( lutil_passwd_scheme( cargv[1] ) == 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: password scheme \"%s\" not available\n",
-                                          fname, lineno, cargv[1] ));
+                                          fname, lineno, cargv[1] );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: password scheme \"%s\" not available\n",
@@ -543,10 +540,10 @@ read_config( const char *fname )
                {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing format in "
                                        "\"password-crypt-salt-format <format>\" line\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: missing format in "
                                        "\"password-crypt-salt-format <format>\" line\n",
@@ -570,10 +567,9 @@ read_config( const char *fname )
                        int err;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: missing path in "
-                                          "\"ucdata-path <path>\" line.\n",
-                                          fname, lineno ));
+                                          "\"ucdata-path <path>\" line.\n", fname, lineno, 0  );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing path in \"ucdata-path <path>\" line\n",
@@ -587,11 +583,10 @@ read_config( const char *fname )
                        if ( err <= 0 ) {
                                if ( err == 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                   "%s: line %d: ucdata already loaded, ucdata-path "
                                                   "must be set earlier in the file and/or be "
-                                                  "specified only once!\n",
-                                                  fname, lineno ));
+                                                  "specified only once!\n", fname, lineno, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                               "%s: line %d: ucdata already loaded, ucdata-path must be set earlier in the file and/or be specified only once!\n",
@@ -609,9 +604,9 @@ read_config( const char *fname )
                        
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing limit in \"sizelimit <limit>\" line.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                  "%s: line %d: missing limit in \"sizelimit <limit>\" "
+                                  "line.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing limit in \"sizelimit <limit>\" line\n",
@@ -637,12 +632,10 @@ read_config( const char *fname )
 
                                if ( rc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                                  "%s: line %d: unable "
-                                                  "to parse value \"%s\" "
-                                                  "in \"sizelimit "
-                                                  "<limit>\" line.\n",
-                                                  fname, lineno, cargv[i] ));
+                                       LDAP_LOG( CONFIG, CRIT, 
+                                               "%s: line %d: unable "
+                                                  "to parse value \"%s\" in \"sizelimit "
+                                                  "<limit>\" line.\n", fname, lineno, cargv[i] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "%s: line %d: unable "
@@ -661,9 +654,9 @@ read_config( const char *fname )
                        
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d missing limit in \"timelimit <limit>\" line.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d missing limit in \"timelimit <limit>\" "
+                                       "line.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing limit in \"timelimit <limit>\" line\n",
@@ -689,12 +682,10 @@ read_config( const char *fname )
 
                                if ( rc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                                  "%s: line %d: unable "
-                                                  "to parse value \"%s\" "
-                                                  "in \"timelimit "
-                                                  "<limit>\" line.\n",
-                                                  fname, lineno, cargv[i] ));
+                                       LDAP_LOG( CONFIG, CRIT, 
+                                                   "%s: line %d: unable to parse value \"%s\" "
+                                                  "in \"timelimit <limit>\" line.\n",
+                                                  fname, lineno, cargv[i] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "%s: line %d: unable "
@@ -710,9 +701,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "limits" ) == 0 ) {
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_WARNING,
-                                          "%s: line %d \"limits\" allowed only in database environment.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, WARNING, 
+                                          "%s: line %d \"limits\" allowed only in database "
+                                          "environment.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
        "%s: line %d \"limits\" allowed only in database environment.\n%s",
@@ -729,9 +720,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "subordinate" ) == 0 ) {
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: "
+                               LDAP_LOG( CONFIG, INFO, "%s: line %d: "
                                        "subordinate keyword must appear inside a database "
-                                       "definition.\n", fname, lineno ));
+                                       "definition.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line "
                                        "must appear inside a database definition.\n",
@@ -751,9 +742,9 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing dn in \"suffix <dn>\" line.\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "missing dn in \"suffix <dn>\" line\n",
@@ -764,9 +755,9 @@ read_config( const char *fname )
 
                        } else if ( cargc > 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: extra cruft after <dn> in \"suffix %s\""
-                                       " line (ignored).\n", fname, lineno, cargv[1] ));
+                                       " line (ignored).\n", fname, lineno, cargv[1] );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: extra cruft "
                                        "after <dn> in \"suffix %s\" line (ignored)\n",
@@ -776,9 +767,9 @@ read_config( const char *fname )
 
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: suffix line must appear inside a database "
-                                       "definition.\n", fname, lineno ));
+                                       "definition.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line "
                                        "must appear inside a database definition\n",
@@ -790,9 +781,9 @@ read_config( const char *fname )
                        /* "cn=Monitor" is reserved for monitoring slap */
                        } else if ( strcasecmp( cargv[1], SLAPD_MONITOR_DN ) == 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: \""
+                               LDAP_LOG( CONFIG, CRIT, "%s: line %d: \""
                                        SLAPD_MONITOR_DN "\" is reserved for monitoring slapd\n", 
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: \""
                                        SLAPD_MONITOR_DN "\" is reserved for monitoring slapd\n", 
@@ -810,9 +801,9 @@ read_config( const char *fname )
                        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: suffix DN is invalid.\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: suffix DN is invalid\n",
@@ -824,9 +815,9 @@ read_config( const char *fname )
                        tmp_be = select_backend( &ndn, 0, 0 );
                        if ( tmp_be == be ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: suffix already served by this backend "
-                                       "(ignored)\n", fname, lineno ));
+                                       "(ignored)\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix "
                                        "already served by this backend (ignored)\n",
@@ -837,10 +828,10 @@ read_config( const char *fname )
 
                        } else if ( tmp_be  != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: suffix already served by a preceding "
                                        "backend \"%s\"\n", fname, lineno,
-                                       tmp_be->be_suffix[0].bv_val ));
+                                       tmp_be->be_suffix[0].bv_val );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix "
                                        "already served by a preceeding backend \"%s\"\n",
@@ -852,10 +843,10 @@ read_config( const char *fname )
 
                        } else if( pdn.bv_len == 0 && default_search_nbase.bv_len ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( CONFIG, INFO, 
                                                "%s: line %d: suffix DN empty and default search "
                                                "base provided \"%s\" (assuming okay).\n",
-                                               fname, lineno, default_search_base.bv_val ));
+                                               fname, lineno, default_search_base.bv_val );
 #else
                                        Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                                "suffix DN empty and default "
@@ -875,10 +866,10 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing alias and aliased_dn in "
                                        "\"suffixAlias <alias> <aliased_dn>\" line.\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: missing alias and aliased_dn in "
@@ -889,10 +880,10 @@ read_config( const char *fname )
                                return( 1 );
                        } else if ( cargc < 3 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing aliased_dn in "
                                        "\"suffixAlias <alias> <aliased_dn>\" line\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: missing aliased_dn in "
@@ -903,9 +894,9 @@ read_config( const char *fname )
 
                        } else if ( cargc > 3 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: extra cruft in suffixAlias line (ignored)\n",
-                                       fname, lineno ));
+                                       fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: extra cruft in suffixAlias line (ignored)\n",
@@ -915,9 +906,9 @@ read_config( const char *fname )
 
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                       "%s: line %d: suffixAlias line must appear inside a "
-                                       "database definition.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: suffix line must appear inside a database "
+                                       "definition.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: suffixAlias line"
@@ -935,9 +926,8 @@ read_config( const char *fname )
                        rc = dnPrettyNormal( NULL, &alias, &palias, &nalias );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                       "%s: line %d: alias DN is invalid.\n",
-                                       fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: alias DN is invalid.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: alias DN is invalid\n",
@@ -950,10 +940,10 @@ read_config( const char *fname )
                        free( nalias.bv_val );
                        if ( tmp_be && tmp_be != be ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: suffixAlias served by a preceeding "
-                                       "backend \"%s\"\n",
-                                       fname, lineno, tmp_be->be_suffix[0].bv_val ));
+                                       "backend \"%s\"\n", fname, lineno, 
+                                       tmp_be->be_suffix[0].bv_val );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: suffixAlias served by"
@@ -970,9 +960,8 @@ read_config( const char *fname )
                        rc = dnPrettyNormal( NULL, &aliased, &paliased, &naliased );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                       "%s: line %d: aliased DN is invalid.\n",
-                                       fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: aliased DN is invalid.\n", fname, lineno,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: aliased DN is invalid\n",
@@ -986,10 +975,10 @@ read_config( const char *fname )
                        free( naliased.bv_val );
                        if ( tmp_be && tmp_be != be ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                        "%s: line %d: suffixAlias derefs to a different backend "
                                        "a preceeding backend \"%s\"\n",
-                                       fname, lineno, tmp_be->be_suffix[0].bv_val ));
+                                       fname, lineno, tmp_be->be_suffix[0].bv_val );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: suffixAlias derefs to differnet backend"
@@ -1009,9 +998,9 @@ read_config( const char *fname )
                                        int i;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                              LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                              LDAP_LOG( CONFIG, CRIT, 
                                          "%s: line %d: missing depth in \"maxDerefDepth <depth>\""
-                                         " line\n", fname, lineno ));
+                                         " line\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing depth in \"maxDerefDepth <depth>\" line\n",
@@ -1022,9 +1011,9 @@ read_config( const char *fname )
                        }
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                              LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                              LDAP_LOG( CONFIG, INFO, 
                                          "%s: line %d: depth line must appear inside a database "
-                                         "definition.\n", fname, lineno ));
+                                         "definition.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: depth line must appear inside a database definition.\n",
@@ -1034,9 +1023,9 @@ read_config( const char *fname )
 
                        } else if ((i = atoi(cargv[1])) < 0) {
 #ifdef NEW_LOGGING
-                              LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                              LDAP_LOG( CONFIG, INFO, 
                                          "%s: line %d: depth must be positive.\n",
-                                         fname, lineno ));
+                                         fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: depth must be positive.\n",
@@ -1054,9 +1043,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "rootdn" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                           "%s: line %d: missing dn in \"rootdn <dn>\" line.\n",
-                                          fname, lineno ));
+                                          fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing dn in \"rootdn <dn>\" line\n",
@@ -1068,9 +1057,9 @@ read_config( const char *fname )
 
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                           "%s: line %d: rootdn line must appear inside a database "
-                                          "definition.\n", fname, lineno ));
+                                          "definition.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: rootdn line must appear inside a database definition.\n",
@@ -1092,9 +1081,9 @@ read_config( const char *fname )
 
                                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                               "%s: line %d: rootdn DN is invalid.\n",
-                                               fname, lineno ));
+                                       LDAP_LOG( CONFIG, CRIT, 
+                                               "%s: line %d: rootdn DN is invalid.\n", 
+                                               fname, lineno ,0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "%s: line %d: rootdn DN is invalid\n",
@@ -1108,9 +1097,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "rootpw" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s: line %d: missing passwd in \"rootpw <passwd>\""
-                                       " line\n", fname, lineno ));
+                                       " line\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "missing passwd in \"rootpw <passwd>\" line\n",
@@ -1122,9 +1111,9 @@ read_config( const char *fname )
 
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: "
+                               LDAP_LOG( CONFIG, INFO, "%s: line %d: "
                                        "rootpw line must appear inside a database "
-                                       "definition.\n", fname, lineno ));
+                                       "definition.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "rootpw line must appear inside a database "
@@ -1138,10 +1127,10 @@ read_config( const char *fname )
 
                                if( tmp_be != be ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( CONFIG, INFO,
                                                "%s: line %d: "
-                                               "rootpw can only be set when rootdn is under suffix\n"
-                                               fname, lineno ));
+                                               "rootpw can only be set when rootdn is under suffix\n",
+                                               fname, lineno, "" );
 #else
                                        Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                                "rootpw can only be set when rootdn is under suffix\n",
@@ -1158,9 +1147,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "readonly" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing on|off in \"readonly <on|off>\" line.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing on|off in \"readonly <on|off>\" "
+                                       "line.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing on|off in \"readonly <on|off>\" line\n",
@@ -1192,9 +1181,9 @@ read_config( const char *fname )
 
                        if ( be != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                           "%s: line %d: allow line must appear prior to "
-                                          "database definitions.\n", fname, lineno ));
+                                          "database definitions.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: allow line must appear prior to database definitions\n",
@@ -1205,9 +1194,9 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: missing feature(s) in \"allow <features>\""
-                                          " line\n", fname, lineno ));
+                                          " line\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing feature(s) in \"allow <features>\" line\n",
@@ -1231,10 +1220,10 @@ read_config( const char *fname )
 
                                } else if( strcasecmp( cargv[i], "none" ) != 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                   "%s: line %d: unknown feature %s in "
                                                   "\"allow <features>\" line.\n",
-                                                  fname, lineno, cargv[1] ));
+                                                  fname, lineno, cargv[1] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: unknown feature %s in \"allow <features>\" line\n",
@@ -1255,9 +1244,9 @@ read_config( const char *fname )
 
                        if ( be != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONFIG, INFO, 
                                           "%s: line %d: disallow line must appear prior to "
-                                          "database definitions.\n", fname, lineno ));
+                                          "database definitions.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: disallow line must appear prior to database definitions\n",
@@ -1268,9 +1257,9 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing feature(s) in \"disallow <features>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing feature(s) in \"disallow <features>\""
+                                       " line.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing feature(s) in \"disallow <features>\" line\n",
@@ -1303,10 +1292,10 @@ read_config( const char *fname )
 
                                } else if( strcasecmp( cargv[i], "none" ) != 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                "%s: line %d: unknown feature %s in "
                                                "\"disallow <features>\" line.\n",
-                                               fname, lineno, cargv[i] ));
+                                               fname, lineno, cargv[i] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: unknown feature %s in \"disallow <features>\" line\n",
@@ -1327,9 +1316,9 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: missing feature(s) in "
-                                          "\"require <features>\" line.\n", fname, lineno ));
+                                          "\"require <features>\" line.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing feature(s) in \"require <features>\" line\n",
@@ -1359,10 +1348,10 @@ read_config( const char *fname )
 
                                } else if( strcasecmp( cargv[i], "none" ) != 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                   "%s: line %d: unknown feature %s in "
-                                                  "\"require <features>\" line.\n",
-                                                  fname, lineno ));
+                                                  "\"require <features>\" line.\n", 
+                                                  fname, lineno , cargv[i] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: unknown feature %s in \"require <features>\" line\n",
@@ -1385,9 +1374,9 @@ read_config( const char *fname )
 
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing factor(s) in \"security <factors>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing factor(s) in \"security <factors>\""
+                                       " line.\n", fname, lineno ,0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing factor(s) in \"security <factors>\" line\n",
@@ -1454,10 +1443,10 @@ read_config( const char *fname )
 
                                } else {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                   "%s: line %d: unknown factor %S in "
                                                   "\"security <factors>\" line.\n",
-                                                  fname, lineno, cargv[1] ));
+                                                  fname, lineno, cargv[1] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: unknown factor %s in \"security <factors>\" line\n",
@@ -1471,9 +1460,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "referral" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing URL in \"referral <URL>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing URL in \"referral <URL>\""
+                                       " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing URL in \"referral <URL>\" line\n",
@@ -1485,9 +1474,9 @@ read_config( const char *fname )
 
                        if( validate_global_referral( cargv[1] ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: "
-                                       "invalid URL (%s) in \"referral\" line.\n",
-                                       fname, lineno, cargv[1] ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: invalid URL (%s) in \"referral\" line.\n",
+                                       fname, lineno, cargv[1]  );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "invalid URL (%s) in \"referral\" line.\n",
@@ -1505,9 +1494,9 @@ read_config( const char *fname )
                         FILE *logfile;
                         if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: Error in logfile directive, "
-                                          "\"logfile <filename>\"\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: Error in logfile directive, "
+                                       "\"logfile <filename>\"\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "%s: line %d: Error in logfile directive, \"logfile filename\"\n",
@@ -1517,7 +1506,7 @@ read_config( const char *fname )
                                return( 1 );
                         }
                         logfile = fopen( cargv[1], "w" );
-                        if ( logfile != NULL ) lutil_debug_file( logfile );
+                        if ( logfile != NULL ) lutil_debug_file( logfile  );
 
 #endif
                /* start of a new database definition */
@@ -1525,9 +1514,9 @@ read_config( const char *fname )
                         int level;
                        if ( cargc < 3 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: Error in debug directive, "
-                                          "\"debug <subsys> <level>\"\n", fname, lineno ));
+                                          "\"debug <subsys> <level>\"\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: Error in debug directive, \"debug subsys level\"\n",
@@ -1554,9 +1543,9 @@ read_config( const char *fname )
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: old objectclass format not supported\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: old objectclass format not supported\n",
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "%s: line %d: old objectclass format not supported.\n",
@@ -1576,9 +1565,9 @@ read_config( const char *fname )
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: old attribute type format not supported.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: old attribute type format not supported.\n",
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
     "%s: line %d: old attribute type format not supported.\n",
@@ -1591,10 +1580,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "schemacheck" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing on|off in "
-                                          "\"schemacheck <on|off>\" line.\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing on|off in \"schemacheck <on|off>\""
+                                       " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
     "%s: line %d: missing on|off in \"schemacheck <on|off>\" line\n",
@@ -1605,9 +1593,9 @@ read_config( const char *fname )
                        }
                        if ( strcasecmp( cargv[1], "off" ) == 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                       "%s: line %d: schema checking disabled! your mileage may vary!\n",
-                                       fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: schema checking disabled! your mileage may "
+                                       "vary!\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s: line %d: schema checking disabled! your mileage may vary!\n",
@@ -1626,9 +1614,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "loglevel" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing level in \"loglevel <level>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing level in \"loglevel <level>\""
+                                       " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing level in \"loglevel <level>\" line\n",
@@ -1648,9 +1636,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing host in \"replica "
-                                          " <host[:port]\" line\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing host in \"replica "
+                                       " <host[:port]\" line\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing host in \"replica <host[:port]>\" line\n",
@@ -1661,9 +1649,9 @@ read_config( const char *fname )
                        }
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: replica line must appear inside "
-                                          "a database definition.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                           "%s: line %d: replica line must appear inside "
+                                           "a database definition.\n", fname, lineno, 0);
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: replica line must appear inside a database definition\n",
@@ -1684,9 +1672,9 @@ read_config( const char *fname )
                                }
                                if ( i == cargc ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                               "%s: line %d: missing host in \"replica\" line\n",
-                                               fname, lineno ));
+                                       LDAP_LOG( CONFIG, INFO, 
+                                               "%s: line %d: missing host in \"replica\" line\n", 
+                                               fname, lineno , 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing host in \"replica\" line\n",
@@ -1696,11 +1684,11 @@ read_config( const char *fname )
 
                                } else if ( nr == -1 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( CONFIG, INFO, 
                                                   "%s: line %d: unable to add"
-                                                  " replica \"%s\"\n",
+                                                  " replica \"%s\"\n",
                                                   fname, lineno, 
-                                                  cargv[i] + 5 ));
+                                                  cargv[i] + 5 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                "%s: line %d: unable to add replica \"%s\"\n",
@@ -1714,9 +1702,10 @@ read_config( const char *fname )
                                                        switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) {
                                                        case 1:
 #ifdef NEW_LOGGING
-                                                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                                                               "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
-                                                                               fname, lineno, cargv[i] + 7 ));
+                                                               LDAP_LOG( CONFIG, INFO, 
+                                                                       "%s: line %d: suffix \"%s\" in \"replica\""
+                                                                       " line is not valid for backend(ignored)\n",
+                                                                       fname, lineno, cargv[i] + 7 );
 #else
                                                                Debug( LDAP_DEBUG_ANY,
                                                                                "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
@@ -1726,9 +1715,10 @@ read_config( const char *fname )
 
                                                        case 2:
 #ifdef NEW_LOGGING
-                                                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                                                                       "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
-                                                                                       fname, lineno ));
+                                                               LDAP_LOG( CONFIG, INFO, 
+                                                                       "%s: line %d: unable to normalize suffix"
+                                                                       " in \"replica\" line (ignored)\n",
+                                                                       fname, lineno , 0 );
 #else
                                                                Debug( LDAP_DEBUG_ANY,
                                                                                 "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
@@ -1752,9 +1742,10 @@ read_config( const char *fname )
 
                                                        if ( add_replica_attrs( be, nr, arg + 1, exclude ) ) {
 #ifdef NEW_LOGGING
-                                                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                                                               "%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n",
-                                                                               fname, lineno, arg + 1 ));
+                                                               LDAP_LOG( CONFIG, INFO, 
+                                                                       "%s: line %d: attribute \"%s\" in "
+                                                                       "\"replica\" line is unknown\n",
+                                                                       fname, lineno, arg + 1 ); 
 #else
                                                                Debug( LDAP_DEBUG_ANY,
                                                                                "%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n",
@@ -1771,9 +1762,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing dn in \"updatedn <dn>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing dn in \"updatedn <dn>\""
+                                       " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                    "%s: line %d: missing dn in \"updatedn <dn>\" line\n",
@@ -1784,10 +1775,10 @@ read_config( const char *fname )
                        }
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: updatedn line must appear inside "
-                                          "a database definition\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: updatedn line must appear inside "
+                                       "a database definition\n", 
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: updatedn line must appear inside a database definition\n",
@@ -1806,9 +1797,9 @@ read_config( const char *fname )
                                rc = dnNormalize2( NULL, &dn, &be->be_update_ndn );
                                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                                       LDAP_LOG( CONFIG, CRIT, 
                                                "%s: line %d: updatedn DN is invalid.\n",
-                                               fname, lineno ));
+                                               fname, lineno , 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "%s: line %d: updatedn DN is invalid\n",
@@ -1821,9 +1812,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: "
+                               LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
                                        "missing url in \"updateref <ldapurl>\" line.\n",
-                                       fname, lineno ));
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "missing url in \"updateref <ldapurl>\" line\n",
@@ -1834,9 +1825,9 @@ read_config( const char *fname )
                        }
                        if ( be == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: updateref"
+                               LDAP_LOG( CONFIG, INFO, "%s: line %d: updateref"
                                        " line must appear inside a database definition\n",
-                                       fname, lineno ));
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: updateref"
                                        " line must appear inside a database definition\n",
@@ -1846,9 +1837,9 @@ read_config( const char *fname )
 
                        } else if ( !be->be_update_ndn.bv_len ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: "
+                               LDAP_LOG( CONFIG, INFO, "%s: line %d: "
                                        "updateref line must come after updatedn.\n",
-                                       fname, lineno ));
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "updateref line must after updatedn.\n",
@@ -1859,9 +1850,9 @@ read_config( const char *fname )
 
                        if( validate_global_referral( cargv[1] ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: "
+                               LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
                                        "invalid URL (%s) in \"updateref\" line.\n",
-                                       fname, lineno, cargv[1] ));
+                                       fname, lineno, cargv[1] );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "invalid URL (%s) in \"updateref\" line.\n",
@@ -1878,9 +1869,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing filename in \"replogfile <filename>\""
-                                          " line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing filename in \"replogfile <filename>\""
+                                       " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing filename in \"replogfile <filename>\" line\n",
@@ -1899,9 +1890,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "rootDSE" ) == 0) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: "
+                               LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
                                        "missing filename in \"rootDSE <filename>\" line.\n",
-                                       fname, lineno ));
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "missing filename in \"rootDSE <filename>\" line.\n",
@@ -1912,9 +1903,9 @@ read_config( const char *fname )
 
                        if( read_root_dse_file( cargv[1] ) ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: "
+                               LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
                                        "could not read \"rootDSE <filename>\" line.\n",
-                                       fname, lineno ));
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
                                        "could not read \"rootDSE <filename>\" line\n",
@@ -1927,9 +1918,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "lastmod" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                           "%s: line %d: missing on|off in \"lastmod <on|off>\""
-                                          " line.\n", fname, lineno ));
+                                          " line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing on|off in \"lastmod <on|off>\" line\n",
@@ -1973,9 +1964,9 @@ read_config( const char *fname )
                        int i;
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing timeout value in "
-                                          "\"idletimeout <seconds>\" line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing timeout value in "
+                                       "\"idletimeout <seconds>\" line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing timeout value in \"idletimeout <seconds>\" line\n",
@@ -1989,10 +1980,9 @@ read_config( const char *fname )
 
                        if( i < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: timeout value (%d) invalid "
-                                          "\"idletimeout <seconds>\" line.\n",
-                                          fname, lineno, i ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: timeout value (%d) invalid "
+                                       "\"idletimeout <seconds>\" line.\n", fname, lineno, i );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: timeout value (%d) invalid \"idletimeout <seconds>\" line\n",
@@ -2008,9 +1998,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "include" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing filename in \"include "
-                                          "<filename>\" line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing filename in \"include "
+                                       "<filename>\" line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
     "%s: line %d: missing filename in \"include <filename>\" line\n",
@@ -2033,9 +2023,9 @@ read_config( const char *fname )
                } else if ( strcasecmp( cargv[0], "srvtab" ) == 0 ) {
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                          "%s: line %d: missing filename in \"srvtab "
-                                          "<filename>\" line.\n", fname, lineno ));
+                               LDAP_LOG( CONFIG, CRIT, 
+                                       "%s: line %d: missing filename in \"srvtab "
+                                       "<filename>\" line.\n", fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
            "%s: line %d: missing filename in \"srvtab <filename>\" line\n",
@@ -2050,9 +2040,9 @@ read_config( const char *fname )
                 } else if (strcasecmp( cargv[0], "moduleload") == 0 ) {
                    if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                          LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                     "%s: line %d: missing filename in \"moduleload "
-                                     "<filename>\" line.\n", fname, lineno ));
+                          LDAP_LOG( CONFIG, INFO, 
+                                  "%s: line %d: missing filename in \"moduleload "
+                                  "<filename>\" line.\n", fname, lineno , 0 );
 #else
                       Debug( LDAP_DEBUG_ANY,
                              "%s: line %d: missing filename in \"moduleload <filename>\" line\n",
@@ -2063,9 +2053,9 @@ read_config( const char *fname )
                    }
                    if (module_load(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) {
 #ifdef NEW_LOGGING
-                          LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                     "%s: line %d: failed to load or initialize module %s\n",
-                                     fname, lineno, cargv[1] ));
+                          LDAP_LOG( CONFIG, CRIT, 
+                                  "%s: line %d: failed to load or initialize module %s\n",
+                                  fname, lineno, cargv[1] );
 #else
                       Debug( LDAP_DEBUG_ANY,
                              "%s: line %d: failed to load or initialize module %s\n",
@@ -2077,9 +2067,9 @@ read_config( const char *fname )
                 } else if (strcasecmp( cargv[0], "modulepath") == 0 ) {
                    if ( cargc != 2 ) {
 #ifdef NEW_LOGGING
-                          LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                     "%s: line %d: missing path in \"modulepath <path>\""
-                                     " line\n", fname, lineno ));
+                          LDAP_LOG( CONFIG, INFO, 
+                                 "%s: line %d: missing path in \"modulepath <path>\""
+                                 " line\n", fname, lineno , 0 );
 #else
                       Debug( LDAP_DEBUG_ANY,
                              "%s: line %d: missing path in \"modulepath <path>\" line\n",
@@ -2090,9 +2080,9 @@ read_config( const char *fname )
                    }
                    if (module_path( cargv[1] )) {
 #ifdef NEW_LOGGING
-                          LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                                     "%s: line %d: failed to set module search path to %s.\n",
-                                     fname, lineno, cargv[1] ));
+                          LDAP_LOG( CONFIG, CRIT, 
+                                 "%s: line %d: failed to set module search path to %s.\n",
+                                 fname, lineno, cargv[1] );
 #else
                           Debug( LDAP_DEBUG_ANY,
                                  "%s: line %d: failed to set module search path to %s\n",
@@ -2167,10 +2157,9 @@ read_config( const char *fname )
 #ifdef SLAPD_RLOOKUPS
                        if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: reverse-lookup: "
-                                          "missing \"on\" or \"off\"\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n",
+                                       fname, lineno , 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n",
@@ -2185,11 +2174,9 @@ read_config( const char *fname )
                                use_reverse_lookup = 0;
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: reverse-lookup: "
-                                          "must be \"on\" (default) "
-                                          "or \"off\"\n",
-                                          fname, lineno ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: reverse-lookup: "
+                                       "must be \"on\" (default) or \"off\"\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: reverse-lookup: must be \"on\" (default) or \"off\"\n",
@@ -2200,10 +2187,9 @@ read_config( const char *fname )
 
 #else /* !SLAPD_RLOOKUPS */
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                  "%s: line %d: reverse lookups "
-                                  "are not configured (ignored).\n",
-                                  fname, lineno ));
+                       LDAP_LOG( CONFIG, INFO, 
+                               "%s: line %d: reverse lookups "
+                               "are not configured (ignored).\n", fname, lineno , 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
 "%s: line %d: reverse lookups are not configured (ignored).\n",
@@ -2216,10 +2202,10 @@ read_config( const char *fname )
                        if ( bi != NULL ) {
                                if ( bi->bi_config == 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                                  "%s: line %d: unknown directive \"%s\" inside "
-                                                  "backend info definition (ignored).\n",
-                                                  fname, lineno, cargv[0] ));
+                                       LDAP_LOG( CONFIG, INFO, 
+                                               "%s: line %d: unknown directive \"%s\" inside "
+                                               "backend info definition (ignored).\n",
+                                               fname, lineno, cargv[0] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
 "%s: line %d: unknown directive \"%s\" inside backend info definition (ignored)\n",
@@ -2236,10 +2222,10 @@ read_config( const char *fname )
                        } else if ( be != NULL ) {
                                if ( be->be_config == 0 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                                  "%s: line %d: uknown directive \"%s\" inside "
-                                                  "backend database definition (ignored).\n",
-                                                  fname, lineno, cargv[0] ));
+                                       LDAP_LOG( CONFIG, INFO, 
+                                               "%s: line %d: uknown directive \"%s\" inside "
+                                               "backend database definition (ignored).\n",
+                                               fname, lineno, cargv[0] );
 #else
                                        Debug( LDAP_DEBUG_ANY,
 "%s: line %d: unknown directive \"%s\" inside backend database definition (ignored)\n",
@@ -2255,10 +2241,10 @@ read_config( const char *fname )
                                }
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
-                                          "%s: line %d: unknown directive \"%s\" outside backend "
-                                          "info and database definitions (ignored).\n",
-                                          fname, lineno, cargv[0] ));
+                               LDAP_LOG( CONFIG, INFO, 
+                                       "%s: line %d: unknown directive \"%s\" outside backend "
+                                       "info and database definitions (ignored).\n",
+                                       fname, lineno, cargv[0] );
 #else
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: unknown directive \"%s\" outside backend info and database definitions (ignored)\n",
@@ -2299,8 +2285,7 @@ fp_parse_line(
        if ( strtok_quote_ptr )
                *strtok_quote_ptr = ' ';
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "config", LDAP_LEVEL_DETAIL1,
-                  "line %d (%s)\n", lineno, logline ));
+       LDAP_LOG( CONFIG, DETAIL1, "line %d (%s)\n", lineno, logline , 0 );
 #else
        Debug( LDAP_DEBUG_CONFIG, "line %d (%s)\n", lineno, logline, 0 );
 #endif
@@ -2314,9 +2299,7 @@ fp_parse_line(
                                            sizeof(*cargv) );
                        if ( tmp == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_ERR,
-                                          "line %d: out of memory\n", 
-                                          lineno ));
+                               LDAP_LOG( CONFIG, ERR, "line %d: out of memory\n", lineno, 0,0 );
 #else
                                Debug( LDAP_DEBUG_ANY, 
                                                "line %d: out of memory\n", 
@@ -2469,8 +2452,8 @@ load_ucdata( char *path )
        err = ucdata_load( path ? path : SLAPD_DEFAULT_UCDATA, UCDATA_ALL );
        if ( err ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                          "load_ucdata: Error %d loading ucdata.\n", err ));
+               LDAP_LOG( CONFIG, CRIT, 
+                       "load_ucdata: Error %d loading ucdata.\n", err, 0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "error loading ucdata (error %d)\n",
                       err, 0, 0 );
index 6425e199f2561e28e8e49ebfa1dca01f64d001f4..8570a4a16322c33c1abb63edf8825240c7c97072 100644 (file)
@@ -74,8 +74,8 @@ int connections_init(void)
 
        if( connections != NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connections_init:  already initialized.\n" ));
+               LDAP_LOG( CONNECTION, INFO,
+                          "connections_init:  already initialized.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "connections_init: already initialized.\n",
                        0, 0, 0 );
@@ -90,9 +90,9 @@ int connections_init(void)
 
        if( connections == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connections_init: allocation (%d * %ld) of connection array failed\n",
-                          dtblsize, (long) sizeof(Connection) ));
+               LDAP_LOG( CONNECTION, ERR,
+                          "connections_init: allocation (%d * %ld) of connection "
+                          "array failed\n", dtblsize, (long) sizeof(Connection), 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "connections_init: allocation (%d*%ld) of connection array failed\n",
@@ -123,8 +123,8 @@ int connections_destroy(void)
 
        if( connections == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connections_destroy: nothing to destroy.\n"));
+               LDAP_LOG( CONNECTION, INFO,
+                          "connections_destroy: nothing to destroy.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "connections_destroy: nothing to destroy.\n",
                        0, 0, 0 );
@@ -208,8 +208,7 @@ static Connection* connection_get( ber_socket_t s )
        Connection *c;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_ENTRY,
-                  "connection_get: socket %ld\n", (long)s ));
+       LDAP_LOG( CONNECTION, ENTRY, "connection_get: socket %ld\n", (long)s, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "connection_get(%ld)\n",
@@ -273,8 +272,8 @@ static Connection* connection_get( ber_socket_t s )
                        assert( sd == AC_SOCKET_INVALID );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ARGS,
-                                  "connection_get:  connection %d not used\n", s ));
+                       LDAP_LOG( CONNECTION, ARGS, 
+                               "connection_get:  connection %d not used\n", s, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "connection_get(%d): connection not used\n",
@@ -286,8 +285,8 @@ static Connection* connection_get( ber_socket_t s )
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS,
-                          "connection_get: get for %d got connid %lu\n", s, c->c_connid ));
+               LDAP_LOG( CONNECTION, RESULTS, 
+                       "connection_get: get for %d got connid %lu\n", s, c->c_connid, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "connection_get(%d): got connid=%lu\n",
@@ -342,8 +341,8 @@ long connection_init(
 
        if( s == AC_SOCKET_INVALID ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connection_init: init of socket %ld invalid.\n", (long)s ));
+               LDAP_LOG( CONNECTION, INFO, 
+                          "connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                       "connection_init(%ld): invalid.\n",
@@ -394,9 +393,9 @@ long connection_init(
 
        if( c == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+               LDAP_LOG( CONNECTION, INFO, 
                           "connection_init: skt %d      connection table full (%d/%d)\n",
-                          s, i, dtblsize ));
+                          s, i, dtblsize );
 #else
                Debug( LDAP_DEBUG_ANY,
                                "connection_init(%d): connection table full (%d/%d)\n",
@@ -529,9 +528,9 @@ long connection_init(
                c /* non-NULL */ ) < 0 )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+               LDAP_LOG( CONNECTION, INFO, 
                           "connection_init: conn %lu  set nonblocking failed\n",
-                          c->c_connid ));
+                          c->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "connection_init(%d, %s): set nonblocking failed\n",
@@ -753,9 +752,9 @@ void connection_closing( Connection *c )
 
                ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CONNECTION, DETAIL1, 
                           "connection_closing: conn %lu readying socket %d for close.\n",
-                          c->c_connid, sd ));
+                          c->c_connid, sd, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "connection_closing: readying conn=%lu sd=%d for close\n",
@@ -790,9 +789,9 @@ static void connection_close( Connection *c )
        ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
        if( !LDAP_STAILQ_EMPTY(&c->c_ops) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( CONNECTION, DETAIL1, 
                           "connection_close: conn %lu  deferring sd %d\n",
-                          c->c_connid, sd ));
+                          c->c_connid, sd, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "connection_close: deferring conn=%lu sd=%d\n",
@@ -802,9 +801,8 @@ static void connection_close( Connection *c )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS,
-                  "connection_close: conn %lu  sd %d\n",
-                  c->c_connid, sd ));
+       LDAP_LOG( CONNECTION, RESULTS, 
+                  "connection_close: conn %lu  sd %d\n", c->c_connid, sd, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%lu sd=%d\n",
                c->c_connid, sd, 0 );
@@ -922,9 +920,9 @@ connection_operation( void *arg_v )
 
        if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_operation: conn %lu  SASL bind in progress (tag=%ld).\n",
-                          conn->c_connid, (long)tag ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_operation: conn %lu SASL bind in progress (tag=%ld).\n",
+                       conn->c_connid, (long)tag, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "connection_operation: "
                        "error: SASL bind in progress (tag=%ld).\n",
@@ -989,9 +987,9 @@ connection_operation( void *arg_v )
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+               LDAP_LOG( CONNECTION, INFO, 
                           "connection_operation: conn %lu  unknown LDAP request 0x%lx\n",
-                          conn->c_connid, tag ));
+                          conn->c_connid, tag, 0  );
 #else
                Debug( LDAP_DEBUG_ANY, "unknown LDAP request 0x%lx\n",
                    tag, 0, 0 );
@@ -1087,6 +1085,7 @@ int connection_read(ber_socket_t s)
 {
        int rc = 0;
        Connection *c;
+
        assert( connections != NULL );
 
        ldap_pvt_thread_mutex_lock( &connections_mutex );
@@ -1096,9 +1095,8 @@ int connection_read(ber_socket_t s)
 
        if( c == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connection_read: sock %ld no connection\n",
-                          (long)s ));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "connection_read: sock %ld no connection\n", (long)s, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "connection_read(%ld): no connection!\n",
@@ -1114,9 +1112,9 @@ int connection_read(ber_socket_t s)
 
        if( c->c_conn_state == SLAP_C_CLOSING ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connection_read: conn %lu connection closing, ignoring input\n",
-                          c->c_connid));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "connection_read: conn %lu connection closing, ignoring input\n",
+                       c->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "connection_read(%d): closing, ignoring input for id=%lu\n",
@@ -1128,8 +1126,9 @@ int connection_read(ber_socket_t s)
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "connection_read: conn %lu  checking for input.\n", c->c_connid ));
+       LDAP_LOG( CONNECTION, DETAIL1, 
+                  "connection_read: conn %lu  checking for input.\n", 
+                  c->c_connid, 0, 0  );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "connection_read(%d): checking for input on id=%lu\n",
@@ -1146,9 +1145,9 @@ int connection_read(ber_socket_t s)
 #endif
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
+                       LDAP_LOG( CONNECTION, ERR, 
                                   "connection_read: conn %lu  TLS accept error, error %d\n",
-                                  c->c_connid, rc ));
+                                  c->c_connid, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "connection_read(%d): TLS accept error "
@@ -1192,9 +1191,9 @@ int connection_read(ber_socket_t s)
                        rc = dnX509peerNormalize( ssl, &authid );
                        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                               "connection_read: conn %lu unable to get TLS client DN, error %d\n",
-                                       c->c_connid, rc));
+                               LDAP_LOG( CONNECTION, INFO, 
+                                       "connection_read: conn %lu unable to get TLS client DN, "
+                                       "error %d\n", c->c_connid, rc, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE,
                                "connection_read(%d): unable to get TLS client DN "
@@ -1225,9 +1224,9 @@ int connection_read(ber_socket_t s)
 
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                  "connection_read: conn %lu SASL install error %d, closing\n",
-                                  c->c_connid, rc ));
+                       LDAP_LOG( CONNECTION, ERR, 
+                               "connection_read: conn %lu SASL install error %d, closing\n",
+                               c->c_connid, rc, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "connection_read(%d): SASL install error "
@@ -1258,9 +1257,9 @@ int connection_read(ber_socket_t s)
 
        if( rc < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_read: conn %lu  input error %d, closing.\n",
-                          c->c_connid, rc ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_read: conn %lu  input error %d, closing.\n",
+                       c->c_connid, rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "connection_read(%d): input error=%d id=%lu, closing.\n",
@@ -1305,9 +1304,9 @@ connection_input(
        if ( conn->c_currentber == NULL && (conn->c_currentber = ber_alloc())
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_input: conn %lu  ber_alloc failed.\n", 
-                          conn->c_connid ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_input: conn %lu  ber_alloc failed.\n", 
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
 #endif
@@ -1340,9 +1339,9 @@ connection_input(
                ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_input: conn %lu  ber_get_next failed, errno %d (%s).\n",
-                          conn->c_connid, err, sock_errstr(err) ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_input: conn %lu  ber_get_next failed, errno %d (%s).\n",
+                       conn->c_connid, err, sock_errstr(err) );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ber_get_next on fd %d failed errno=%d (%s)\n",
@@ -1364,9 +1363,9 @@ connection_input(
        if ( (tag = ber_get_int( ber, &msgid )) != LDAP_TAG_MSGID ) {
                /* log, close and send error */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_input: conn %lu  ber_get_int returns 0x%lx.\n",
-                          conn->c_connid, tag ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_input: conn %lu  ber_get_int returns 0x%lx.\n",
+                       conn->c_connid, tag, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_get_int returns 0x%lx\n", tag, 0,
                    0 );
@@ -1378,9 +1377,9 @@ connection_input(
        if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) {
                /* log, close and send error */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
+               LDAP_LOG( CONNECTION, ERR, 
                           "connection_input: conn %lu  ber_peek_tag returns 0x%lx.\n",
-                          conn->c_connid, tag ));
+                          conn->c_connid, tag, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_peek_tag returns 0x%lx\n", tag, 0,
                    0 );
@@ -1398,9 +1397,9 @@ connection_input(
                }
                if (tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH) {
 #ifdef NEW_LOGGING
-                   LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
+                   LDAP_LOG( CONNECTION, ERR, 
                               "connection_input: conn %lu  invalid req for UDP 0x%lx.\n",
-                              conn->c_connid, tag ));
+                              conn->c_connid, tag, 0 );
 #else
                    Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0,
                        0 );
@@ -1432,9 +1431,9 @@ connection_input(
                || conn->c_conn_state == SLAP_C_CLOSING )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "connection_input: conn %lu  deferring operation\n",
-                          conn->c_connid ));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "connection_input: conn %lu  deferring operation\n",
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "deferring operation\n", 0, 0, 0 );
 #endif
@@ -1472,9 +1471,9 @@ connection_resched( Connection *conn )
 
                if( rc ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                                  "connection_resched: conn %lu  reaquiring locks.\n",
-                                  conn->c_connid ));
+                       LDAP_LOG( CONNECTION, DETAIL1, 
+                               "connection_resched: conn %lu  reaquiring locks.\n",
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "connection_resched: reaquiring locks conn=%lu sd=%d\n",
@@ -1492,9 +1491,9 @@ connection_resched( Connection *conn )
 
                if( conn->c_conn_state != SLAP_C_CLOSING ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                  "connection_resched: conn %lu  closed by other thread.\n",
-                                  conn->c_connid ));
+                       LDAP_LOG( CONNECTION, INFO, 
+                               "connection_resched: conn %lu  closed by other thread.\n",
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "connection_resched: "
                                "closed by other thread conn=%lu sd=%d\n",
@@ -1502,9 +1501,9 @@ connection_resched( Connection *conn )
 #endif
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                                  "connection_resched: conn %lu  attempting closing.\n",
-                                  conn->c_connid ));
+                       LDAP_LOG( CONNECTION, DETAIL1, 
+                               "connection_resched: conn %lu  attempting closing.\n",
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "connection_resched: "
                                "attempting closing conn=%lu sd=%d\n",
@@ -1577,9 +1576,9 @@ static int connection_op_activate( Connection *conn, Operation *op )
 
        if ( status != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_op_activate: conn %lu     thread pool submit failed.\n",
-                          conn->c_connid ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_op_activate: conn %lu        thread pool submit failed.\n",
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                "ldap_pvt_thread_pool_submit failed (%d)\n", status, 0, 0 );
@@ -1593,6 +1592,7 @@ static int connection_op_activate( Connection *conn, Operation *op )
 int connection_write(ber_socket_t s)
 {
        Connection *c;
+
        assert( connections != NULL );
 
        ldap_pvt_thread_mutex_lock( &connections_mutex );
@@ -1603,8 +1603,8 @@ int connection_write(ber_socket_t s)
 
        if( c == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "connection_write: sock %ld  no connection!\n",(long)s));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "connection_write: sock %ld  no connection!\n", (long)s, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "connection_write(%ld): no connection!\n",
@@ -1618,9 +1618,8 @@ int connection_write(ber_socket_t s)
        c->c_n_write++;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "connection_write conn %lu  waking output.\n",
-                  c->c_connid ));
+       LDAP_LOG( CONNECTION, DETAIL1, 
+               "connection_write conn %lu  waking output.\n", c->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "connection_write(%d): waking output for id=%lu\n",
index 16ea8cb6ccc87b76c224fdd30728a7a0a3c446a6..535345c2e208468b85830eb698609e2d09877526 100644 (file)
@@ -132,8 +132,7 @@ int get_ctrls(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "get_ctrls: conn %lu\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "get_ctrls: conn %lu\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 );
 #endif
@@ -203,9 +202,8 @@ int get_ctrls(
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                               "get_ctrls: conn %lu get OID failed.\n",
-                               conn->c_connid ));
+                       LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu get OID failed.\n",
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n",
                                0, 0, 0 );
@@ -225,9 +223,9 @@ int get_ctrls(
 
                        if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                       "get_ctrls: conn %lu get crit failed.\n",
-                                       conn->c_connid ));
+                               LDAP_LOG( OPERATION, INFO, 
+                                       "get_ctrls: conn %lu get crit failed.\n", 
+                                       conn->c_connid, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n",
                                        0, 0, 0 );
@@ -248,11 +246,10 @@ int get_ctrls(
 
                        if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "get_ctrls: conn %lu: "
+                               LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu: "
                                        "%s (%scritical): get value failed.\n",
-                                       conn->c_connid,
-                                       c->ldctl_oid ? c->ldctl_oid : "(NULL)",
-                                       c->ldctl_iscritical ? "" : "non" ));
+                                       conn->c_connid, c->ldctl_oid ? c->ldctl_oid : "(NULL)",
+                                       c->ldctl_iscritical ? "" : "non" );
 #else
                                Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %lu: "
                                        "%s (%scritical): get value failed.\n",
@@ -269,11 +266,10 @@ int get_ctrls(
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "get_ctrls: conn %lu oid=\"%s\" (%scritical)\n",
-                       conn->c_connid,
-                       c->ldctl_oid ? c->ldctl_oid : "(NULL)",
-                       c->ldctl_iscritical ? "" : "non" ));
+                       conn->c_connid, c->ldctl_oid ? c->ldctl_oid : "(NULL)",
+                       c->ldctl_iscritical ? "" : "non" );
 #else
                Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: oid=\"%s\" (%scritical)\n",
                        c->ldctl_oid ? c->ldctl_oid : "(NULL)",
@@ -355,9 +351,8 @@ int get_ctrls(
 
 return_results:
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_RESULTS,
-               "get_ctrls: conn=%lu    n=%d rc=%d err=%s\n",
-               conn->c_connid, nctrls, rc, errmsg ? errmsg : "" ));
+       LDAP_LOG( OPERATION, RESULTS, 
+               "get_ctrls: n=%d rc=%d err=%s\n", nctrls, rc, errmsg ? errmsg : "" );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= get_ctrls: n=%d rc=%d err=%s\n",
                nctrls, rc, errmsg ? errmsg : "");
@@ -576,9 +571,9 @@ int parseValuesReturnFilter (
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "parseValuesReturnFilter: conn %d       vrFilter: %s\n", conn->c_connid,
-               fstr.bv_len ? fstr.bv_val : "empty" ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "parseValuesReturnFilter: conn %d       vrFilter: %s\n", 
+               conn->c_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "       vrFilter: %s\n",
                fstr.bv_len ? fstr.bv_val : "empty", 0, 0 );
index 1a72f5b070348f87c04c9a8c7088d5cb68160901..dcddb01a8e745711aa3b4aad433bfb186f359d2a 100644 (file)
@@ -200,11 +200,10 @@ static void slapd_add(ber_socket_t s) {
        FD_SET( s, &slap_daemon.sd_readers );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "slapd_add: added %ld%s%s\n",
-                  (long)s,
-                  FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
-                  FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" ));
+       LDAP_LOG( CONNECTION, DETAIL1, 
+               "slapd_add: added %ld%s%s\n", (long)s,
+               FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
+               FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
 #else
        Debug( LDAP_DEBUG_CONNS, "daemon: added %ld%s%s\n",
                (long) s,
@@ -223,11 +222,10 @@ void slapd_remove(ber_socket_t s, int wake) {
        slap_daemon.sd_nactives--;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "slapd_remove: removing %ld%s%s\n",
-                  (long) s,
-                  FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
-                  FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : ""  ));
+       LDAP_LOG( CONNECTION, DETAIL1, 
+               "slapd_remove: removing %ld%s%s\n", (long) s,
+               FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
+               FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : ""  );
 #else
        Debug( LDAP_DEBUG_CONNS, "daemon: removing %ld%s%s\n",
                (long) s,
@@ -286,8 +284,7 @@ void slapd_set_read(ber_socket_t s, int wake) {
 
 static void slapd_close(ber_socket_t s) {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "slapd_close: closing %ld\n", (long)s ));
+       LDAP_LOG( CONNECTION, DETAIL1, "slapd_close: closing %ld\n", (long)s, 0, 0);
 #else
        Debug( LDAP_DEBUG_CONNS, "daemon: closing %ld\n",
                (long) s, 0, 0 );
@@ -391,9 +388,9 @@ static int slap_get_listener_addresses(
                if ( strlen(host) >
                     (sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                  "slap_get_listener_addresses: domain socket path (%s) too long in URL\n",
-                                  host ));
+                       LDAP_LOG( CONNECTION, INFO, 
+                               "slap_get_listener_addresses: domain socket path (%s) "
+                               "too long in URL\n", host, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                               "daemon: domain socket path (%s) too long in URL",
@@ -421,9 +418,9 @@ static int slap_get_listener_addresses(
 
                if ( (err = getaddrinfo(host, serv, &hints, &res)) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+                       LDAP_LOG( CONNECTION, INFO, 
                                   "slap_get_listener_addresses: getaddrinfo failed: %s\n",
-                                  AC_GAI_STRERROR(err) ));
+                                  AC_GAI_STRERROR(err), 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n",
                                AC_GAI_STRERROR(err), 0, 0);
@@ -446,9 +443,9 @@ static int slap_get_listener_addresses(
                for ( sai=res; sai; sai=sai->ai_next ) {
                        if( sai->ai_addr == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONNECTION, INFO,
                                        "slap_get_listener_addresses: "
-                                       "getaddrinfo ai_addr is NULL?\n" ));
+                                       "getaddrinfo ai_addr is NULL?\n", 0, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "slap_get_listener_addresses: "
                                        "getaddrinfo ai_addr is NULL?\n", 0, 0, 0 );
@@ -503,9 +500,8 @@ static int slap_get_listener_addresses(
                        he = gethostbyname( host );
                        if( he == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                          "slap_get_listener_addresses: invalid host %s\n",
-                                          host ));
+                               LDAP_LOG( CONNECTION, INFO, 
+                                       "slap_get_listener_addresses: invalid host %s\n", host, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "daemon: invalid host %s", host, 0, 0);
@@ -560,6 +556,7 @@ static int slap_open_listener(
        int err, addrlen = 0;
        struct sockaddr **sal, **psal;
        int socktype = SOCK_STREAM;     /* default to COTS */
+
 #ifdef LDAP_PF_LOCAL
        mode_t  perms = S_IRWXU;
        int     crit = 1;
@@ -569,9 +566,9 @@ static int slap_open_listener(
 
        if( rc != LDAP_URL_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "slap_open_listener: listen URL \"%s\" parse error %d\n",
-                          url, rc ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "slap_open_listener: listen URL \"%s\" parse error %d\n",
+                       url, rc , 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "daemon: listen URL \"%s\" parse error=%d\n",
@@ -583,9 +580,8 @@ static int slap_open_listener(
 #ifndef HAVE_TLS
        if( ldap_pvt_url_scheme2tls( lud->lud_scheme ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "slap_open_listener: TLS is not supported (%s)\n",
-                          url ));
+               LDAP_LOG( CONNECTION, INFO, 
+                          "slap_open_listener: TLS is not supported (%s)\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "daemon: TLS not supported (%s)\n",
@@ -624,9 +620,8 @@ static int slap_open_listener(
 #else
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "slap_open_listener: URL scheme is not supported: %s\n",
-                          url ));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "slap_open_listener: URL scheme is not supported: %s\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "daemon: URL scheme not supported: %s",
                        url, 0, 0);
@@ -684,9 +679,9 @@ static int slap_open_listener(
                if ( l.sl_sd == AC_SOCKET_INVALID ) {
                        int err = sock_errno();
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                  "slap_open_listener: socket() failed errno=%d (%s)\n",
-                                  err, sock_errstr(err) ));
+                       LDAP_LOG( CONNECTION, ERR, 
+                               "slap_open_listener: socket() failed errno=%d (%s)\n",
+                               err, sock_errstr(err), 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "daemon: socket() failed errno=%d (%s)\n", err,
@@ -698,9 +693,9 @@ static int slap_open_listener(
 #ifndef HAVE_WINSOCK
                if ( l.sl_sd >= dtblsize ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                  "slap_open_listener: listener descriptor %ld is too great %ld\n",
-                                  (long)l.sl_sd, (long)dtblsize ));
+                       LDAP_LOG( CONNECTION, ERR, 
+                               "slap_open_listener: listener descriptor %ld is too "
+                               "great %ld\n", (long)l.sl_sd, (long)dtblsize, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                               "daemon: listener descriptor %ld is too great %ld\n",
@@ -725,9 +720,10 @@ static int slap_open_listener(
                        if ( rc == AC_SOCKET_ERROR ) {
                                int err = sock_errno();
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                          "slap_open_listener: setsockopt( %ld, SO_REUSEADDR ) failed errno %d (%s)\n",
-                                          (long)l.sl_sd, err, sock_errstr(err) ));
+                               LDAP_LOG( CONNECTION, INFO, 
+                                       "slap_open_listener: setsockopt( %ld, SO_REUSEADDR ) "
+                                       "failed errno %d (%s)\n", (long)l.sl_sd, err, 
+                                       sock_errstr(err) );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n",
@@ -751,9 +747,9 @@ static int slap_open_listener(
                        if ( rc == AC_SOCKET_ERROR ) {
                                int err = sock_errno();
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+                               LDAP_LOG( CONNECTION, INFO,
                                           "slap_open_listener: setsockopt( %ld, IPV6_V6ONLY ) failed errno %d (%s)\n",
-                                          (long)l.sl_sd, err, sock_errstr(err) ));
+                                          (long)l.sl_sd, err, sock_errstr(err) );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                       "slapd(%ld): setsockopt(IPV6_V6ONLY) failed errno=%d (%s)\n",
@@ -774,9 +770,9 @@ static int slap_open_listener(
                if (bind(l.sl_sd, *sal, addrlen)) {
                        err = sock_errno();
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "slap_open_listener: bind(%ld) failed errno=%d (%s)\n",
-                          (long)l.sl_sd, err, sock_errstr(err) ));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "slap_open_listener: bind(%ld) failed errno=%d (%s)\n",
+                       (long)l.sl_sd, err, sock_errstr(err) );
 #else
                Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n",
                       (long) l.sl_sd, err, sock_errstr(err) );
@@ -793,9 +789,9 @@ static int slap_open_listener(
                if ( chmod( addr, perms ) < 0 && crit ) {
                        int err = sock_errno();
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                  "slap_open_listener: fchmod(%ld) failed errno=%d (%s)\n",
-                                  (long)l.sl_sd, err, sock_errstr(err) ));
+                       LDAP_LOG( CONNECTION, INFO, 
+                               "slap_open_listener: fchmod(%ld) failed errno=%d (%s)\n",
+                               (long)l.sl_sd, err, sock_errstr(err) );
 #else
                        Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed errno=%d (%s)",
                               (long) l.sl_sd, err, sock_errstr(err) );
@@ -838,9 +834,9 @@ static int slap_open_listener(
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "slap_open_listener: unsupported address family (%d)\n",
-                          (int)(*sal)->sa_family ));
+               LDAP_LOG( CONNECTION, INFO, 
+                       "slap_open_listener: unsupported address family (%d)\n",
+                       (int)(*sal)->sa_family, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "daemon: unsupported address family (%d)\n",
                        (int) (*sal)->sa_family, 0, 0 );
@@ -862,8 +858,8 @@ static int slap_open_listener(
 
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS,
-                  "slap_open_listener: daemon initialized %s\n", l.sl_url ));
+       LDAP_LOG( CONNECTION, RESULTS, 
+                       "slap_open_listener: daemon initialzed %s\n", l.sl_url, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n",
                l.sl_url, 0, 0 );
@@ -880,9 +876,8 @@ int slapd_daemon_init( const char *urls )
        char **u;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_ARGS,
-                  "slapd_daemon_init: %s\n",
-                  urls ? urls : "<null>" ));
+       LDAP_LOG( CONNECTION, ARGS, 
+               "slapd_daemon_init: %s\n", urls ? urls : "<null>", 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "daemon_init: %s\n",
                urls ? urls : "<null>", 0, 0 );
@@ -912,8 +907,8 @@ int slapd_daemon_init( const char *urls )
         */
        if( (rc = lutil_pair( wake_sds )) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "slap_daemon_init: lutil_pair() failed rc=%d\n", rc ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "slap_daemon_init: lutil_pair() failed rc=%d\n", rc, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                        "daemon: lutil_pair() failed rc=%d\n", rc, 0, 0 );
@@ -932,8 +927,8 @@ int slapd_daemon_init( const char *urls )
 
        if( u == NULL || u[0] == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                          "slap_daemon_init: no urls (%s) provided.\n", urls ));
+               LDAP_LOG( CONNECTION, ERR, 
+                       "slap_daemon_init: no urls (%s) provided.\n", urls, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "daemon_init: no urls (%s) provided.\n",
                        urls, 0, 0 );
@@ -943,8 +938,8 @@ int slapd_daemon_init( const char *urls )
 
        for( i=0; u[i] != NULL; i++ ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                          "slap_daemon_init: listen on %s\n.", u[i] ));
+               LDAP_LOG( CONNECTION, DETAIL1, 
+                       "slap_daemon_init: listen on %s\n.", u[i], 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "daemon_init: listen on %s\n",
                        u[i], 0, 0 );
@@ -953,8 +948,8 @@ int slapd_daemon_init( const char *urls )
 
        if( i == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                          "slap_daemon_init: no listeners to open (%s)\n", urls ));
+               LDAP_LOG( CONNECTION, INFO, 
+                        "slap_daemon_init: no listeners to open (%s)\n", urls, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n",
                        urls, 0, 0 );
@@ -964,8 +959,8 @@ int slapd_daemon_init( const char *urls )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                  "slap_daemon_init: %d listeners to open...\n", i ));
+       LDAP_LOG( CONNECTION, INFO, 
+               "slap_daemon_init: %d listeners to open...\n", i, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners to open...\n",
                i, 0, 0 );
@@ -981,8 +976,8 @@ int slapd_daemon_init( const char *urls )
        slap_listeners[j] = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                  "slap_daemon_init: %d listeners opened\n", i ));
+       LDAP_LOG( CONNECTION, DETAIL1, 
+               "slap_daemon_init: %d listeners opened\n", i, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n",
                i, 0, 0 );
@@ -1096,8 +1091,8 @@ slapd_daemon_task(
                                        if ( i < l ) {
                                                /* We are already listening to in6addr_any */
 #ifdef NEW_LOGGING
-                                               LDAP_LOG(( "connection", LDAP_LEVEL_WARNING,
-                                                          "slapd_daemon_task: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n" ));
+                                               LDAP_LOG(CONNECTION, WARNING,
+                                                          "slapd_daemon_task: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n", 0, 0, 0 );
 #else
                                                Debug( LDAP_DEBUG_CONNS,
                                                       "daemon: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n",
@@ -1111,9 +1106,9 @@ slapd_daemon_task(
                        }
 #endif                         
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                  "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n",
-                                  slap_listeners[l]->sl_url, err, sock_errstr(err) ));
+                       LDAP_LOG( CONNECTION, ERR, 
+                               "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n",
+                               slap_listeners[l]->sl_url, err, sock_errstr(err) );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "daemon: listen(%s, 5) failed errno=%d (%s)\n",
@@ -1240,9 +1235,10 @@ slapd_daemon_task(
                                continue;
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                                  "slapd_daemon_task: select: listen=%d active_threads=%d tvp=%s\n",
-                                  slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" ));
+                       LDAP_LOG( CONNECTION, DETAIL1, 
+                               "slapd_daemon_task: select: listen=%d "
+                               "active_threads=%d tvp=%s\n",
+                               slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" );
 #else
                        Debug( LDAP_DEBUG_CONNS,
                                "daemon: select: listen=%d active_threads=%d tvp=%s\n",
@@ -1275,9 +1271,9 @@ slapd_daemon_task(
 
                                if( err != EINTR ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                                  "slapd_daemon_task: select failed (%d): %s\n",
-                                                  err, sock_errstr(err) ));
+                                       LDAP_LOG( CONNECTION, INFO, 
+                                               "slapd_daemon_task: select failed (%d): %s\n",
+                                               err, sock_errstr(err), 0 );
 #else
                                        Debug( LDAP_DEBUG_CONNS,
                                                "daemon: select failed (%d): %s\n",
@@ -1291,8 +1287,8 @@ slapd_daemon_task(
                case 0:         /* timeout - let threads run */
                        ebadf = 0;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  "slapd_daemon_task: select timeout - yielding\n" ));
+                       LDAP_LOG( CONNECTION, DETAIL2,
+                                  "slapd_daemon_task: select timeout - yielding\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n",
                            0, 0, 0 );
@@ -1305,8 +1301,8 @@ slapd_daemon_task(
 
                        ebadf = 0;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  "slapd_daemon_task: activity on %d descriptors\n", ns ));
+                       LDAP_LOG( CONNECTION, DETAIL2, 
+                                  "slapd_daemon_task: activity on %d descriptors\n", ns, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n",
                                ns, 0, 0 );
@@ -1389,9 +1385,10 @@ slapd_daemon_task(
 
                                if( emfile < 3 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
+                                       LDAP_LOG( CONNECTION, ERR, 
                                                "slapd_daemon_task: accept(%ld) failed errno=%d (%s)\n",
-                                               (long)slap_listeners[l]->sl_sd, err, sock_errstr(err) ));
+                                               (long)slap_listeners[l]->sl_sd, 
+                                               err, sock_errstr(err) );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                            "daemon: accept(%ld) failed errno=%d (%s)\n",
@@ -1416,9 +1413,9 @@ slapd_daemon_task(
                        /* make sure descriptor number isn't too great */
                        if ( s >= dtblsize ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
+                               LDAP_LOG( CONNECTION, ERR, 
                                   "slapd_daemon_task: %ld beyond descriptor table size %ld\n",
-                                  (long)s, (long)dtblsize ));
+                                  (long)s, (long)dtblsize, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "daemon: %ld beyond descriptor table size %ld\n",
@@ -1458,9 +1455,10 @@ slapd_daemon_task(
                                if ( rc == AC_SOCKET_ERROR ) {
                                        int err = sock_errno();
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                                  "slapd_daemon_task: setsockopt( %ld, SO_KEEPALIVE) failed errno=%d (%s)\n",
-                                                  (long)s, err, sock_errstr(err) ));
+                                       LDAP_LOG( CONNECTION, ERR, 
+                                               "slapd_daemon_task: setsockopt( %ld, SO_KEEPALIVE)"
+                                          " failed errno=%d (%s)\n",
+                                               (long)s, err, sock_errstr(err) );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "slapd(%ld): setsockopt(SO_KEEPALIVE) failed "
@@ -1476,9 +1474,10 @@ slapd_daemon_task(
                                if ( rc == AC_SOCKET_ERROR ) {
                                        int err = sock_errno();
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                                  "slapd_daemon_task: setsockopt( %ld, TCP_NODELAY) failed errno=%d (%s)\n",
-                                                  (long)s, err, sock_errstr(err) ));
+                                       LDAP_LOG( CONNECTION, ERR, 
+                                               "slapd_daemon_task: setsockopt( %ld, "
+                                               "TCP_NODELAY) failed errno=%d (%s)\n",
+                                               (long)s, err, sock_errstr(err) );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "slapd(%ld): setsockopt(TCP_NODELAY) failed "
@@ -1490,8 +1489,8 @@ slapd_daemon_task(
 #endif
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
-                                  "slapd_daemon_task: new connection on %ld\n", (long)s ));
+                       LDAP_LOG( CONNECTION, DETAIL1, 
+                               "slapd_daemon_task: new connection on %ld\n", (long)s, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n",
                                (long) s, 0, 0 );
@@ -1599,9 +1598,9 @@ slapd_daemon_task(
 
                        if( id < 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
-                                          "slapd_daemon_task: connection_init(%ld, %s, %s) failed.\n",
-                                          (long)s, peername, slap_listeners[l]->sl_name ));
+                               LDAP_LOG( CONNECTION, INFO, 
+                                       "slapd_daemon_task: connection_init(%ld, %s, %s) failed.\n",
+                                       (long)s, peername, slap_listeners[l]->sl_name );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "daemon: connection_init(%ld, %s, %s) failed.\n",
@@ -1626,16 +1625,16 @@ slapd_daemon_task(
 
 #ifdef LDAP_DEBUG
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                          "slapd_daemon_task: activity on " ));
+               LDAP_LOG( CONNECTION, DETAIL2,
+                          "slapd_daemon_task: activity on ", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_CONNS, "daemon: activity on:", 0, 0, 0 );
 #endif
 #ifdef HAVE_WINSOCK
                for ( i = 0; i < readfds.fd_count; i++ ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  " %d%s", readfds.fd_array[i], "r", 0 ));
+                       LDAP_LOG( CONNECTION, DETAIL2, 
+                               " %d%s", readfds.fd_array[i], "r", 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS, " %d%s",
                                readfds.fd_array[i], "r", 0 );
@@ -1643,8 +1642,8 @@ slapd_daemon_task(
                }
                for ( i = 0; i < writefds.fd_count; i++ ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  " %d%s", writefds.fd_array[i], "w" ));
+                       LDAP_LOG( CONNECTION, DETAIL2, 
+                               " %d%s", writefds.fd_array[i], "w" , 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS, " %d%s",
                                writefds.fd_array[i], "w", 0 );
@@ -1676,9 +1675,8 @@ slapd_daemon_task(
                        w = FD_ISSET( i, &writefds );
                        if ( r || w ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                          " %d%s%s", i,
-                                          r ? "r" : "", w ? "w" : "" ));
+                               LDAP_LOG( CONNECTION, DETAIL2, 
+                                       " %d%s%s", i, r ? "r" : "", w ? "w" : "" );
 #else
                                Debug( LDAP_DEBUG_CONNS, " %d%s%s", i,
                                    r ? "r" : "", w ? "w" : "" );
@@ -1687,7 +1685,7 @@ slapd_daemon_task(
                }
 #endif
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, "\n" ));
+               LDAP_LOG( CONNECTION, DETAIL2, "\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
 #endif
@@ -1726,8 +1724,8 @@ slapd_daemon_task(
                                continue;
                        }
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  "slapd_daemon_task: write active on %d\n", wd ));
+                       LDAP_LOG( CONNECTION, DETAIL2, 
+                               "slapd_daemon_task: write active on %d\n", wd, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_CONNS,
                                "daemon: write active on %d\n",
@@ -1779,8 +1777,8 @@ slapd_daemon_task(
                        }
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2,
-                                  "slapd_daemon_task: read activity on %d\n", rd ));
+                       LDAP_LOG( CONNECTION, DETAIL2, 
+                               "slapd_daemon_task: read activity on %d\n", rd, 0, 0 );
 #else
                        Debug ( LDAP_DEBUG_CONNS,
                                "daemon: read activity on %d\n", rd, 0, 0 );
@@ -1801,8 +1799,8 @@ slapd_daemon_task(
 
        if( slapd_shutdown == 1 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                          "slapd_daemon_task: shutdown requested and initiated.\n"));
+               LDAP_LOG( CONNECTION, CRIT,
+                  "slapd_daemon_task: shutdown requested and initiated.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "daemon: shutdown requested and initiated.\n",
@@ -1812,8 +1810,9 @@ slapd_daemon_task(
        } else if ( slapd_shutdown == 2 ) {
 #ifdef HAVE_NT_SERVICE_MANAGER
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                                  "slapd_daemon_task: shutdown initiated by Service Manager.\n"));
+                       LDAP_LOG( CONNECTION, CRIT,
+                          "slapd_daemon_task: shutdown initiated by Service Manager.\n",
+                          0, 0, 0);
 #else
                        Debug( LDAP_DEBUG_TRACE,
                               "daemon: shutdown initiated by Service Manager.\n",
@@ -1821,8 +1820,9 @@ slapd_daemon_task(
 #endif
 #else /* !HAVE_NT_SERVICE_MANAGER */
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                                  "slapd_daemon_task: abnormal condition, shutdown initiated.\n" ));
+                       LDAP_LOG( CONNECTION, CRIT,
+                          "slapd_daemon_task: abnormal condition, "
+                          "shutdown initiated.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                               "daemon: abnormal condition, shutdown initiated.\n",
@@ -1831,8 +1831,9 @@ slapd_daemon_task(
 #endif /* !HAVE_NT_SERVICE_MANAGER */
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                          "slapd_daemon_task: no active streams, shutdown initiated.\n" ));
+               LDAP_LOG( CONNECTION, CRIT,
+                  "slapd_daemon_task: no active streams, shutdown initiated.\n", 
+                  0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                       "daemon: no active streams, shutdown initiated.\n",
@@ -1846,9 +1847,9 @@ slapd_daemon_task(
        slap_listeners = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                  "slapd_daemon_task: shutdown waiting for %d threads to terminate.\n",
-                  ldap_pvt_thread_pool_backload(&connection_pool) ));
+       LDAP_LOG( CONNECTION, CRIT, 
+               "slapd_daemon_task: shutdown waiting for %d threads to terminate.\n",
+               ldap_pvt_thread_pool_backload(&connection_pool), 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
            "slapd shutdown: waiting for %d threads to terminate\n",
@@ -1877,8 +1878,9 @@ int slapd_daemon( void )
 
                if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
-                                  "slapd_daemon: listener ldap_pvt_thread_create failed (%d).\n", rc ));
+                       LDAP_LOG( CONNECTION, ERR, 
+                               "slapd_daemon: listener ldap_pvt_thread_create failed (%d).\n",
+                               rc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                        "listener ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
@@ -1951,8 +1953,8 @@ RETSIGTYPE
 slap_sig_shutdown( int sig )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                  "slap_sig_shutdown: signal %d\n", sig ));
+       LDAP_LOG( CONNECTION, CRIT, 
+               "slap_sig_shutdown: signal %d\n", sig, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig, 0, 0);
 #endif
@@ -1966,8 +1968,8 @@ slap_sig_shutdown( int sig )
 #if HAVE_NT_SERVICE_MANAGER && SIGBREAK
        if (is_NT_Service && sig == SIGBREAK)
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
-                      "slap_sig_shutdown: SIGBREAK ignored.\n" ));
+           LDAP_LOG( CONNECTION, CRIT,
+                   "slap_sig_shutdown: SIGBREAK ignored.\n", 0, 0, 0 );
 #else
            Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: SIGBREAK ignored.\n",
                  0, 0, 0);
index 37a59aa1ea542ccd2390a3a9c5ce4e1c9bda94a3..89e405c43f0ef76a7321b08e369550b93fba2d22 100644 (file)
@@ -40,8 +40,8 @@ do_delete(
        int manageDSAit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_delete: conn %d\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "do_delete: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );
 #endif
@@ -54,8 +54,8 @@ do_delete(
 
        if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_delete: conn: %d  ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_delete: conn: %d  ber_scanf failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -66,8 +66,8 @@ do_delete(
 
        if( ( rc = get_ctrls( conn, op, 1 ) ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_delete: conn %d  get_ctrls failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_delete: conn %d  get_ctrls failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_delete: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -77,9 +77,9 @@ do_delete(
        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_delete: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, dn.bv_val ));
+                       conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 );
@@ -91,8 +91,9 @@ do_delete(
 
        if( ndn.bv_len == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: "
-                       "Attempt to delete root DSE.\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "do_delete: conn %d: Attempt to delete root DSE.\n", 
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_delete: root dse!\n", 0, 0, 0 );
 #endif
@@ -105,8 +106,8 @@ do_delete(
 
        } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: "
-                       "Attempt to delete subschema subentry.\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, INFO, "do_delete: conn %d: "
+                       "Attempt to delete subschema subentry.\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_delete: subschema subentry!\n", 0, 0, 0 );
 #endif
index 75a349b4333dfecf05e838aad623154e6e47c670..346817765b670f6c33620a06337d7579ec0852ad 100644 (file)
@@ -439,7 +439,11 @@ dnPretty2(
        assert( val );
        assert( out );
 
+#ifdef NEW_LOGGING
+       LDAP_LOG( OPERATION, ARGS, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
+#endif
 
        if ( val->bv_len == 0 ) {
                ber_dupbv( out, val );
@@ -496,7 +500,11 @@ dnPrettyNormal(
        struct berval *pretty,
        struct berval *normal)
 {
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 );
+#endif
 
        assert( val );
        assert( pretty );
@@ -562,8 +570,13 @@ dnPrettyNormal(
                }
        }
 
+#ifdef NEW_LOGGING
+       LDAP_LOG (OPERATION, RESULTS, "<<< dnPrettyNormal: <%s>, <%s>\n",
+               pretty->bv_val, normal->bv_val, 0  );
+#else
        Debug( LDAP_DEBUG_TRACE, "<<< dnPrettyNormal: <%s>, <%s>\n",
                pretty->bv_val, normal->bv_val, 0 );
+#endif
 
        return LDAP_SUCCESS;
 }
@@ -595,9 +608,8 @@ dnMatch(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-               "dnMatch: %d\n    %s\n    %s\n", match,
-               value->bv_val, asserted->bv_val ));
+       LDAP_LOG( CONFIG, ENTRY, "dnMatch: %d\n    %s\n    %s\n", 
+               match, value->bv_val, asserted->bv_val  );
 #else
        Debug( LDAP_DEBUG_ARGS, "dnMatch %d\n\t\"%s\"\n\t\"%s\"\n",
                match, value->bv_val, asserted->bv_val );
index f5829d395af02a3555138d88234b8df301b6e68e..98f5842f8a45e66f9544ee3430d512900406c6dd 100644 (file)
@@ -63,8 +63,7 @@ str2entry( char *s )
         */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-               "str2entry: \"%s\"\n", s ? s : "NULL" ));
+       LDAP_LOG( OPERATION, DETAIL1, "str2entry: \"%s\"\n", s ? s : "NULL", 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> str2entry\n",
                s ? s : "NULL", 0, 0 );
@@ -75,8 +74,7 @@ str2entry( char *s )
 
        if( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "str2entry: entry allocation failed.\n" ));
+               LDAP_LOG( OPERATION, ERR, "str2entry: entry allocation failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "<= str2entry NULL (entry allocation failed)\n",
@@ -99,8 +97,7 @@ str2entry( char *s )
 
                if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                                  "str2entry:  NULL (parse_line)\n" ));
+                       LDAP_LOG( OPERATION, DETAIL1, "str2entry:  NULL (parse_line)\n",0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                            "<= str2entry NULL (parse_line)\n", 0, 0, 0 );
@@ -113,10 +110,10 @@ str2entry( char *s )
 
                        if ( e->e_dn != NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
+                               LDAP_LOG( OPERATION, DETAIL1, "str2entry: "
                                        "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
                                        (long) e->e_id, e->e_dn,
-                                       vals[0].bv_val != NULL ? vals[0].bv_val : "" ));
+                                       vals[0].bv_val != NULL ? vals[0].bv_val : ""  );
 #else
                                Debug( LDAP_DEBUG_ANY, "str2entry: "
                                        "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
@@ -131,9 +128,9 @@ str2entry( char *s )
                        rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
-                                       "entry %ld has invalid DN \"%s\"\n",
-                                       (long) e->e_id, vals[0].bv_val ));
+                               LDAP_LOG( OPERATION, DETAIL1, 
+                                       "str2entry: entry %ld has invalid DN \"%s\"\n",
+                                       (long) e->e_id, vals[0].bv_val, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY, "str2entry: "
                                        "entry %ld has invalid DN \"%s\"\n",
@@ -152,8 +149,8 @@ str2entry( char *s )
 
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                               "str2entry:  str2ad(%s): %s\n", type, text ));
+                       LDAP_LOG( OPERATION, DETAIL1, 
+                               "str2entry:  str2ad(%s): %s\n", type, text, 0 );
 #else
                        Debug( slapMode & SLAP_TOOL_MODE
                                ? LDAP_DEBUG_ANY : LDAP_DEBUG_TRACE,
@@ -169,8 +166,8 @@ str2entry( char *s )
                        rc = slap_str2undef_ad( type, &ad, &text );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                                       "str2entry:  str2undef_ad(%s): %s\n", type, text ));
+                               LDAP_LOG( OPERATION, DETAIL1, 
+                                       "str2entry: str2undef_ad(%s): %s\n", type, text, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "<= str2entry: str2undef_ad(%s): %s\n",
@@ -202,9 +199,9 @@ str2entry( char *s )
 
                        } else {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                               LDAP_LOG( OPERATION, INFO, 
                                        "str2entry: no validator for syntax %s\n", 
-                                       ad->ad_type->sat_syntax->ssyn_oid ));
+                                       ad->ad_type->sat_syntax->ssyn_oid, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "str2entry: no validator for syntax %s\n",
@@ -218,9 +215,9 @@ str2entry( char *s )
 
                        if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                               LDAP_LOG( OPERATION, ERR, 
                                        "str2entry:  invalid value for syntax %s\n",
-                                       ad->ad_type->sat_syntax->ssyn_oid ));
+                                       ad->ad_type->sat_syntax->ssyn_oid, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "str2entry: invalid value for syntax %s\n",
@@ -241,8 +238,8 @@ str2entry( char *s )
                rc = attr_merge( e, ad, vals );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                               "str2entry:  NULL (attr_merge)\n" ));
+                       LDAP_LOG( OPERATION, DETAIL1,
+                               "str2entry:  NULL (attr_merge)\n" , 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "<= str2entry NULL (attr_merge)\n", 0, 0, 0 );
@@ -260,9 +257,8 @@ str2entry( char *s )
        /* check to make sure there was a dn: line */
        if ( e->e_dn == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "str2entry:  entry %ld has no dn.\n",
-                       (long) e->e_id ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "str2entry:  entry %ld has no dn.\n", (long) e->e_id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
                    (long) e->e_id, 0, 0 );
@@ -272,8 +268,8 @@ str2entry( char *s )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL2,
-               "str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long)e ));
+       LDAP_LOG( OPERATION, DETAIL2,
+               "str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long)e, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "<= str2entry(%s) -> 0x%lx\n",
                e->e_dn, (unsigned long) e, 0 );
@@ -477,9 +473,8 @@ int entry_encode(Entry *e, struct berval *bv)
        unsigned char *ptr;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-               "entry_encode: id: 0x%08lx  \"%s\"\n",
-               (long) e->e_id, e->e_dn ));
+       LDAP_LOG( OPERATION, DETAIL1, "entry_encode: id: 0x%08lx  \"%s\"\n",
+               (long) e->e_id, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> entry_encode(0x%08lx): %s\n",
                (long) e->e_id, e->e_dn, 0 );
@@ -572,8 +567,7 @@ int entry_decode(struct berval *bv, Entry **e)
        x->e_nname.bv_len = i;
        ptr += i+1;
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL2,
-               "entry_decode: \"%s\"\n", x->e_dn ));
+       LDAP_LOG( OPERATION, DETAIL2, "entry_decode: \"%s\"\n", x->e_dn, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
            "entry_decode: \"%s\"\n",
@@ -601,8 +595,8 @@ int entry_decode(struct berval *bv, Entry **e)
 
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                               "entry_decode: str2ad(%s): %s\n", ptr, text ));
+                       LDAP_LOG( OPERATION, INFO, 
+                               "entry_decode: str2ad(%s): %s\n", ptr, text, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "<= entry_decode: str2ad(%s): %s\n", ptr, text, 0 );
@@ -611,8 +605,8 @@ int entry_decode(struct berval *bv, Entry **e)
 
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                       "entry_decode:  str2undef_ad(%s): %s\n", ptr, text));
+                               LDAP_LOG( OPERATION, INFO, 
+                                       "entry_decode:  str2undef_ad(%s): %s\n", ptr, text, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "<= entry_decode: str2undef_ad(%s): %s\n",
@@ -643,8 +637,7 @@ int entry_decode(struct berval *bv, Entry **e)
        if (a)
                a->a_next = NULL;
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-               "entry_decode:  %s\n", x->e_dn ));
+       LDAP_LOG( OPERATION, DETAIL1, "entry_decode:  %s\n", x->e_dn, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "<= entry_decode(%s)\n",
                x->e_dn, 0, 0 );
index 63f46bd2b23bc2bc097e3e50ac9b20b92fb34e0a..2d315f36ce1a5b12dbb01bc6952ecf4afb1bed53 100644 (file)
@@ -103,17 +103,15 @@ do_extended(
        LDAPControl **rspctrls;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_extended: conn %d\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "do_extended: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 );
 #endif
 
        if( op->o_protocol < LDAP_VERSION3 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_extended: protocol version (%d) too low.\n",
-                       op->o_protocol ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_extended: protocol version (%d) too low.\n", op->o_protocol, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_extended: protocol version (%d) too low\n",
@@ -127,8 +125,8 @@ do_extended(
 
        if ( ber_scanf( op->o_ber, "{m" /*}*/, &reqoid ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_extended: conn %d  ber_scanf failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, "do_extended: conn %d  ber_scanf failed\n", 
+                       conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 );
 #endif
@@ -140,9 +138,9 @@ do_extended(
 
        if( !(ext = find_extop(supp_ext_list, &reqoid)) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+               LDAP_LOG( OPERATION, ERR, 
                        "do_extended: conn %d  unsupported operation \"%s\"\n",
-                       conn->c_connid, reqoid.bv_val ));
+                       conn->c_connid, reqoid.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n",
                        reqoid.bv_val, 0 ,0 );
@@ -157,8 +155,9 @@ do_extended(
        if( ber_peek_tag( op->o_ber, &len ) == LDAP_TAG_EXOP_REQ_VALUE ) {
                if( ber_scanf( op->o_ber, "m", &reqdata ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "do_extended: conn %d  ber_scanf failed\n", conn->c_connid ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "do_extended: conn %d  ber_scanf failed\n", 
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 );
 #endif
@@ -171,8 +170,8 @@ do_extended(
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_extended: conn %d  get_ctrls failed\n", conn->c_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_extended: conn %d  get_ctrls failed\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_extended: get_ctrls failed\n", 0, 0 ,0 );
 #endif
@@ -189,8 +188,8 @@ do_extended(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-               "do_extended: conn %d  oid=%d\n.", conn->c_connid, reqoid.bv_val ));
+       LDAP_LOG( OPERATION, DETAIL1, 
+               "do_extended: conn %d  oid=%d\n.", conn->c_connid, reqoid.bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", reqoid.bv_val, 0 ,0 );
 #endif
index e4905493a6b44d6f68c5ba2cc6c2ea8f66b7e1f6..69a26bf34bd30a3fe0fed81e8f50b53c701b903a 100644 (file)
@@ -54,8 +54,7 @@ get_filter(
        Filter          *f;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "get_filter: conn %d\n",
-               conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, "get_filter: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_filter\n", 0, 0, 0 );
 #endif
@@ -108,8 +107,8 @@ get_filter(
        switch ( f->f_choice ) {
        case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2,
-                       "get_filter: conn %d  EQUALITY\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL2, 
+                       "get_filter: conn %d  EQUALITY\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
 #endif
@@ -123,8 +122,8 @@ get_filter(
 
        case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  SUBSTRINGS\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  SUBSTRINGS\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -133,8 +132,8 @@ get_filter(
 
        case LDAP_FILTER_GE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  GE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  GE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 );
 #endif
@@ -146,8 +145,8 @@ get_filter(
 
        case LDAP_FILTER_LE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  LE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  LE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 );
 #endif
@@ -161,8 +160,8 @@ get_filter(
                struct berval type;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d PRESENT\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d PRESENT\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
 #endif
@@ -186,8 +185,8 @@ get_filter(
 
        case LDAP_FILTER_APPROX:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  APPROX\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  APPROX\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 );
 #endif
@@ -199,8 +198,8 @@ get_filter(
 
        case LDAP_FILTER_AND:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  AND\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  AND\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 );
 #endif
@@ -212,8 +211,8 @@ get_filter(
 
        case LDAP_FILTER_OR:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  OR\n", conn->c_connid  ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  OR\n", conn->c_connid, 0, 0  );
 #else
                Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 );
 #endif
@@ -225,8 +224,8 @@ get_filter(
 
        case LDAP_FILTER_NOT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  NOT\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  NOT\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 );
 #endif
@@ -239,8 +238,8 @@ get_filter(
 
        case LDAP_FILTER_EXT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_filter: conn %d  EXTENSIBLE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_filter: conn %d  EXTENSIBLE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 );
 #endif
@@ -256,9 +255,9 @@ get_filter(
        default:
                (void) ber_scanf( ber, "x" ); /* skip the element */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                        "get_filter: conn %d unknown filter type=%lu\n",
-                       conn->c_connid, f->f_choice ));
+                       conn->c_connid, f->f_choice, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "get_filter: unknown filter type=%lu\n",
                        f->f_choice, 0, 0 );
@@ -285,8 +284,8 @@ get_filter(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2,
-               "get_filter: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, DETAIL2, 
+               "get_filter: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 );
 #endif
@@ -305,8 +304,8 @@ get_filter_list( Connection *conn, BerElement *ber,
        char            *last;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_filter_list: conn %d start\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_filter_list: conn %d start\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );
 #endif
@@ -322,8 +321,8 @@ get_filter_list( Connection *conn, BerElement *ber,
        *new = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_filter_list: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_filter_list: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_filter_list\n", 0, 0, 0 );
 #endif
@@ -346,8 +345,8 @@ get_substring_filter(
        *text = "error decoding filter";
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_substring_filter: conn %d  begin\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_substring_filter: conn %d  begin\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
 #endif
@@ -404,9 +403,9 @@ get_substring_filter(
                        rc = LDAP_PROTOCOL_ERROR;
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+                       LDAP_LOG( FILTER, ERR,
                                "get_filter_substring: conn %d  unknown substring choice=%ld\n",
-                               conn->c_connid, (long)tag ));
+                               conn->c_connid, (long)tag, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER,
                                "  unknown substring choice=%ld\n",
@@ -435,9 +434,8 @@ get_substring_filter(
                switch ( tag ) {
                case LDAP_SUBSTRING_INITIAL:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  INITIAL\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1,
+                               "get_substring_filter: conn %d  INITIAL\n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  INITIAL\n", 0, 0, 0 );
 #endif
@@ -455,9 +453,8 @@ get_substring_filter(
 
                case LDAP_SUBSTRING_ANY:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  ANY\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1,
+                               "get_substring_filter: conn %d  ANY\n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  ANY\n", 0, 0, 0 );
 #endif
@@ -472,9 +469,8 @@ get_substring_filter(
 
                case LDAP_SUBSTRING_FINAL:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  FINAL\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1, 
+                               "get_substring_filter: conn %d  FINAL\n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  FINAL\n", 0, 0, 0 );
 #endif
@@ -489,9 +485,9 @@ get_substring_filter(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+                       LDAP_LOG( FILTER, INFO, 
                                "get_substring_filter: conn %d  unknown substring type %ld\n",
-                               conn->c_connid, (long)tag ));
+                               conn->c_connid, (long)tag, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER,
                                "  unknown substring type=%ld\n",
@@ -502,9 +498,9 @@ get_substring_filter(
 
 return_error:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+                       LDAP_LOG( FILTER, INFO, 
                                "get_substring_filter: conn %d  error %ld\n",
-                               conn->c_connid, (long)rc ));
+                               conn->c_connid, (long)rc, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  error=%ld\n",
                                (long) rc, 0, 0 );
@@ -518,8 +514,8 @@ return_error:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_substring_filter: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_substring_filter: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_substring_filter\n", 0, 0, 0 );
 #endif
@@ -575,8 +571,8 @@ filter_free( Filter *f )
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                       "filter_free: unknown filter type %lu\n", f->f_choice ));
+               LDAP_LOG( FILTER, ERR, 
+                       "filter_free: unknown filter type %lu\n", f->f_choice, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n",
                        f->f_choice, 0, 0 );
@@ -821,8 +817,8 @@ get_simple_vrFilter(
        ValuesReturnFilter *f;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "get_simple_vrFilter: conn %d\n",
-               conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_simple_vrFilter: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_simple_vrFilter\n", 0, 0, 0 );
 #endif
@@ -843,8 +839,8 @@ get_simple_vrFilter(
        switch ( f->f_choice ) {
        case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2,
-                       "get_simple_vrFilter: conn %d  EQUALITY\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL2, 
+                       "get_simple_vrFilter: conn %d  EQUALITY\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
 #endif
@@ -858,8 +854,8 @@ get_simple_vrFilter(
 
        case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d  SUBSTRINGS\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d  SUBSTRINGS\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -868,8 +864,8 @@ get_simple_vrFilter(
 
        case LDAP_FILTER_GE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d  GE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d  GE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 );
 #endif
@@ -881,8 +877,8 @@ get_simple_vrFilter(
 
        case LDAP_FILTER_LE:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d  LE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d  LE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 );
 #endif
@@ -896,8 +892,8 @@ get_simple_vrFilter(
                struct berval type;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d PRESENT\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d PRESENT\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
 #endif
@@ -921,8 +917,8 @@ get_simple_vrFilter(
 
        case LDAP_FILTER_APPROX:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d  APPROX\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d  APPROX\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 );
 #endif
@@ -934,8 +930,8 @@ get_simple_vrFilter(
 
        case LDAP_FILTER_EXT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                       "get_simple_vrFilter: conn %d  EXTENSIBLE\n", conn->c_connid ));
+               LDAP_LOG( FILTER, DETAIL1, 
+                       "get_simple_vrFilter: conn %d  EXTENSIBLE\n", conn->c_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 );
 #endif
@@ -951,9 +947,9 @@ get_simple_vrFilter(
        default:
                (void) ber_scanf( ber, "x" ); /* skip the element */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+               LDAP_LOG( FILTER, ERR, 
                        "get_simple_vrFilter: conn %d unknown filter type=%lu\n",
-                       conn->c_connid, f->f_choice ));
+                       conn->c_connid, f->f_choice, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "get_simple_vrFilter: unknown filter type=%lu\n",
                        f->f_choice, 0, 0 );
@@ -980,8 +976,8 @@ get_simple_vrFilter(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2,
-               "get_simple_vrFilter: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, DETAIL2, 
+               "get_simple_vrFilter: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_simple_vrFilter %d\n", err, 0, 0 );
 #endif
@@ -1028,8 +1024,8 @@ get_vrFilter( Connection *conn, BerElement *ber,
        char            *last;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_vrFilter: conn %d start\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_vrFilter: conn %d start\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_vrFilter\n", 0, 0, 0 );
 #endif
@@ -1058,8 +1054,8 @@ get_vrFilter( Connection *conn, BerElement *ber,
        *new = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_vrFilter: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_vrFilter: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_vrFilter\n", 0, 0, 0 );
 #endif
@@ -1109,8 +1105,8 @@ vrFilter_free( ValuesReturnFilter *f )
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
-                               "filter_free: unknown filter type %lu\n", f->f_choice ));
+                       LDAP_LOG( FILTER, ERR, 
+                               "filter_free: unknown filter type %lu\n", f->f_choice, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n",
                                f->f_choice, 0, 0 );
@@ -1340,8 +1336,8 @@ get_substring_vrFilter(
        *text = "error decoding filter";
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_substring_filter: conn %d  begin\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_substring_filter: conn %d  begin\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
 #endif
@@ -1398,9 +1394,9 @@ get_substring_vrFilter(
                        rc = LDAP_PROTOCOL_ERROR;
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+                       LDAP_LOG( FILTER, ERR, 
                                "get_filter_substring: conn %d  unknown substring choice=%ld\n",
-                               conn->c_connid, (long)tag ));
+                               conn->c_connid, (long)tag, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER,
                                "  unknown substring choice=%ld\n",
@@ -1429,9 +1425,9 @@ get_substring_vrFilter(
                switch ( tag ) {
                case LDAP_SUBSTRING_INITIAL:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  INITIAL\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1, 
+                               "get_substring_filter: conn %d  INITIAL\n", 
+                               conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  INITIAL\n", 0, 0, 0 );
 #endif
@@ -1449,9 +1445,8 @@ get_substring_vrFilter(
 
                case LDAP_SUBSTRING_ANY:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  ANY\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1, 
+                               "get_substring_filter: conn %d  ANY\n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  ANY\n", 0, 0, 0 );
 #endif
@@ -1466,9 +1461,8 @@ get_substring_vrFilter(
 
                case LDAP_SUBSTRING_FINAL:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "get_substring_filter: conn %d  FINAL\n",
-                               conn->c_connid ));
+                       LDAP_LOG( FILTER, DETAIL1, 
+                               "get_substring_filter: conn %d  FINAL\n", conn->c_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  FINAL\n", 0, 0, 0 );
 #endif
@@ -1483,9 +1477,9 @@ get_substring_vrFilter(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+                       LDAP_LOG( FILTER, INFO, 
                                "get_substring_filter: conn %d  unknown substring type %ld\n",
-                               conn->c_connid, (long)tag ));
+                               conn->c_connid, (long)tag, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER,
                                "  unknown substring type=%ld\n",
@@ -1496,9 +1490,9 @@ get_substring_vrFilter(
 
 return_error:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
+                       LDAP_LOG( FILTER, INFO, 
                                "get_substring_filter: conn %d  error %ld\n",
-                               conn->c_connid, (long)rc ));
+                               conn->c_connid, (long)rc, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "  error=%ld\n",
                                (long) rc, 0, 0 );
@@ -1512,8 +1506,8 @@ return_error:
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "get_substring_filter: conn %d exit\n", conn->c_connid ));
+       LDAP_LOG( FILTER, ENTRY, 
+               "get_substring_filter: conn %d exit\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end get_substring_filter\n", 0, 0, 0 );
 #endif
index af513e29c565ca7035d0529a0ca3db57d1ab9c12..672915cb8cde4a6ff3db6717e74d401c4d1592bb 100644 (file)
@@ -56,8 +56,7 @@ test_filter(
        int     rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "test_filter: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> test_filter\n", 0, 0, 0 );
 #endif
@@ -66,13 +65,12 @@ test_filter(
        switch ( f->f_choice ) {
        case SLAPD_FILTER_COMPUTED:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:   COMPUTED %s (%d)\n",
-                          f->f_result == LDAP_COMPARE_FALSE ? "false" :
-                          f->f_result == LDAP_COMPARE_TRUE      ? "true"  :
-                          f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
-                          "error",
-                          f->f_result ));
+               LDAP_LOG( FILTER, DETAIL1,
+                       "test_filter:   COMPUTED %s (%d)\n",
+                       f->f_result == LDAP_COMPARE_FALSE ? "false" :
+                       f->f_result == LDAP_COMPARE_TRUE         ? "true"  :
+                       f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
+                       "error", f->f_result, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    COMPUTED %s (%d)\n",
                        f->f_result == LDAP_COMPARE_FALSE ? "false" :
@@ -86,8 +84,7 @@ test_filter(
 
        case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:   EQUALITY\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:   EQUALITY\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    EQUALITY\n", 0, 0, 0 );
 #endif
@@ -98,8 +95,7 @@ test_filter(
 
        case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter  SUBSTRINGS\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter  SUBSTRINGS\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    SUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -119,8 +115,7 @@ test_filter(
 
        case LDAP_FILTER_PRESENT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:        PRESENT\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:        PRESENT\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    PRESENT\n", 0, 0, 0 );
 #endif
@@ -130,8 +125,7 @@ test_filter(
 
        case LDAP_FILTER_APPROX:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter: APPROX\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter: APPROX\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    APPROX\n", 0, 0, 0 );
 #endif
@@ -141,8 +135,7 @@ test_filter(
 
        case LDAP_FILTER_AND:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:  AND\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:  AND\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    AND\n", 0, 0, 0 );
 #endif
@@ -152,8 +145,7 @@ test_filter(
 
        case LDAP_FILTER_OR:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:        OR\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:        OR\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    OR\n", 0, 0, 0 );
 #endif
@@ -163,8 +155,7 @@ test_filter(
 
        case LDAP_FILTER_NOT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:        NOT\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:        NOT\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    NOT\n", 0, 0, 0 );
 #endif
@@ -186,8 +177,7 @@ test_filter(
 
        case LDAP_FILTER_EXT:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                          "test_filter:        EXT\n" ));
+               LDAP_LOG( FILTER, DETAIL1, "test_filter:        EXT\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_FILTER, "    EXT\n", 0, 0, 0 );
 #endif
@@ -197,9 +187,8 @@ test_filter(
 
        default:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                          "test_filter:  unknown filter type %lu\n", 
-                      f->f_choice ));
+               LDAP_LOG( FILTER, INFO, 
+                       "test_filter:  unknown filter type %lu\n", f->f_choice, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "    unknown filter type %lu\n",
                    f->f_choice, 0, 0 );
@@ -209,8 +198,7 @@ test_filter(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter:  return=%d\n", rc ));
+       LDAP_LOG( FILTER, RESULTS, "test_filter:  return=%d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "<= test_filter %d\n", rc, 0, 0 );
 #endif
@@ -382,8 +370,7 @@ test_filter_and(
        int rtn = LDAP_COMPARE_TRUE; /* True if empty */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter_and: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "test_filter_and: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> test_filter_and\n", 0, 0, 0 );
 #endif
@@ -405,8 +392,7 @@ test_filter_and(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter_and:  rc=%d\n", rtn ));
+       LDAP_LOG( FILTER, RESULTS, "test_filter_and:  rc=%d\n", rtn, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "<= test_filter_and %d\n", rtn, 0, 0 );
 #endif
@@ -427,8 +413,7 @@ test_filter_or(
        int rtn = LDAP_COMPARE_FALSE; /* False if empty */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter_or: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "test_filter_or: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> test_filter_or\n", 0, 0, 0 );
 #endif
@@ -450,8 +435,7 @@ test_filter_or(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_filter_or: result=%d\n", rtn ));
+       LDAP_LOG( FILTER, ENTRY, "test_filter_or: result=%d\n", rtn, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "<= test_filter_or %d\n", rtn, 0, 0 );
 #endif
@@ -472,8 +456,7 @@ test_substrings_filter(
        Attribute       *a;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_substrings_filter: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "begin test_substrings_filter\n", 0, 0, 0 );
 #endif
@@ -516,8 +499,7 @@ test_substrings_filter(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-                  "test_substrings_filter: return FALSE\n" ));
+       LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: return FALSE\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "end test_substrings_filter 1\n", 0, 0, 0 );
 #endif
index c96040e39238a078aa15826e4bc684b6a4e67ec3..b860b3f673bdce6e7935f3aadc39a00100d44873 100644 (file)
@@ -75,9 +75,9 @@ slap_init( int mode, const char *name )
 
        if( slapMode != SLAP_UNDEFINED_MODE ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "init: %s init called twice (old=%d, new=%d)\n",
-                          name, slapMode, mode ));
+               LDAP_LOG( OPERATION, CRIT, 
+                       "init: %s init called twice (old=%d, new=%d)\n",
+                       name, slapMode, mode );
 #else
                Debug( LDAP_DEBUG_ANY,
                 "%s init: init called twice (old=%d, new=%d)\n",
@@ -93,9 +93,10 @@ slap_init( int mode, const char *name )
                case SLAP_SERVER_MODE:
                case SLAP_TOOL_MODE:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                                  "init: %s initiation, initiated %s.\n",
-                                  name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ? "tool" : "server" ));
+                       LDAP_LOG( OPERATION, DETAIL1, 
+                               "init: %s initiation, initiated %s.\n",
+                               name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ? 
+                                 "tool" : "server", 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "%s init: initiated %s.\n",     name,
@@ -139,8 +140,8 @@ slap_init( int mode, const char *name )
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "init: %s init, undefined mode (%d).\n", name, mode ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "init: %s init, undefined mode (%d).\n", name, mode, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "%s init: undefined mode (%d).\n", name, mode, 0 );
@@ -158,8 +159,7 @@ int slap_startup( Backend *be )
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                  "slap_startup: %s started\n", slap_name ));
+       LDAP_LOG( OPERATION, CRIT, "slap_startup: %s started\n", slap_name, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "%s startup: initiated.\n",
@@ -177,8 +177,8 @@ int slap_shutdown( Backend *be )
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                  "slap_shutdown: %s shutdown initiated.\n", slap_name));
+       LDAP_LOG( OPERATION, CRIT, 
+               "slap_shutdown: %s shutdown initiated.\n", slap_name, 0, 0);
 #else
        Debug( LDAP_DEBUG_TRACE,
                "%s shutdown: initiated\n",
@@ -199,9 +199,8 @@ int slap_destroy(void)
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                  "slap_destroy: %s freeing system resources.\n",
-                  slap_name ));
+       LDAP_LOG( OPERATION, INFO, 
+               "slap_destroy: %s freeing system resources.\n", slap_name, 0, 0);
 #else
        Debug( LDAP_DEBUG_TRACE,
                "%s shutdown: freeing system resources.\n",
index c33726e71190b011a143de2f8a8eb210618142a3..c34e84882164cf464ffff65fed2ba270e8f16627 100644 (file)
@@ -223,10 +223,9 @@ parse_limits(
 
        if ( argc < 3 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+               LDAP_LOG( CONFIG, CRIT, 
                        "%s : line %d: missing arg(s) in "
-                       "\"limits <pattern> <limits>\" line.\n",
-                       fname, lineno ));
+                       "\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "%s : line %d: missing arg(s) in "
@@ -328,13 +327,11 @@ parse_limits(
                default:
                        if ( pattern[0] != '=' ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                               LDAP_LOG( CONFIG, CRIT, 
                                        "%s : line %d: missing '=' in "
                                        "\"dn[.{exact|base|one|subtree"
-                                       "|children|regex|anonymous}]"
-                                       "=<pattern>\" in "
-                                       "\"limits <pattern> <limits>\" line.\n",
-                                       fname, lineno ));
+                                       "|children|regex|anonymous}]" "=<pattern>\" in "
+                                       "\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "%s : line %d: missing '=' in "
@@ -369,10 +366,10 @@ parse_limits(
                if ( parse_limit( argv[i], &limit ) ) {
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                       LDAP_LOG( CONFIG, CRIT, 
                                "%s : line %d: unknown limit type \"%s\" in "
                                "\"limits <pattern> <limits>\" line.\n",
-                       fname, lineno, argv[i] ));
+                               fname, lineno, argv[i] );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "%s : line %d: unknown limit type \"%s\" in "
index bc8a4fc8a4089b4b28f2a92b248d155a7d90b67c..29d89ad270a056f00712b86a89141770030626d0 100644 (file)
@@ -30,8 +30,8 @@ lock_fopen( const char *fname, const char *type, FILE **lfp )
        strcpy(slap_strcopy( buf, fname ), ".lock" );
        if ( (*lfp = fopen( buf, "w" )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "lock_fopen: could not open lock file \"%s\".\n", buf ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "lock_fopen: could not open lock file \"%s\".\n", buf, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", buf, 0, 0 );
 #endif
@@ -45,8 +45,8 @@ lock_fopen( const char *fname, const char *type, FILE **lfp )
        /* open the log file */
        if ( (fp = fopen( fname, type )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "lock_fopen: could not open log file \"%s\".\n", buf ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "lock_fopen: could not open log file \"%s\".\n", buf, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
 #endif
index cea889cf7adfc9c38a657b481e40f431b4929b54..de931e49088dd0318cf6b010e6556abb2f6b8520 100644 (file)
@@ -177,8 +177,10 @@ int main( int argc, char **argv )
                {
                        slap_debug = *i;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                  "main: new debug level from registry is: %d\n", slap_debug ));
+                       lutil_log_initialize( argc, argv );
+                       LDAP_LOG( SLAPD, INFO, 
+                               "main: new debug level from registry is: %d\n", 
+                               slap_debug, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 );
 #endif
@@ -192,8 +194,8 @@ int main( int argc, char **argv )
 
                    urls = ch_strdup(newUrls);
 #ifdef NEW_LOGGING
-                   LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                              "main: new urls from registry: %s\n", urls ));
+                   LDAP_LOG( SLAPD, INFO, 
+                               "main: new urls from registry: %s\n", urls, 0, 0 );
 #else
                    Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
                          urls, 0, 0);
@@ -206,8 +208,8 @@ int main( int argc, char **argv )
                {
                        configfile = newConfigFile;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                  "main: new config file from registry is: %s\n", configfile ));
+                       LDAP_LOG( SLAPD, INFO, 
+                               "main: new config file from registry is: %s\n", configfile, 0, 0 );
 #else
                        Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", configfile, 0, 0 );
 #endif
@@ -310,16 +312,15 @@ int main( int argc, char **argv )
 
 #ifdef NEW_LOGGING
        lutil_log_initialize( argc, argv );
-#endif
-
+#else
        lutil_set_debug_level( "slapd", slap_debug );
        ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug);
        ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &slap_debug);
        ldif_debug = slap_debug;
+#endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                  "%s", Versionstr ));
+       LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 );
 #endif
@@ -384,8 +385,7 @@ int main( int argc, char **argv )
 
        if ( slap_schema_init( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: schema initialization error\n" ));
+               LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "schema initialization error\n",
@@ -424,8 +424,7 @@ int main( int argc, char **argv )
 
        if ( glue_sub_init( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: subordinate config error\n"));
+               LDAP_LOG( SLAPD, CRIT, "main: subordinate config error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "subordinate config error\n",
@@ -436,8 +435,7 @@ int main( int argc, char **argv )
 
        if ( slap_schema_check( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: schema prep error\n"));
+               LDAP_LOG( SLAPD, CRIT, "main: schema prep error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "schema prep error\n",
@@ -451,8 +449,7 @@ int main( int argc, char **argv )
        rc = ldap_pvt_tls_init();
        if( rc != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: tls init failed: %d\n", rc ));
+               LDAP_LOG( SLAPD, CRIT, "main: tls init failed: %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "main: TLS init failed: %d\n",
@@ -466,8 +463,7 @@ int main( int argc, char **argv )
        rc = ldap_pvt_tls_init_def_ctx();
        if( rc != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: tls init def ctx failed: %d\n", rc ));
+               LDAP_LOG( SLAPD, CRIT, "main: tls init def ctx failed: %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "main: TLS init def ctx failed: %d\n",
@@ -516,8 +512,7 @@ int main( int argc, char **argv )
                FILE *fp;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                          "main: slapd starting.\n" ));
+               LDAP_LOG( SLAPD, INFO, "main: slapd starting.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
 #endif
@@ -575,8 +570,7 @@ stop:
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                  "main: slapd stopped.\n" ));
+       LDAP_LOG( SLAPD, CRIT, "main: slapd stopped.\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 );
 #endif
index 56bd29667b491b59dc3e40bd258be1e43a5266a5..483a14956d225e1f988caa2bf4636202ff340a42 100644 (file)
@@ -73,8 +73,7 @@ filter_matched_values(
        int             rc = LDAP_SUCCESS;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "filter_matched_values: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "filter_matched_values: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> filter_matched_values\n", 0, 0, 0 );
 #endif
@@ -83,13 +82,12 @@ filter_matched_values(
                switch ( f->f_choice ) {
                case SLAPD_FILTER_COMPUTED:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( FILTER, DETAIL1, 
                                "test_vrFilter: COMPUTED %s (%d)\n",
                                f->f_result == LDAP_COMPARE_FALSE ? "false" :
                                f->f_result == LDAP_COMPARE_TRUE         ? "true"  :
                                f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
-                               "error",
-                               f->f_result ));
+                               "error", f->f_result, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     COMPUTED %s (%d)\n",
                                f->f_result == LDAP_COMPARE_FALSE ? "false" :
@@ -103,8 +101,7 @@ filter_matched_values(
 
                case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: EQUALITY\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EQUALITY\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EQUALITY\n", 0, 0, 0 );
 #endif
@@ -117,8 +114,7 @@ filter_matched_values(
 
                case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter  SUBSTRINGS\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter  SUBSTRINGS\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     SUBSTRINGS\n", 0, 0, 0 );
 #endif
@@ -132,8 +128,7 @@ filter_matched_values(
 
                case LDAP_FILTER_PRESENT:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: PRESENT\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter:      PRESENT\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     PRESENT\n", 0, 0, 0 );
 #endif
@@ -162,8 +157,7 @@ filter_matched_values(
 
                case LDAP_FILTER_EXT:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: EXT\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter:      EXT\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EXT\n", 0, 0, 0 );
 #endif
@@ -176,9 +170,8 @@ filter_matched_values(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                               "test_vrFilter:  unknown filter type %lu\n", 
-                               f->f_choice ));
+                       LDAP_LOG( FILTER, INFO, 
+                               "test_vrFilter:  unknown filter type %lu\n", f->f_choice, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "        unknown filter type %lu\n",
                                f->f_choice, 0, 0 );
@@ -188,8 +181,7 @@ filter_matched_values(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "filter_matched_values:  return=%d\n", rc ));
+       LDAP_LOG( FILTER, ENTRY, "filter_matched_values:  return=%d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "<= filter_matched_values %d\n", rc, 0, 0 );
 #endif
index fcbe86a46c490b3d5c6efdcfa031096d4934a71d..391fa3bf4c4c9a00d0d134c8af1df372d58a74ee 100644 (file)
@@ -50,8 +50,7 @@ do_modify(
        int manageDSAit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_modify: enter\n" ));
+       LDAP_LOG( OPERATION, ENTRY, "do_modify: enter\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
 #endif
@@ -77,8 +76,7 @@ do_modify(
 
        if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modify: ber_scanf failed\n" ));
+               LDAP_LOG( OPERATION, ERR, "do_modify: ber_scanf failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -89,8 +87,7 @@ do_modify(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                  "do_modify: dn (%s)\n", dn.bv_val ));
+       LDAP_LOG( OPERATION, ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 );
 #endif
@@ -128,9 +125,9 @@ do_modify(
                case LDAP_MOD_ADD:
                        if ( mod->sml_bvalues == NULL ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                               LDAP_LOG( OPERATION, ERR, 
                                        "do_modify: modify/add operation (%ld) requires values\n",
-                                       (long)mop ));
+                                       (long)mop, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "do_modify: modify/add operation (%ld) requires values\n",
@@ -152,9 +149,8 @@ do_modify(
 
                default: {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                       "do_modify: invalid modify operation (%ld)\n",
-                                       (long)mop ));
+                               LDAP_LOG( OPERATION, ERR, 
+                                       "do_modify: invalid modify operation (%ld)\n", (long)mop, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "do_modify: invalid modify operation (%ld)\n",
@@ -174,8 +170,7 @@ do_modify(
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modify: get_ctrls failed\n" ));
+               LDAP_LOG( OPERATION, ERR, "do_modify: get_ctrls failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -186,9 +181,8 @@ do_modify(
        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                       "do_modify: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, dn.bv_val ));
+               LDAP_LOG( OPERATION, INFO, "do_modify: conn %d  invalid dn (%s)\n",
+                       conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_modify: invalid dn (%s)\n", dn.bv_val, 0, 0 );
@@ -200,8 +194,8 @@ do_modify(
 
        if( ndn.bv_len == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modify: attempt to modify root DSE.\n" ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_modify: attempt to modify root DSE.\n",0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 );
 #endif
@@ -213,8 +207,8 @@ do_modify(
 #if defined( SLAPD_SCHEMA_DN )
        } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modify: attempt to modify subschema subentry.\n" ));
+               LDAP_LOG( OPERATION, ERR,
+                       "do_modify: attempt to modify subschema subentry.\n" , 0, 0, 0  );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modify: subschema subentry!\n", 0, 0, 0 );
 #endif
@@ -228,31 +222,26 @@ do_modify(
 
 #ifdef LDAP_DEBUG
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-               "do_modify: modifications:\n" ));
+       LDAP_LOG( OPERATION, DETAIL1, "do_modify: modifications:\n", 0, 0, 0  );
 #else
        Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
 #endif
 
        for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                       "\t%s:  %s\n", tmp->sml_op == LDAP_MOD_ADD ?
-                               "add" : (tmp->sml_op == LDAP_MOD_DELETE ?
-                                       "delete" : "replace"), tmp->sml_type.bv_val ));
+               LDAP_LOG( OPERATION, DETAIL1, "\t%s:  %s\n", 
+                       tmp->sml_op == LDAP_MOD_ADD ?
+                       "add" : (tmp->sml_op == LDAP_MOD_DELETE ?
+                       "delete" : "replace"), tmp->sml_type.bv_val, 0 );
 
                if ( tmp->sml_bvalues == NULL ) {
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                          "\t\tno values" ));
+                       LDAP_LOG( OPERATION, DETAIL1, "\t\tno values", 0, 0, 0 );
                } else if ( tmp->sml_bvalues[0].bv_val == NULL ) {
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                          "\t\tzero values" ));
+                       LDAP_LOG( OPERATION, DETAIL1, "\t\tzero values", 0, 0, 0 );
                } else if ( tmp->sml_bvalues[1].bv_val == NULL ) {
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                          "\t\tone value" ));
+                       LDAP_LOG( OPERATION, DETAIL1, "\t\tone value", 0, 0, 0 );
                } else {
-                       LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
-                          "\t\tmultiple values" ));
+                       LDAP_LOG( OPERATION, DETAIL1, "\t\tmultiple values", 0, 0, 0 );
                }
 
 #else
index eca68cace571f2fd5b35d3499c6d871b367853f2..8cb8a2737de44897807b7ed55f776ce959424073 100644 (file)
@@ -65,8 +65,7 @@ do_modrdn(
        int manageDSAit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_modrdn: begin\n" ));
+       LDAP_LOG( OPERATION, ENTRY, "do_modrdn: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
 #endif
@@ -87,8 +86,7 @@ do_modrdn(
            == LBER_ERROR )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modrdn: ber_scanf failed\n" ));
+               LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -106,8 +104,8 @@ do_modrdn(
                         * newSuperior is present: report error.
                         */
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "do_modrdn: (v2) invalid field newSuperior.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                               "do_modrdn: (v2) invalid field newSuperior.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "modrdn(v2): invalid field newSuperior!\n",
@@ -124,8 +122,8 @@ do_modrdn(
                     == LBER_ERROR ) {
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "do_modrdn: ber_scanf(\"m\") failed\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                               "do_modrdn: ber_scanf(\"m\") failed\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "ber_scanf(\"m\") failed\n",
                                0, 0, 0 );
@@ -141,10 +139,10 @@ do_modrdn(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
+       LDAP_LOG( OPERATION, ARGS, 
                "do_modrdn: dn (%s) newrdn (%s) newsuperior(%s)\n",
                dn.bv_val, newrdn.bv_val,
-               newSuperior.bv_len ? newSuperior.bv_val : "" ));
+               newSuperior.bv_len ? newSuperior.bv_val : "" );
 #else
        Debug( LDAP_DEBUG_ARGS,
            "do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n",
@@ -154,8 +152,7 @@ do_modrdn(
 
        if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modrdn: ber_scanf failed\n" ));
+               LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
 #endif
@@ -168,8 +165,7 @@ do_modrdn(
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modrdn: get_ctrls failed\n" ));
+               LDAP_LOG( OPERATION, ERR, "do_modrdn: get_ctrls failed\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modrdn: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -181,9 +177,9 @@ do_modrdn(
        rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_modrdn: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, dn.bv_val ));
+                       conn->c_connid, dn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_modrdn: invalid dn (%s)\n", dn.bv_val, 0, 0 );
@@ -195,8 +191,8 @@ do_modrdn(
 
        if( ndn.bv_len == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "do_modrdn:  attempt to modify root DSE.\n" ));
+               LDAP_LOG( OPERATION, ERR,
+                       "do_modrdn:  attempt to modify root DSE.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 );
 #endif
@@ -208,8 +204,8 @@ do_modrdn(
 #ifdef SLAPD_SCHEMA_DN
        } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modrdn: attempt to modify subschema subentry\n" ));
+               LDAP_LOG( OPERATION, ERR,
+                       "do_modrdn: attempt to modify subschema subentry\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry!\n", 0, 0, 0 );
 #endif
@@ -225,9 +221,9 @@ do_modrdn(
        rc = dnPrettyNormal( NULL, &newrdn, &pnewrdn, &nnewrdn );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_modrdn: conn %d  invalid newrdn (%s)\n",
-                       conn->c_connid, newrdn.bv_val ));
+                       conn->c_connid, newrdn.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_modrdn: invalid newrdn (%s)\n", newrdn.bv_val, 0, 0 );
@@ -239,8 +235,8 @@ do_modrdn(
 
        if( rdnValidate( &pnewrdn ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                       "do_modrdn: invalid rdn (%s).\n", pnewrdn.bv_val ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "do_modrdn: invalid rdn (%s).\n", pnewrdn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n",
                        pnewrdn.bv_val, 0, 0 );
@@ -256,9 +252,9 @@ do_modrdn(
                        &nnewSuperior );
                if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                       LDAP_LOG( OPERATION, INFO, 
                                "do_modrdn: conn %d  invalid newSuperior (%s)\n",
-                               conn->c_connid, newSuperior.bv_val ));
+                               conn->c_connid, newSuperior.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "do_modrdn: invalid newSuperior (%s)\n",
index 4a58714d5f0a20b385f8f1cdbfe53c88a099f73c..12375773cfae4fcb4a7ca8871a0f8d43b7382f39 100644 (file)
@@ -41,8 +41,8 @@ int module_init (void)
        if (lt_dlinit()) {
                const char *error = lt_dlerror();
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_CRIT,
-                          "module_init: lt_ldinit failed: %s\n", error ));
+               LDAP_LOG( SLAPD, CRIT, 
+                       "module_init: lt_ldinit failed: %s\n", error, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0);
 #endif
@@ -62,8 +62,8 @@ int module_kill (void)
        if (lt_dlexit()) {
                const char *error = lt_dlerror();
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_CRIT,
-                          "module_kill: lt_dlexit failed: %s\n", error ));
+               LDAP_LOG( SLAPD, CRIT, "module_kill: lt_dlexit failed: %s\n", 
+                       error, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "lt_dlexit failed: %s\n", error, 0, 0);
 #endif
@@ -83,8 +83,8 @@ int module_load(const char* file_name, int argc, char *argv[])
        module = (module_loaded_t *)ch_calloc(1, sizeof(module_loaded_t));
        if (module == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_CRIT,
-                          "module_load:  (%s) out of memory.\n", file_name ));
+               LDAP_LOG( SLAPD, CRIT, 
+                       "module_load:  (%s) out of memory.\n", file_name, 0, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "module_load failed: (%s) out of memory\n", file_name,
                        0, 0);
@@ -101,9 +101,9 @@ int module_load(const char* file_name, int argc, char *argv[])
        if ((module->lib = lt_dlopen(file_name)) == NULL) {
                error = lt_dlerror();
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_CRIT,
-                          "module_load: lt_dlopen failed: (%s) %s.\n",
-                          file_name, error ));
+               LDAP_LOG( SLAPD, CRIT, 
+                       "module_load: lt_dlopen failed: (%s) %s.\n", 
+                       file_name, error, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "lt_dlopen failed: (%s) %s\n", file_name,
                        error, 0);
@@ -114,8 +114,7 @@ int module_load(const char* file_name, int argc, char *argv[])
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "module", LDAP_LEVEL_INFO,
-                  "module_load: loaded module %s\n", file_name ));
+       LDAP_LOG( SLAPD, INFO, "module_load: loaded module %s\n", file_name, 0, 0 );
 #else
        Debug(LDAP_DEBUG_CONFIG, "loaded module %s\n", file_name, 0, 0);
 #endif
@@ -123,9 +122,9 @@ int module_load(const char* file_name, int argc, char *argv[])
    
        if ((initialize = lt_dlsym(module->lib, "init_module")) == NULL) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_ERR,
-                          "module_load: module %s : no init_module() function found\n",
-                          file_name ));
+               LDAP_LOG( SLAPD, ERR, 
+                       "module_load: module %s : no init_module() function found\n",
+                   file_name, 0, 0 );
 #else
                Debug(LDAP_DEBUG_CONFIG, "module %s: no init_module() function found\n",
                        file_name, 0, 0);
@@ -154,8 +153,8 @@ int module_load(const char* file_name, int argc, char *argv[])
        rc = initialize(argc, argv);
        if (rc == -1) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_ERR,
-                          "module_load:  module %s init_module() failed\n", file_name));
+               LDAP_LOG( SLAPD, ERR, 
+                       "module_load:  module %s init_module() failed\n", file_name, 0, 0);
 #else
                Debug(LDAP_DEBUG_CONFIG, "module %s: init_module() failed\n",
                        file_name, 0, 0);
@@ -170,8 +169,9 @@ int module_load(const char* file_name, int argc, char *argv[])
                || module_regtable[rc].proc == NULL)
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_ERR,
-                          "module_load: module %s: unknown registration type (%d).\n", file_name));
+               LDAP_LOG( SLAPD, ERR, 
+                       "module_load: module %s: unknown registration type (%d).\n", 
+                       file_name, 0);
 #else
                Debug(LDAP_DEBUG_CONFIG, "module %s: unknown registration type (%d)\n",
                        file_name, rc, 0);
@@ -184,9 +184,9 @@ int module_load(const char* file_name, int argc, char *argv[])
        rc = (module_regtable[rc].proc)(module, file_name);
        if (rc != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "module", LDAP_LEVEL_ERR,
-                          "module_load: module %s:%s could not be registered.\n",
-                          file_name, module_regtable[rc].type ));
+               LDAP_LOG( SLAPD, ERR, 
+                       "module_load: module %s:%s could not be registered.\n",
+                       file_name, module_regtable[rc].type, 0 );
 #else
                Debug(LDAP_DEBUG_CONFIG, "module %s: %s module could not be registered\n",
                        file_name, module_regtable[rc].type, 0);
@@ -200,9 +200,9 @@ int module_load(const char* file_name, int argc, char *argv[])
        module_list = module;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "module", LDAP_LEVEL_INFO,
-                  "module_load: module %s:%s registered\n", file_name,
-                  module_regtable[rc].type ));
+       LDAP_LOG( SLAPD, INFO, 
+               "module_load: module %s:%s registered\n", file_name,
+               module_regtable[rc].type, 0 );
 #else
        Debug(LDAP_DEBUG_CONFIG, "module %s: %s module registered\n",
                file_name, module_regtable[rc].type, 0);
index f8e788b6e0082d66acd4d2b0676a08588e42c915..dfa34c95d8c34620b6f1b4d194f898bcdf6409a6 100644 (file)
@@ -16,7 +16,6 @@
 #include "slap.h"
 #include "ldap_pvt.h"
 
-
 struct mindexrec {
        struct berval   mir_name;
        MatchingRule    *mir_mr;
@@ -198,8 +197,8 @@ register_matching_rule(
 
        if( usage == SLAP_MR_NONE ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "register_matching_rule: %s not usable\n", desc ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "register_matching_rule: %s not usable\n", desc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n",
                    desc, 0, 0 );
@@ -216,9 +215,9 @@ register_matching_rule(
 
                if( amr == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "register_matching_rule: could not locate associated matching rule %s for %s\n",
-                                  associated, desc ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "register_matching_rule: could not locate associated "
+                          "matching rule %s for %s\n",  associated, desc, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate "
                                "associated matching rule %s for %s\n",
@@ -234,9 +233,9 @@ register_matching_rule(
        mr = ldap_str2matchingrule( desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL);
        if ( !mr ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "register_matching_rule: %s before %s in %s.\n",
-                          ldap_scherr2str(code), err, desc ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "register_matching_rule: %s before %s in %s.\n",
+                       ldap_scherr2str(code), err, desc );
 #else
                Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s before %s in %s\n",
                    ldap_scherr2str(code), err, desc );
@@ -253,9 +252,9 @@ register_matching_rule(
 
        if ( code ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "register_matching_rule: %s for %s in %s.\n",
-                          scherr2str(code), err, desc ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "register_matching_rule: %s for %s in %s.\n",
+                       scherr2str(code), err, desc );
 #else
                Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s for %s in %s\n",
                    scherr2str(code), err, desc );
index 81db86ae7687473872714cc5460984a353f91f45..eca939b02674fd8b17def10f75c736b76a158c53 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "slap.h"
 
-
 void
 mra_free(
        MatchingRuleAssertion *mra,
@@ -53,8 +52,8 @@ get_mra(
 
        if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "get_mra: ber_scanf (\"{t\") failure\n" ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "get_mra: ber_scanf (\"{t\") failure\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf\n", 0, 0, 0 );
 #endif
@@ -68,8 +67,8 @@ get_mra(
                rtag = ber_scanf( ber, "m", &ma->ma_rule_text );
                if ( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "get_mra: ber_scanf(\"o\") failure.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "get_mra: ber_scanf(\"o\") failure.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf for mr\n", 0, 0, 0 );
 #endif
@@ -82,8 +81,8 @@ get_mra(
                rtag = ber_scanf( ber, "t", &tag );
                if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "get_mra: ber_scanf (\"t\") failure\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "get_mra: ber_scanf (\"t\") failure\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf\n", 0, 0, 0 );
 #endif
@@ -98,8 +97,8 @@ get_mra(
                rtag = ber_scanf( ber, "m", &type );
                if ( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "get_mra: ber_scanf (\"o\") failure.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf for ad\n", 0, 0, 0 );
 #endif
@@ -111,8 +110,8 @@ get_mra(
                rtag = ber_scanf( ber, "t", &tag );
                if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "get_mra: ber_scanf (\"t\") failure.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "get_mra: ber_scanf (\"t\") failure.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf\n", 0, 0, 0 );
 #endif
@@ -125,8 +124,8 @@ get_mra(
 
        if ( tag != LDAP_FILTER_EXT_VALUE ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "get_mra: ber_scanf missing value\n" ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "get_mra: ber_scanf missing value\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf missing value\n", 0, 0, 0 );
 #endif
@@ -140,8 +139,8 @@ get_mra(
 
        if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "get_mra: ber_scanf (\"o\") failure.\n" ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf\n", 0, 0, 0 );
 #endif
@@ -161,8 +160,7 @@ get_mra(
 
        if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "get_mra: ber_scanf failure\n"));
+               LDAP_LOG( OPERATION, ERR, "get_mra: ber_scanf failure\n", 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY, "  get_mra ber_scanf\n", 0, 0, 0 );
 #endif
index 02f6ea402212c9206dff7f9fcbdb6d69477e64fd..2d7c6ce097274af7dd4b5327a207e25eab7ddd23 100644 (file)
@@ -25,8 +25,14 @@ int is_object_subclass(
        if( sub == NULL || sup == NULL ) return 0;
 
 #if 1
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ARGS, 
+               "is_object_subclass(%s,%s) %d\n",
+               sup->soc_oid, sub->soc_oid, sup == sub );
+#else
        Debug( LDAP_DEBUG_TRACE, "is_object_subclass(%s,%s) %d\n",
                sup->soc_oid, sub->soc_oid, sup == sub );
+#endif
 #endif
 
        if( sup == sub ) {
@@ -72,10 +78,10 @@ int is_entry_objectclass(
        if( attr == NULL ) {
                /* no objectClass attribute */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR, "is_entry_objectclass: "
-                       "dn(%s), oid (%s), no objectClass attribute.\n",
-                       e->e_dn == NULL ? "" : e->e_dn,
-                       oc->soc_oclass.oc_oid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "is_entry_objectclass: dn(%s), oid (%s), no objectClass "
+                       "attribute.\n", e->e_dn == NULL ? "" : e->e_dn,
+                       oc->soc_oclass.oc_oid, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "is_entry_objectclass(\"%s\", \"%s\") "
                        "no objectClass attribute\n",
index 06cc1586a87478d2285866f4d7b2badd4b3d0bf0..f45b974272d4bb57a657a29aea2d56f4c2313c0f 100644 (file)
@@ -119,8 +119,8 @@ int slap_passwd_parse( struct berval *reqdata,
        if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_ID ) {
                if( id == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse: ID not allowed.\n"));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse: ID not allowed.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID not allowed.\n",
                                0, 0, 0 );
@@ -135,8 +135,8 @@ int slap_passwd_parse( struct berval *reqdata,
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse:  ID parse failed.\n"));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse:  ID parse failed.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
                                0, 0, 0 );
@@ -151,8 +151,8 @@ int slap_passwd_parse( struct berval *reqdata,
        if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_OLD ) {
                if( oldpass == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse: OLD not allowed.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse: OLD not allowed.\n" , 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD not allowed.\n",
                                0, 0, 0 );
@@ -167,8 +167,8 @@ int slap_passwd_parse( struct berval *reqdata,
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse:  ID parse failed.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse:  ID parse failed.\n" , 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
                                0, 0, 0 );
@@ -183,8 +183,8 @@ int slap_passwd_parse( struct berval *reqdata,
        if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ) {
                if( newpass == NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse:  NEW not allowed.\n" ));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse:  NEW not allowed.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: NEW not allowed.\n",
                                0, 0, 0 );
@@ -199,8 +199,8 @@ int slap_passwd_parse( struct berval *reqdata,
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "slap_passwd_parse:  OLD parse failed.\n"));
+                       LDAP_LOG( OPERATION, ERR,
+                          "slap_passwd_parse:  OLD parse failed.\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD parse failed.\n",
                                0, 0, 0 );
@@ -215,8 +215,8 @@ int slap_passwd_parse( struct berval *reqdata,
        if( len != 0 ) {
 decoding_error:
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "slap_passwd_parse: decoding error, len=%ld\n", (long)len ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "slap_passwd_parse: decoding error, len=%ld\n", (long)len, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "slap_passwd_parse: decoding error, len=%ld\n",
@@ -243,8 +243,8 @@ struct berval * slap_passwd_return(
        assert( cred != NULL );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "slap_passwd_return: %ld\n",(long)cred->bv_len ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "slap_passwd_return: %ld\n",(long)cred->bv_len, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "slap_passwd_return: %ld\n",
                (long) cred->bv_len, 0, 0 );
@@ -302,8 +302,7 @@ slap_passwd_generate( struct berval *pass )
 {
        struct berval *tmp;
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "slap_passwd_generate: begin\n" ));
+       LDAP_LOG( OPERATION, ENTRY, "slap_passwd_generate: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 );
 #endif
index 53edf251fba585d36abccdac5f419b604b499240..a836657fe1bc18ea74429b2ba47401b545e66d9d 100644 (file)
@@ -152,9 +152,9 @@ int validate_global_referral( const char *url )
        default:
                /* other error, bail */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+               LDAP_LOG( CONFIG, CRIT, 
                        "referral: invalid URL (%s): %s (%d)\n",
-                       url, "" /* ldap_url_error2str(rc) */, rc ));
+                       url, "" /* ldap_url_error2str(rc) */, rc );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "referral: invalid URL (%s): %s (%d)\n",
@@ -167,9 +167,7 @@ int validate_global_referral( const char *url )
 
        if( lurl->lud_dn && *lurl->lud_dn ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                       "referral: URL (%s): contains DN\n",
-                       url ));
+               LDAP_LOG( CONFIG, CRIT, "referral: URL (%s): contains DN\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "referral: URL (%s): contains DN\n",
@@ -179,9 +177,8 @@ int validate_global_referral( const char *url )
 
        } else if( lurl->lud_attrs ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                       "referral: URL (%s): requests attributes\n",
-                       url ));
+               LDAP_LOG( CONFIG, CRIT, 
+                       "referral: URL (%s): requests attributes\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "referral: URL (%s): requests attributes\n",
@@ -191,9 +188,8 @@ int validate_global_referral( const char *url )
 
        } else if( lurl->lud_scope != LDAP_SCOPE_DEFAULT ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                       "referral: URL (%s): contains explicit scope\n",
-                       url ));
+               LDAP_LOG( CONFIG, CRIT, 
+                       "referral: URL (%s): contains explicit scope\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "referral: URL (%s): contains explicit scope\n",
@@ -203,9 +199,8 @@ int validate_global_referral( const char *url )
 
        } else if( lurl->lud_filter ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
-                       "referral: URL (%s): contains explicit filter\n",
-                       url ));
+               LDAP_LOG( CONFIG, CRIT, 
+                       "referral: URL (%s): contains explicit filter\n", url, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "referral: URL (%s): contains explicit filter\n",
index d2def63547477610f7dab2e16c2fcd3d26729537..8ed77725da147c1253740f326f13b33cd9c72802 100644 (file)
@@ -133,9 +133,9 @@ static long send_ldap_ber(
                 */
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_ldap_ber: conn %lu  ber_flush failed err=%d (%s)\n",
-                          conn ? conn->c_connid : 0, err, sock_errstr(err) ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_ldap_ber: conn %lu  ber_flush failed err=%d (%s)\n",
+                       conn ? conn->c_connid : 0, err, sock_errstr(err) );
 #else
                Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n",
                    err, sock_errstr(err), 0 );
@@ -197,9 +197,9 @@ send_ldap_response(
        ber_init_w_nullc( ber, LBER_USE_DER );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_ldap_response: conn %lu         msgid=%d tag=%lu err=%d\n",
-                  conn ? conn->c_connid : 0, msgid, tag, err ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_ldap_response:  msgid=%d tag=%lu err=%d\n",
+               msgid, tag, err );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "send_ldap_response: msgid=%d tag=%lu err=%d\n",
@@ -208,10 +208,10 @@ send_ldap_response(
 
        if( ref ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                          "send_ldap_response: conn %lu  ref=\"%s\"\n",
-                          conn ? conn->c_connid : 0,
-                          ref[0].bv_val ? ref[0].bv_val : "NULL" ));
+               LDAP_LOG( OPERATION, ARGS, 
+                       "send_ldap_response: conn %lu  ref=\"%s\"\n",
+                       conn ? conn->c_connid : 0, 
+                       ref[0].bv_val ? ref[0].bv_val : "NULL" , 0 );
 #else
                Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=\"%s\"\n",
                        ref[0].bv_val ? ref[0].bv_val : "NULL",
@@ -225,9 +225,9 @@ send_ldap_response(
            rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
            if (rc != sizeof(struct sockaddr)) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_ldap_response: conn %lu  ber_write failed\n",
-                          conn ? conn->c_connid : 0 ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_ldap_response: conn %lu  ber_write failed\n",
+                       conn ? conn->c_connid : 0 , 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 );
 #endif
@@ -285,9 +285,9 @@ send_ldap_response(
 
        if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_ldap_response: conn %lu  ber_printf failed\n",
-                          conn ? conn->c_connid : 0 ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_ldap_response: conn %lu  ber_printf failed\n",
+                       conn ? conn->c_connid : 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -302,9 +302,9 @@ send_ldap_response(
 
        if ( bytes < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_ldap_response: conn %lu ber write failed\n",
-                          conn ? conn->c_connid : 0 ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_ldap_response: conn %lu ber write failed\n",
+                       conn ? conn->c_connid : 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "send_ldap_response: ber write failed\n",
@@ -342,9 +342,9 @@ send_ldap_disconnect(
        assert( LDAP_UNSOLICITED_ERROR( err ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_ldap_disconnect: conn %lu  %d:%s\n",
-                  conn ? conn->c_connid : 0, err, text ? text : "" ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_ldap_disconnect: conn %lu  %d:%s\n",
+               conn ? conn->c_connid : 0, err, text ? text : "" );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "send_ldap_disconnect %d:%s\n",
@@ -390,9 +390,9 @@ send_ldap_result(
        assert( !LDAP_API_ERROR( err ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_ldap_result : conn %lu   op=%lu p=%d\n",
-                  op->o_connid, op->o_opid, op->o_protocol ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_ldap_result : conn %lu      op=%lu p=%d\n",
+               op->o_connid, op->o_opid, op->o_protocol );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "send_ldap_result: conn=%lu op=%lu p=%d\n",
@@ -400,9 +400,9 @@ send_ldap_result(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                  "send_ldap_result: conn=%lu err=%d matched=\"%s\" text=\"%s\"\n",
-                  op->o_connid, err, matched ? matched : "", text ? text : "" ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n",
+               err, matched ? matched : "", text ? text : "" );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n",
@@ -412,9 +412,9 @@ send_ldap_result(
 
        if( ref ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
+               LDAP_LOG( OPERATION, ARGS, 
                        "send_ldap_result: referral=\"%s\"\n",
-                       ref[0].bv_val ? ref[0].bv_val : "NULL" ));
+                       ref[0].bv_val ? ref[0].bv_val : "NULL", 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "send_ldap_result: referral=\"%s\"\n",
@@ -471,9 +471,9 @@ send_ldap_sasl(
        ber_int_t msgid;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_ldap_sasl: conn %lu err=%d len=%lu\n",
-                  op->o_connid, err, cred ? cred->bv_len : -1 ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_ldap_sasl: conn %lu err=%d len=%lu\n",
+               op->o_connid, err, cred ? cred->bv_len : -1 );
 #else
        Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl: err=%d len=%ld\n",
                err, cred ? (long) cred->bv_len : -1, NULL );
@@ -505,10 +505,10 @@ send_ldap_extended(
        ber_int_t msgid;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_ldap_extended: conn %lu         err=%d oid=%s len=%ld\n",
-                  op->o_connid, err, rspoid ? rspoid : "",
-                  rspdata != NULL ? rspdata->bv_len : 0 ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_ldap_extended: err=%d oid=%s len=%ld\n",
+               err, rspoid ? rspoid : "",
+               rspdata != NULL ? rspdata->bv_len : 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "send_ldap_extended err=%d oid=%s len=%ld\n",
@@ -552,11 +552,9 @@ send_search_result(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_search_result: conn %lu err=%d "
-                  "matched=\"%s\" text=\"%s\"\n",
-                  op->o_connid, err, matched ? matched : "",
-                  text ? text : "" ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_search_result: err=%d matched=\"%s\" text=\"%s\"\n",
+               err, matched ? matched : "", text ? text : "" );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "send_search_result: err=%d matched=\"%s\" text=\"%s\"\n",
@@ -647,10 +645,9 @@ send_search_entry(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_search_entry: conn %lu dn=\"%s\"%s\n",
-                  op->o_connid, e->e_dn,
-                  attrsonly ? " (attrsOnly)" : "" ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_search_entry: conn %lu    dn=\"%s\"%s\n",
+               op->o_connid, e->e_dn, attrsonly ? " (attrsOnly)" : "" );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "=> send_search_entry: dn=\"%s\"%s\n",
@@ -661,10 +658,9 @@ send_search_entry(
                ad_entry, NULL, ACL_READ, NULL ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
-                          "send_search_entry: conn %lu access "
-                          "to entry (%s) not allowed\n",
-                          op->o_connid, e->e_dn ));
+               LDAP_LOG( ACL, INFO, 
+                       "send_search_entry: conn %lu access to entry (%s) not allowed\n", 
+                       op->o_connid, e->e_dn, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "send_search_entry: access to entry not allowed\n",
@@ -683,9 +679,9 @@ send_search_entry(
            rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
            if (rc != sizeof(struct sockaddr)) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_search_entry: conn %lu  ber_printf failed\n",
-                          conn ? conn->c_connid : 0 ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_search_entry: conn %lu  ber_printf failed\n",
+                       conn ? conn->c_connid : 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -705,9 +701,9 @@ send_search_entry(
 
        if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_search_entry: conn %lu  ber_printf failed\n",
-                          op->o_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_search_entry: conn %lu  ber_printf failed\n", 
+                       op->o_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -753,10 +749,9 @@ send_search_entry(
            
                if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "send_search_entry: conn %lu "
-                               "matched values filtering failed\n",
-                               conn ? conn->c_connid : 0 ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "send_search_entry: conn %lu matched values filtering failed\n",
+                               conn ? conn->c_connid : 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                                "matched values filtering failed\n", 0, 0, 0 );
@@ -805,10 +800,9 @@ send_search_entry(
                        ACL_READ, &acl_state ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_INFO, "send_search_entry: "
-                               "conn %lu  access to attribute %s "
-                               "not allowed\n",
-                               op->o_connid, desc->ad_cname.bv_val ));
+                       LDAP_LOG( ACL, INFO, 
+                               "send_search_entry: conn %lu  access to attribute %s not "
+                               "allowed\n", op->o_connid, desc->ad_cname.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "acl: "
                                "access to attribute %s not allowed\n",
@@ -819,10 +813,9 @@ send_search_entry(
 
                if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "send_search_entry: "
-                               "conn %lu  ber_printf failed\n",
-                               op->o_connid ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "send_search_entry: conn %lu  ber_printf failed\n", 
+                               op->o_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -844,12 +837,10 @@ send_search_entry(
                                        desc, &a->a_vals[i], ACL_READ, &acl_state ) )
                                {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( ACL, INFO, 
                                                "send_search_entry: conn %lu "
-                                               "access to attribute %s, "
-                                               "value %d not allowed\n",
-                                               op->o_connid, 
-                                               desc->ad_cname.bv_val, i ));
+                                               "access to attribute %s, value %d not allowed\n",
+                                               op->o_connid, desc->ad_cname.bv_val, i );
 #else
                                        Debug( LDAP_DEBUG_ACL,
                                                "acl: access to attribute %s, "
@@ -866,10 +857,9 @@ send_search_entry(
 
                                if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                                       LDAP_LOG( OPERATION, ERR, 
                                                "send_search_entry: conn %lu  "
-                                               "ber_printf failed.\n",
-                                               op->o_connid ));
+                                               "ber_printf failed.\n", op->o_connid, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                            "ber_printf failed\n", 0, 0, 0 );
@@ -891,10 +881,9 @@ send_search_entry(
 
                if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "send_search_entry: conn %lu  "
-                               "ber_printf failed\n",
-                               op->o_connid ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "send_search_entry: conn %lu ber_printf failed\n", 
+                               op->o_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -940,10 +929,10 @@ send_search_entry(
            
                if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                       LDAP_LOG( OPERATION, ERR, 
                                "send_search_entry: conn %lu "
-                               "matched values filtering failed\n",
-                               conn ? conn->c_connid : 0 ));
+                               "matched values filtering failed\n", 
+                               conn ? conn->c_connid : 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
                                "matched values filtering failed\n", 0, 0, 0 );
@@ -992,10 +981,10 @@ send_search_entry(
                        ACL_READ, &acl_state ) )
                {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
+                       LDAP_LOG( ACL, INFO, 
                                "send_search_entry: conn %lu "
                                "access to attribute %s not allowed\n",
-                               op->o_connid, desc->ad_cname.bv_val ));
+                               op->o_connid, desc->ad_cname.bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s "
                                        "not allowed\n",
@@ -1008,10 +997,9 @@ send_search_entry(
                rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname );
                if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                       LDAP_LOG( OPERATION, ERR, 
                                "send_search_entry: conn %lu  "
-                               "ber_printf failed\n",
-                               op->o_connid ));
+                               "ber_printf failed\n", op->o_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -1035,12 +1023,10 @@ send_search_entry(
                                        desc, &a->a_vals[i], ACL_READ, &acl_state ) )
                                {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
+                                       LDAP_LOG( ACL, INFO, 
                                                "send_search_entry: conn %lu "
-                                               "access to %s, value %d "
-                                               "not allowed\n",
-                                               op->o_connid, 
-                                               desc->ad_cname.bv_val, i ));
+                                               "access to %s, value %d not allowed\n",
+                                               op->o_connid, desc->ad_cname.bv_val, i );
 #else
                                        Debug( LDAP_DEBUG_ACL,
                                                "acl: access to attribute %s, "
@@ -1057,11 +1043,9 @@ send_search_entry(
 
                                if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) {
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                                  "send_search_entry: "
-                                                  "conn %lu  ber_printf "
-                                                  "failed\n",
-                                                  op->o_connid ));
+                                       LDAP_LOG( OPERATION, ERR, 
+                                               "send_search_entry: conn %lu  ber_printf failed\n", 
+                                               op->o_connid, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                            "ber_printf failed\n", 0, 0, 0 );
@@ -1085,10 +1069,9 @@ send_search_entry(
 
                if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                  "send_search_entry: conn %lu  "
-                                  "ber_printf failed\n",
-                                  op->o_connid ));
+                       LDAP_LOG( OPERATION, ERR, 
+                               "send_search_entry: conn %lu  ber_printf failed\n",
+                               op->o_connid, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -1122,9 +1105,9 @@ send_search_entry(
 #endif
        if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_search_entry: conn %lu ber_printf failed\n",
-                          op->o_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "send_search_entry: conn %lu ber_printf failed\n", 
+                       op->o_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
 #endif
@@ -1140,9 +1123,9 @@ send_search_entry(
 
        if ( bytes < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "send_search_entry: conn %lu  ber write failed.\n",
-                          op->o_connid ));
+               LDAP_LOG( OPERATION, ERR, 
+                          "send_search_entry: conn %lu  ber write failed.\n", 
+                          op->o_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "send_search_entry: ber write failed\n",
@@ -1162,9 +1145,8 @@ send_search_entry(
            conn->c_connid, op->o_opid, e->e_dn, 0, 0 );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "send_search_entry: conn %lu exit.\n",
-                  op->o_connid ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= send_search_entry\n", 0, 0, 0 );
 #endif
@@ -1195,9 +1177,9 @@ send_search_reference(
        AttributeDescription *ad_entry = slap_schema.si_ad_entry;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "send_search_reference: conn %lu  dn=\"%s\"\n",
-               op->o_connid, e->e_dn ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_search_reference: conn %lu  dn=\"%s\"\n", 
+               op->o_connid, e->e_dn, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "=> send_search_reference: dn=\"%s\"\n",
@@ -1209,10 +1191,9 @@ send_search_reference(
                ad_entry, NULL, ACL_READ, NULL ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
+               LDAP_LOG( ACL, INFO, 
                        "send_search_reference: conn %lu        "
-                       "access to entry %s not allowed\n",
-                       op->o_connid, e->e_dn ));
+                       "access to entry %s not allowed\n", op->o_connid, e->e_dn, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "send_search_reference: access to entry not allowed\n",
@@ -1226,10 +1207,9 @@ send_search_reference(
                ad_ref, NULL, ACL_READ, NULL ) )
        {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
+               LDAP_LOG( ACL, INFO, 
                        "send_search_reference: conn %lu access "
-                       "to reference not allowed.\n",
-                       op->o_connid ));
+                       "to reference not allowed.\n", op->o_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ACL,
                        "send_search_reference: access "
@@ -1242,9 +1222,9 @@ send_search_reference(
 
        if( refs == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+               LDAP_LOG( OPERATION, ERR, 
                        "send_search_reference: conn %lu null ref in (%s).\n",
-                       op->o_connid, e->e_dn ));
+                       op->o_connid, e->e_dn, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "send_search_reference: null ref in (%s)\n", 
@@ -1269,10 +1249,9 @@ send_search_reference(
 
        if ( rc == -1 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+               LDAP_LOG( OPERATION, ERR, 
                        "send_search_reference: conn %lu        "
-                       "ber_printf failed.\n",
-                       op->o_connid ));
+                       "ber_printf failed.\n", op->o_connid, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "send_search_reference: ber_printf failed\n", 0, 0, 0 );
@@ -1297,8 +1276,8 @@ send_search_reference(
                conn->c_connid, op->o_opid, e->e_dn, 0, 0 );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "send_search_reference: conn %lu exit.\n", op->o_connid ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "send_search_reference: conn %lu exit.\n", op->o_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= send_search_reference\n", 0, 0, 0 );
 #endif
@@ -1324,8 +1303,8 @@ str2result(
 
        if ( strncasecmp( s, "RESULT", 6 ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                          "str2result: (%s), expecting \"RESULT\"\n", s ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "str2result: (%s), expecting \"RESULT\"\n", s, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "str2result (%s) expecting \"RESULT\"\n",
                    s, 0, 0 );
@@ -1358,8 +1337,7 @@ str2result(
                        }
                } else {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                               "str2result: (%s) unknown.\n", s ));
+                       LDAP_LOG( OPERATION, INFO, "str2result: (%s) unknown.\n", s, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n",
                            s, 0, 0 );
index 13088088afe0de9f69dfad6fecea924867969f29..d386bccc38fda99435c429f21acbd6279c8a9712 100644 (file)
@@ -276,10 +276,8 @@ slap_sasl_log(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "SASL [conn=%ld] %s: %s\n",
-               conn ? conn->c_connid : -1,
-               label, message ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "SASL [conn=%ld] %s: %s\n", conn ? conn->c_connid : -1, label, message);
 #else
        Debug( level, "SASL [conn=%ld] %s: %s\n",
                conn ? conn->c_connid: -1,
@@ -315,10 +313,9 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
        struct berval dn2;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl_getdn: conn %d id=%s\n",
-               conn ? conn->c_connid : -1,
-               id ? (*id ? id : "<empty>") : "NULL" ));
+               conn ? conn->c_connid : -1, id ? (*id ? id : "<empty>") : "NULL" );
 #else
        Debug( LDAP_DEBUG_ARGS, "slap_sasl_getdn: id=%s\n", 
       id?(*id?id:"<empty>"):"NULL",0,0 );
@@ -424,8 +421,8 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
                dn->bv_len = p - dn->bv_val;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                       "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val ));
+               LDAP_LOG( TRANSPORT, ENTRY, 
+                       "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "getdn: u:id converted to %s\n", dn->bv_val,0,0 );
 #endif
@@ -453,8 +450,8 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
                ch_free( dn->bv_val );
                *dn = dn2;
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                       "slap_sasl_getdn: dn:id converted to %s.\n", dn->bv_val ));
+               LDAP_LOG( TRANSPORT, ENTRY, 
+                       "slap_sasl_getdn: dn:id converted to %s.\n", dn->bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "getdn: dn:id converted to %s\n",
                        dn->bv_val, 0, 0 );
@@ -523,8 +520,8 @@ slap_auxprop_lookup(
                rc = slap_str2ad( name, &ad, &text );
                if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1,
-                               "slap_auxprop: str2ad(%s): %s\n", name, text ));
+                       LDAP_LOG( TRANSPORT, DETAIL1, 
+                               "slap_auxprop: str2ad(%s): %s\n",  name, text, 0 );
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "slap_auxprop: str2ad(%s): %s\n", name, text, 0 );
@@ -664,11 +661,10 @@ slap_sasl_canonicalize(
        *out_len = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl_canonicalize: conn %d %s=\"%s\"\n",
-                       conn ? conn->c_connid : -1,
-                       (flags & SASL_CU_AUTHID) ? "authcid" : "authzid",
-                       in ? in : "<empty>" ));
+               conn ? conn->c_connid : -1,
+               (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", in ? in : "<empty>");
 #else
        Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: "
                "%s=\"%s\"\n",
@@ -723,10 +719,9 @@ slap_sasl_canonicalize(
        prop_set( props, names[0], (char *)&dn, sizeof( dn ) );
                
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl_canonicalize: conn %d %s=\"%s\"\n",
-                       conn ? conn->c_connid : -1,
-                       names[0]+1, dn.bv_val ));
+               conn ? conn->c_connid : -1, names[0]+1, dn.bv_val );
 #else
        Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: "
                "%s=\"%s\"\n",
@@ -759,9 +754,9 @@ slap_sasl_authorize(
        int rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n",
-                       conn ? conn->c_connid : -1, auth_identity, requested_user));
+               conn ? conn->c_connid : -1, auth_identity, requested_user);
 #else
        Debug( LDAP_DEBUG_ARGS, "SASL Authorize [conn=%ld]: "
                "authcid=\"%s\" authzid=\"%s\"\n",
@@ -789,9 +784,9 @@ slap_sasl_authorize(
        ch_free( authcDN.bv_val );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_INFO,
-                          "slap_sasl_authorize: conn %ld  authorization disallowed (%d)\n",
-                          (long)(conn ? conn->c_connid : -1), rc ));
+               LDAP_LOG( TRANSPORT, INFO, 
+                       "slap_sasl_authorize: conn %ld  authorization disallowed (%d)\n",
+                       (long)(conn ? conn->c_connid : -1), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                        " authorization disallowed (%d)\n",
@@ -806,9 +801,9 @@ slap_sasl_authorize(
        conn->c_sasl_dn = authzDN;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                  "slap_sasl_authorize: conn %d authorization allowed\n",
-                  (long)(conn ? conn->c_connid : -1 ) ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_authorize: conn %d authorization allowed\n",
+               (long)(conn ? conn->c_connid : -1), 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                " authorization allowed\n",
@@ -838,11 +833,10 @@ slap_sasl_authorize(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                  "slap_sasl_authorize: conn %d         authcid=\"%s\" authzid=\"%s\"\n",
-                  conn ? conn->c_connid : -1,
-                  authcid ? authcid : "<empty>",
-                  authzid ? authzid : "<empty>" ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_authorize: conn %d    authcid=\"%s\" authzid=\"%s\"\n",
+               conn ? conn->c_connid : -1, authcid ? authcid : "<empty>",
+               authzid ? authzid : "<empty>" );
 #else
        Debug( LDAP_DEBUG_ARGS, "SASL Authorize [conn=%ld]: "
                "authcid=\"%s\" authzid=\"%s\"\n",
@@ -855,8 +849,8 @@ slap_sasl_authorize(
        rc = sasl_getprop( conn->c_sasl_context, SASL_REALM, (void **)&realm );
        if( rc != SASL_OK && rc != SASL_NOTDONE ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                       "slap_sasl_authorize: getprop(REALM) failed.\n" ));
+               LDAP_LOG( TRANSPORT, ERR,
+                       "slap_sasl_authorize: getprop(REALM) failed.\n", 0, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "authorize: getprop(REALM) failed!\n", 0,0,0);
@@ -874,9 +868,9 @@ slap_sasl_authorize(
        }
        if( ( authzid == NULL ) || !strcmp( authcid,authzid ) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                          "slap_sasl_authorize: conn %d  Using authcDN=%s\n",
-                          conn ? conn->c_connid : -1, authcDN.bv_val ));
+               LDAP_LOG( TRANSPORT, ENTRY, 
+                       "slap_sasl_authorize: conn %d  Using authcDN=%s\n",
+                       conn ? conn->c_connid : -1, authcDN.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                 "Using authcDN=%s\n", (long) (conn ? conn->c_connid : -1), authcDN.bv_val,0 );
@@ -897,9 +891,9 @@ slap_sasl_authorize(
        ch_free( authcDN.bv_val );
        if( rc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_INFO,
-                          "slap_sasl_authorize: conn %ld  authorization disallowed (%d)\n",
-                          (long)(conn ? conn->c_connid : -1), rc ));
+               LDAP_LOG( TRANSPORT, INFO, 
+                       "slap_sasl_authorize: conn %ld  authorization disallowed (%d)\n",
+                       (long)(conn ? conn->c_connid : -1), rc, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                        " authorization disallowed (%d)\n",
@@ -912,9 +906,9 @@ slap_sasl_authorize(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                  "slap_sasl_authorize: conn %d authorization allowed\n",
-                  (long)(conn ? conn->c_connid : -1 ) ));
+       LDAP_LOG( TRANSPORT, RESULTS, 
+               "slap_sasl_authorize: conn %d authorization allowed\n",
+          (long)(conn ? conn->c_connid : -1 ), 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                " authorization allowed\n",
@@ -995,8 +989,7 @@ int slap_sasl_init( void )
 
        if( rc != SASL_OK ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_INFO,
-                          "slap_sasl_init: init failed.\n" ));
+               LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: init failed.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
                        0, 0, 0 );
@@ -1006,8 +999,7 @@ int slap_sasl_init( void )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_INFO,
-                  "slap_sasl_init: initialized!\n"));
+       LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: initialized!\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "slap_sasl_init: initialized!\n",
                0, 0, 0 );
@@ -1129,8 +1121,8 @@ int slap_sasl_open( Connection *conn )
 
        if( sc != SASL_OK ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                          "slap_sasl_open: sasl_server_new failed: %d\n", sc ));
+               LDAP_LOG( TRANSPORT, ERR, 
+                       "slap_sasl_open: sasl_server_new failed: %d\n", sc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "sasl_server_new failed: %d\n",
                        sc, 0, 0 );
@@ -1147,8 +1139,8 @@ int slap_sasl_open( Connection *conn )
 
                if( sc != SASL_OK ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                                  "slap_sasl_open: sasl_setprop failed: %d \n", sc ));
+                       LDAP_LOG( TRANSPORT, ERR, 
+                               "slap_sasl_open: sasl_setprop failed: %d \n", sc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "sasl_setprop failed: %d\n",
                                sc, 0, 0 );
@@ -1242,8 +1234,8 @@ char ** slap_sasl_mechs( Connection *conn )
 
                if( sc != SASL_OK ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                               "slap_sasl_mechs: sasl_listmech failed: %d\n", sc ));
+                       LDAP_LOG( TRANSPORT, ERR, 
+                               "slap_sasl_mechs: sasl_listmech failed: %d\n", sc, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "slap_sasl_listmech failed: %d\n",
                                sc, 0, 0 );
@@ -1300,12 +1292,12 @@ int slap_sasl_bind(
        int sc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "sasl_bind: conn %ld dn=\"%s\" mech=%s datalen=%ld\n",
-               conn->c_connid,
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n",
                dn->bv_len ? dn->bv_val : "",
-               conn->c_sasl_bind_in_progress ? "<continuing>" : conn->c_sasl_bind_mech.bv_val,
-               cred ? cred->bv_len : 0 ));
+               conn->c_sasl_bind_in_progress ? "<continuing>" : 
+               conn->c_sasl_bind_mech.bv_val,
+               cred ? cred->bv_len : 0 );
 #else
        Debug(LDAP_DEBUG_ARGS,
                "==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n",
@@ -1389,8 +1381,7 @@ int slap_sasl_bind(
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl_bind: rc=%d\n", rc ));
+       LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_bind: rc=%d\n", rc, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "<== slap_sasl_bind: rc=%d\n", rc, 0, 0);
 #endif
index 601d0245c8481102d6792be533e960c3f3d9ca06..b6a9cd94205a73cd4a47417bbcfd194a9a34c51c 100644 (file)
@@ -96,8 +96,8 @@ static int slap_parseURI( struct berval *uri,
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_parseURI: parsing %s\n", uri->bv_val ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 );
 #endif
@@ -170,10 +170,9 @@ static int slap_sasl_rx_off(char *rep, int *off)
                if ( *c == '$' ) {
                        if ( n == SASLREGEX_REPLACE ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
+                               LDAP_LOG( TRANSPORT, ERR, 
                                        "slap_sasl_regexp_config: \"%s\" has too many $n "
-                                               "placeholders (max %d)\n",
-                                       rep, SASLREGEX_REPLACE ));
+                                       "placeholders (max %d)\n", rep, SASLREGEX_REPLACE, 0  );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "SASL replace pattern %s has too many $n "
@@ -212,9 +211,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace )
        rc = dnNormalize2( NULL, &bv, &nbv );
        if ( rc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                          "slap_sasl_regexp_config: \"%s\" could not be normalized.\n",
-                          match ));
+               LDAP_LOG( TRANSPORT, ERR, 
+                       "slap_sasl_regexp_config: \"%s\" could not be normalized.\n",
+                       match, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                "SASL match pattern %s could not be normalized.\n",
@@ -230,9 +229,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace )
        if ( filter ) filter_free( filter );
        if ( rc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                          "slap_sasl_regexp_config: \"%s\" could not be parsed.\n",
-                          replace ));
+               LDAP_LOG( TRANSPORT, ERR, 
+                       "slap_sasl_regexp_config: \"%s\" could not be parsed.\n",
+                       replace, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                "SASL replace pattern %s could not be parsed.\n",
@@ -245,9 +244,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace )
        rc = regcomp( &reg->sr_workspace, reg->sr_match, REG_EXTENDED|REG_ICASE );
        if ( rc ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
-                          "slap_sasl_regexp_config: \"%s\" could not be compiled.\n",
-                          reg->sr_match ));
+               LDAP_LOG( TRANSPORT, ERR, 
+                       "slap_sasl_regexp_config: \"%s\" could not be compiled.\n",
+                       reg->sr_match, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                "SASL match pattern %s could not be compiled by regexp engine\n",
@@ -334,8 +333,8 @@ static int slap_sasl_regexp( struct berval *in, SaslUri_t *out )
        memset( out, 0, sizeof( *out ) );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl_regexp: converting SASL name %s\n", saslname ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_regexp: converting SASL name %s\n", saslname, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "slap_sasl_regexp: converting SASL name %s\n",
           saslname, 0, 0 );
@@ -369,10 +368,10 @@ static int slap_sasl_regexp( struct berval *in, SaslUri_t *out )
        out->scope = reg->sr_replace.scope;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl_regexp: converted SASL name to ldap:///%s??%s?%s\n",
                out->dn.bv_val, scope[out->scope], out->filter.bv_val ?
-               out->filter.bv_val : "" ));
+               out->filter.bv_val : ""  );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "slap_sasl_regexp: converted SASL name to ldap:///%s??%s?%s\n",
@@ -409,8 +408,8 @@ static int sasl_sc_sasl2dn( BackendDB *be, Connection *conn, Operation *o,
                ndn->bv_val = NULL;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1,
-                       "slap_sasl2dn: search DN returned more than 1 entry\n" ));
+       LDAP_LOG( TRANSPORT, DETAIL1,
+                   "slap_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "slap_sasl2dn: search DN returned more than 1 entry\n", 0,0,0 );
@@ -441,8 +440,8 @@ void slap_sasl2dn( Connection *conn, struct berval *saslname, struct berval *dn
        SaslUri_t uri;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl2dn: converting SASL name %s to DN.\n", saslname->bv_val ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl2dn: converting SASL name %s to DN.\n", saslname->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "==>slap_sasl2dn: "
                "converting SASL name %s to a DN\n", saslname->bv_val, 0,0 );
@@ -472,9 +471,9 @@ void slap_sasl2dn( Connection *conn, struct berval *saslname, struct berval *dn
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1,
+       LDAP_LOG( TRANSPORT, DETAIL1, 
                "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
-               uri.dn.bv_val, uri.scope ));
+               uri.dn.bv_val, uri.scope, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
@@ -506,9 +505,9 @@ FINISHED:
        if( filter ) filter_free( filter );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                "slap_sasl2dn: Converted SASL name to %s\n",
-               dn->bv_len ? dn->bv_val : "<nothing>" ));
+               dn->bv_len ? dn->bv_val : "<nothing>", 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<==slap_sasl2dn: Converted SASL name to %s\n",
                dn->bv_len ? dn->bv_val : "<nothing>", 0, 0 );
@@ -557,8 +556,9 @@ int slap_sasl_match( struct berval *rule, struct berval *assertDN, struct berval
        Operation op = {0};
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl_match: comparing DN %s to rule %s\n", assertDN->bv_val, rule->bv_val ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_match: comparing DN %s to rule %s\n", 
+               assertDN->bv_val, rule->bv_val,0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "===>slap_sasl_match: comparing DN %s to rule %s\n", assertDN->bv_val, rule->bv_val, 0 );
@@ -586,9 +586,9 @@ int slap_sasl_match( struct berval *rule, struct berval *assertDN, struct berval
        /* Must run an internal search. */
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1,
+       LDAP_LOG( TRANSPORT, DETAIL1, 
                "slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
-               searchbase.bv_val, scope ));
+               searchbase.bv_val, scope,0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
@@ -625,8 +625,8 @@ CONCLUDED:
        if( searchbase.bv_len ) ch_free( searchbase.bv_val );
        if( filter ) filter_free( filter );
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                  "slap_sasl_match: comparison returned %d\n", rc ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_match: comparison returned %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "<===slap_sasl_match: comparison returned %d\n", rc, 0, 0);
@@ -651,9 +651,9 @@ slap_sasl_check_authz(struct berval *searchDN, struct berval *assertDN, Attribut
        BerVarray vals=NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( TRANSPORT, ENTRY, 
                   "slap_sasl_check_authz: does %s match %s rule in %s?\n",
-                  assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val ));
+              assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val);
 #else
        Debug( LDAP_DEBUG_TRACE,
           "==>slap_sasl_check_authz: does %s match %s rule in %s?\n",
@@ -676,8 +676,9 @@ COMPLETE:
        if( vals ) ber_bvarray_free( vals );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-                  "slap_sasl_check_authz: %s check returning %s\n", ad->ad_cname.bv_val, rc ));
+       LDAP_LOG( TRANSPORT, RESULTS, 
+                  "slap_sasl_check_authz: %s check returning %s\n", 
+                  ad->ad_cname.bv_val, rc, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "<==slap_sasl_check_authz: %s check returning %d\n", ad->ad_cname.bv_val, rc, 0);
@@ -704,8 +705,9 @@ int slap_sasl_authorized( struct berval *authcDN, struct berval *authzDN )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl_authorized: can %s become %s?\n", authcDN->bv_val, authzDN->bv_val ));
+       LDAP_LOG( TRANSPORT, ENTRY, 
+               "slap_sasl_authorized: can %s become %s?\n", 
+               authcDN->bv_val, authzDN->bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
           "==>slap_sasl_authorized: can %s become %s?\n", authcDN->bv_val, authzDN->bv_val, 0 );
@@ -741,8 +743,7 @@ DONE:
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
-               "slap_sasl_authorized: return %d\n", rc ));
+       LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_authorized: return %d\n", rc,0,0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "<== slap_sasl_authorized: return %d\n", rc, 0, 0 );
index 405a47e54801f9fdccd0930b18bc941ded277171..a92d44214bff8dd56a5fa6b4c2d44187330bc1b1 100644 (file)
@@ -84,9 +84,8 @@ entry_schema_check(
                                type );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                               "entry_schema_check: dn=\"%s\" %s\n",
-                               e->e_dn, textbuf ));
+                       LDAP_LOG( OPERATION, INFO, 
+                               "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "Entry (%s), %s\n",
@@ -104,9 +103,9 @@ entry_schema_check(
        asc = attr_find( e->e_attrs, ad_structuralObjectClass );
        if ( asc == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_INFO, "entry_schema_check: "
-                       "No structuralObjectClass for entry (%s)\n",
-                       e->e_dn ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "entry_schema_check: No structuralObjectClass for entry (%s)\n", 
+                       e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "No structuralObjectClass for entry (%s)\n",
@@ -128,9 +127,8 @@ entry_schema_check(
                        asc->a_vals[0].bv_val );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                       "entry_schema_check: dn (%s), %s\n",
-                       e->e_dn, textbuf ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "entry_check_schema(%s): %s\n",
@@ -146,9 +144,8 @@ entry_schema_check(
                        asc->a_vals[0].bv_val );
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                       "entry_schema_check: dn (%s), %s\n",
-                       e->e_dn, textbuf ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "entry_check_schema(%s): %s\n",
@@ -162,9 +159,9 @@ entry_schema_check(
        aoc = attr_find( e->e_attrs, ad_objectClass );
        if ( aoc == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                       "entry_schema_check: No objectClass for entry (%s).\n",
-                       e->e_dn ));
+               LDAP_LOG( OPERATION, INFO, 
+                       "entry_schema_check: No objectClass for entry (%s).\n", 
+                       e->e_dn, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "No objectClass for entry (%s)\n",
                    e->e_dn, 0, 0 );
@@ -207,9 +204,8 @@ entry_schema_check(
                                aoc->a_vals[i].bv_val );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                               "entry_schema_check: dn (%s), %s\n",
-                               e->e_dn, textbuf ));
+                       LDAP_LOG( OPERATION, INFO, 
+                               "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "entry_check_schema(%s): %s\n",
@@ -243,9 +239,9 @@ entry_schema_check(
                                                                aoc->a_vals[i].bv_val );
 
 #ifdef NEW_LOGGING
-                                                       LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
+                                                       LDAP_LOG( OPERATION, INFO, 
                                                                "entry_schema_check: dn (%s), %s\n",
-                                                               e->e_dn, textbuf ));
+                                                               e->e_dn, textbuf, 0 );
 #else
                                                        Debug( LDAP_DEBUG_ANY,
                                                                "entry_check_schema(%s): %s\n",
@@ -277,9 +273,9 @@ entry_schema_check(
                                                aoc->a_vals[i].bv_val );
 
 #ifdef NEW_LOGGING
-                                       LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                                               "entry_schema_check: dn (%s), %s\n",
-                                               e->e_dn, textbuf ));
+                                       LDAP_LOG( OPERATION, INFO, 
+                                               "entry_schema_check: dn (%s), %s\n", 
+                                               e->e_dn, textbuf, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY,
                                                "entry_check_schema(%s): %s\n",
@@ -299,9 +295,8 @@ entry_schema_check(
                                        aoc->a_vals[i].bv_val, s );
 
 #ifdef NEW_LOGGING
-                               LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                                       "entry_schema_check: dn=\"%s\" %s",
-                                       e->e_dn, textbuf ));
+                               LDAP_LOG( OPERATION, INFO, 
+                                       "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "Entry (%s): %s\n",
@@ -332,9 +327,8 @@ entry_schema_check(
                                type );
 
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
-                               "entry_schema_check: dn=\"%s\" %s\n",
-                               e->e_dn, textbuf ));
+                       LDAP_LOG( OPERATION, INFO, 
+                               "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0);
 #else
                        Debug( LDAP_DEBUG_ANY,
                            "Entry (%s), %s\n",
@@ -359,9 +353,9 @@ oc_check_required(
        Attribute       *a;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-               "oc_check_required: dn (%s), objectClass \"%s\"\n",
-       e->e_dn, ocname->bv_val ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "oc_check_required: dn (%s), objectClass \"%s\"\n", 
+               e->e_dn, ocname->bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "oc_check_required entry (%s), objectClass \"%s\"\n",
@@ -400,8 +394,8 @@ int oc_check_allowed(
        int             i, j;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-               "oc_check_allowed: type \"%s\"\n", at->sat_cname.bv_val ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "oc_check_allowed: type \"%s\"\n", at->sat_cname.bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "oc_check_allowed type \"%s\"\n",
index f0ad77cb51a3daab777728a7a8a8e0c6735e00a0..cc92297a54e09d241f7d232ed59de12a7b828f52 100644 (file)
@@ -3367,9 +3367,9 @@ objectIdentifierFirstComponentMatch(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "objectIdentifierFirstComponentMatch: %d\n    %s\n    %s\n",
-                  match, value->bv_val, asserted->bv_val ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "objectIdentifierFirstComponentMatch: %d\n %s\n %s\n",
+               match, value->bv_val, asserted->bv_val );
 #else
        Debug( LDAP_DEBUG_ARGS, "objectIdentifierFirstComponentMatch "
                "%d\n\t\"%s\"\n\t\"%s\"\n",
@@ -3516,9 +3516,9 @@ certificateExactConvert(
        xcert = d2i_X509(NULL, &p, in->bv_len);
        if ( !xcert ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                          "certificateExactConvert: error parsing cert: %s\n",
-                          ERR_error_string(ERR_get_error(),NULL)));
+               LDAP_LOG( CONFIG, ENTRY, 
+                       "certificateExactConvert: error parsing cert: %s\n",
+                       ERR_error_string(ERR_get_error(),NULL), 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS, "certificateExactConvert: "
                       "error parsing cert: %s\n",
@@ -3551,9 +3551,8 @@ certificateExactConvert(
        *p++ = '\0';
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "certificateExactConvert: \n %s\n",
-                  out->bv_val));
+       LDAP_LOG( CONFIG, ARGS, 
+               "certificateExactConvert: \n    %s\n", out->bv_val, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "certificateExactConvert "
                "\n\t\"%s\"\n",
@@ -3633,9 +3632,9 @@ certificateExactMatch(
        xcert = d2i_X509(NULL, &p, value->bv_len);
        if ( !xcert ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                          "certificateExactMatch: error parsing cert: %s\n",
-                          ERR_error_string(ERR_get_error(),NULL)));
+               LDAP_LOG( CONFIG, ENTRY, 
+                       "certificateExactMatch: error parsing cert: %s\n",
+                       ERR_error_string(ERR_get_error(),NULL), 0, 0 );
 #else
                Debug( LDAP_DEBUG_ARGS, "certificateExactMatch: "
                       "error parsing cert: %s\n",
@@ -3674,10 +3673,12 @@ certificateExactMatch(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "certificateExactMatch: %d\n  %s $ %s\n       %s $   %s\n",
-                  *matchp, serial.bv_val, issuer_dn.bv_val,
-                  asserted_serial.bv_val, asserted_issuer_dn.bv_val));
+       LDAP_LOG( CONFIG, ARGS, "certificateExactMatch "
+               "%d\n\t\"%s $ %s\"\n",
+               *matchp, serial.bv_val, issuer_dn.bv_val );
+       LDAP_LOG( CONFIG, ARGS, "\t\"%s $ %s\"\n",
+               asserted_serial.bv_val, asserted_issuer_dn.bv_val,
+               0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "certificateExactMatch "
                "%d\n\t\"%s $ %s\"\n",
@@ -3729,9 +3730,9 @@ static int certificateExactIndexer(
                xcert = d2i_X509(NULL, &p, values[i].bv_len);
                if ( !xcert ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                           "certificateExactIndexer: error parsing cert: %s\n",
-                               ERR_error_string(ERR_get_error(),NULL)));
+                       LDAP_LOG( CONFIG, ENTRY, 
+                               "certificateExactIndexer: error parsing cert: %s\n",
+                               ERR_error_string(ERR_get_error(),NULL), 0, 0);
 #else
                        Debug( LDAP_DEBUG_ARGS, "certificateExactIndexer: "
                               "error parsing cert: %s\n",
@@ -3749,9 +3750,8 @@ static int certificateExactIndexer(
                                  &keys[i] );
                ber_memfree(serial.bv_val);
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                          "certificateExactIndexer: returning: %s\n",
-                          keys[i].bv_val));
+               LDAP_LOG( CONFIG, ENTRY, 
+                       "certificateExactIndexer: returning: %s\n", keys[i].bv_val, 0, 0);
 #else
                Debug( LDAP_DEBUG_ARGS, "certificateExactIndexer: "
                       "returning: %s\n",
@@ -4627,7 +4627,7 @@ int
 slap_schema_init( void )
 {
        int             res;
-       int             i;
+       int             i = 0;
 
        /* we should only be called once (from main) */
        assert( schema_init_done == 0 );
index 5813aa52c09e56f855cc48cdae4e3da09eae74e8..50dd5e94f8ff9209f115eb979555e733d8e6a559 100644 (file)
@@ -36,9 +36,8 @@ objectClassMatch(
 
 #if 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "> objectClassMatch(%s, %s)\n",
-                  value->bv_val, a->bv_val ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "> objectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "> objectClassMatch(%s,%s)\n",
                value->bv_val, a->bv_val, 0 );
@@ -69,9 +68,9 @@ objectClassMatch(
 
 #if 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "< objectClassMatch(%s, %s) = %d\n",
-                  value->bv_val, a->bv_val, *matchp ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "< objectClassMatch(%s, %s) = %d\n",
+               value->bv_val, a->bv_val, *matchp );
 #else
        Debug( LDAP_DEBUG_TRACE, "< objectClassMatch(%s,%s) = %d\n",
                value->bv_val, a->bv_val, *matchp );
@@ -99,9 +98,8 @@ structuralObjectClassMatch(
 
 #if 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "> structuralObjectClassMatch(%s, %s)\n",
-                  value->bv_val, a->bv_val ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "> structuralObjectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "> structuralObjectClassMatch(%s,%s)\n",
                value->bv_val, a->bv_val, 0 );
@@ -128,9 +126,9 @@ structuralObjectClassMatch(
 
 #if 1
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
-                  "< structuralObjectClassMatch( %s, %s ) = %d\n",
-                  value->bv_val, a->bv_val, *matchp ));
+       LDAP_LOG( CONFIG, ENTRY, 
+               "< structuralObjectClassMatch( %s, %s ) = %d\n",
+               value->bv_val, a->bv_val, *matchp );
 #else
        Debug( LDAP_DEBUG_TRACE, "< structuralObjectClassMatch(%s,%s) = %d\n",
                value->bv_val, a->bv_val, *matchp );
index c4db3e52e664bb210845a9949a740ca3bc33b156..7e36a3d7483b3b0ddf990689eca751577ac6d692 100644 (file)
@@ -45,8 +45,7 @@ do_search(
        int                     manageDSAit;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-               "do_search: conn %d\n", conn->c_connid ));
+       LDAP_LOG( OPERATION, ENTRY, "do_search: conn %d\n", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 );
 #endif
@@ -112,9 +111,9 @@ do_search(
        rc = dnPrettyNormal( NULL, &base, &pbase, &nbase );
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, ERR, 
                        "do_search: conn %d  invalid dn (%s)\n",
-                       conn->c_connid, base.bv_val ));
+                       conn->c_connid, base.bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "do_search: invalid dn (%s)\n", base.bv_val, 0, 0 );
@@ -125,9 +124,10 @@ do_search(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_search \"%s\" %d %d %d %d %d\n", base.bv_val, scope,
-               deref, sizelimit, timelimit, attrsonly ));
+       LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d",
+               base.bv_val, scope, deref );
+       LDAP_LOG( OPERATION, ARGS, "    %d %d %d\n",
+               sizelimit, timelimit, attrsonly);
 #else
        Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d",
                base.bv_val, scope, deref );
@@ -152,9 +152,9 @@ do_search(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_search: conn %d     filter: %s\n", conn->c_connid,
-               fstr.bv_len ? fstr.bv_val : "empty" ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "do_search: conn %d     filter: %s\n", 
+               conn->c_connid, fstr.bv_len ? fstr.bv_val : "empty", 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "    filter: %s\n",
                fstr.bv_len ? fstr.bv_val : "empty", 0, 0 );
@@ -177,9 +177,9 @@ do_search(
 
        if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+               LDAP_LOG( OPERATION, INFO, 
                        "do_search: conn %d  get_ctrls failed (%d)\n",
-                       conn->c_connid, rc ));
+                       conn->c_connid, rc, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 );
 #endif
@@ -188,8 +188,8 @@ do_search(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-               "do_search: conn %d     attrs:", conn->c_connid ));
+       LDAP_LOG( OPERATION, ARGS, 
+               "do_search: conn %d     attrs:", conn->c_connid, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "    attrs:", 0, 0, 0 );
 #endif
@@ -197,8 +197,8 @@ do_search(
        if ( siz != 0 ) {
                for ( i = 0; i<siz; i++ ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
-                               "do_search:        %s", an[i].an_name.bv_val ));
+                       LDAP_LOG( OPERATION, ARGS, 
+                               "do_search: %s", an[i].an_name.bv_val, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ARGS, " %s", an[i].an_name.bv_val, 0, 0 );
 #endif
@@ -206,7 +206,7 @@ do_search(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, "\n" ));
+       LDAP_LOG( OPERATION, ARGS, "\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
 #endif
index 45a42ad60034e5c883520f39f5a859ed9bc6d6bb..ff7cd450adfc7eea72d5e479af5fd74831697131 100644 (file)
@@ -33,8 +33,7 @@ str2filter( const char *str )
        const char *text = NULL;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "str2filter: \"%s\"\n", str ));
+       LDAP_LOG( FILTER, ENTRY,  "str2filter: \"%s\"\n", str, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "str2filter \"%s\"\n", str, 0, 0 );
 #endif
index faf68b95b4ce3ffecc4a170bbfcf4d8802cf491e..78a1a18cb32816087284a2fa68608227d7bc4107 100644 (file)
@@ -65,9 +65,9 @@ void suffix_alias(
                        strncpy( dn->bv_val, oldDN, diff );
                        strcpy( &dn->bv_val[diff], be->be_suffixAlias[i+1].bv_val );
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                  "suffix_alias: converted \"%s\" to \"%s\"\n",
-                                  oldDN, dn->bv_val ));
+                       LDAP_LOG( OPERATION, INFO, 
+                               "suffix_alias: converted \"%s\" to \"%s\"\n",
+                               oldDN, dn->bv_val, 0 );
 #else
                        Debug( LDAP_DEBUG_ARGS,
                                "suffix_alias: converted \"%s\" to \"%s\"\n",
index eea2e1b1108ce59c5aa59244bf7d030fb6e7142d..98f53d433bfc5f8de8c7dcd8c13436246b74d3db 100644 (file)
@@ -16,7 +16,6 @@
 #include "slap.h"
 #include "ldap_pvt.h"
 
-
 struct sindexrec {
        char            *sir_name;
        Syntax          *sir_syn;
@@ -164,9 +163,9 @@ register_syntax(
        syn = ldap_str2syntax( desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL);
        if ( !syn ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ERR,
-                          "register_syntax: Error - %s before %s in %s.\n",
-                          ldap_scherr2str(code), err, desc ));
+               LDAP_LOG( CONFIG, ERR, 
+                       "register_syntax: Error - %s before %s in %s.\n",
+                       ldap_scherr2str(code), err, desc );
 #else
                Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s before %s in %s\n",
                    ldap_scherr2str(code), err, desc );
@@ -181,9 +180,9 @@ register_syntax(
 
        if ( code ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ERR,
-                          "register_syntax: Error - %s %s in %s\n",
-                          scherr2str(code), err, desc ));
+               LDAP_LOG( CONFIG, ERR, 
+                       "register_syntax: Error - %s %s in %s\n", 
+                       scherr2str(code), err, desc );
 #else
                Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s %s in %s\n",
                    scherr2str(code), err, desc );
@@ -222,9 +221,9 @@ syn_schema_info( Entry *e )
                }
 #if 0
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
+               LDAP_LOG( config, ENTRY,
                           "syn_schema_info: Merging syn [%ld] %s\n",
-                          (long)vals[0].bv_len, vals[0].bv_val ));
+                          (long)vals[0].bv_len, vals[0].bv_val, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n",
               (long) vals[0].bv_len, vals[0].bv_val, 0 );
index d14114c50c0e18a60a6b5164a9b4505a28032342..771012774028b89b2c7c634084196d32b5c7cf90 100644 (file)
@@ -31,6 +31,9 @@ main( int argc, char **argv )
        char textbuf[SLAP_TEXT_BUFLEN] = { '\0' };
        size_t textlen = sizeof textbuf;
 
+#ifdef NEW_LOGGING
+       lutil_log_initialize(argc, argv );
+#endif
        slap_tool_init( "slapadd", SLAPADD, argc, argv );
 
        if( !be->be_entry_open ||
index 40457cfe9ace176af24e749075d2b23bba5f3eb4..c4c4f18542368b2dd8a69e9da4827b9c4e21db87 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "slap.h"
 
-
 int
 do_unbind(
     Connection *conn,
@@ -34,8 +33,8 @@ do_unbind(
 )
 {
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
-                  "do_unbind: conn %d\n", conn ? conn->c_connid : -1 ));
+       LDAP_LOG( OPERATION, ENTRY, 
+               "do_unbind: conn %d\n", conn ? conn->c_connid : -1, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "do_unbind\n", 0, 0, 0 );
 #endif
index e12c6032a300d8a12a86f90e4d04e2dc6c2b32f8..8df425bc38573407022c1944ceaa3c8e8177a344 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "slap.h"
 
-
 /*
  * Set real and effective user id and group id, and group access list
  * The user and group arguments are freed.
@@ -64,9 +63,8 @@ slap_init_user( char *user, char *group )
        did_getpw:
            if ( pwd == NULL ) {
 #ifdef NEW_LOGGING
-                   LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                              "slap_init_user: No passwd entry for user %s\n",
-                              user ));
+                   LDAP_LOG( OPERATION, INFO, 
+                               "slap_init_user: No passwd entry for user %s\n", user, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n",
                       user, 0, 0 );
@@ -104,8 +102,8 @@ slap_init_user( char *user, char *group )
        did_group:
            if ( grp == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                          "slap_init_user: No group entry for group %s\n", group));
+               LDAP_LOG( OPERATION, INFO, 
+                       "slap_init_user: No group entry for group %s\n", group, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n",
                       group, 0, 0 );
@@ -121,8 +119,9 @@ slap_init_user( char *user, char *group )
     if ( user ) {
        if ( getuid() == 0 && initgroups( user, gid ) != 0 ) {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "slap_init_user: Could not set the group access (gid) list.\n" ));
+           LDAP_LOG( OPERATION, INFO,
+                       "slap_init_user: Could not set the group access (gid) list.\n", 
+                       0, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                   "Could not set the group access (gid) list\n", 0, 0, 0 );
@@ -140,8 +139,9 @@ slap_init_user( char *user, char *group )
     if ( got_gid ) {
        if ( setgid( gid ) != 0 ) {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "slap_init_user: could not set real group id to %d\n", (int)gid));
+           LDAP_LOG( OPERATION, INFO, 
+                       "slap_init_user: could not set real group id to %d\n", 
+                       (int)gid, 0, 0);
 #else
            Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n",
                       (int) gid, 0, 0 );
@@ -152,8 +152,9 @@ slap_init_user( char *user, char *group )
 #ifdef HAVE_SETEGID
        if ( setegid( gid ) != 0 ) {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "slap_init_user: Could not set effective group id to %d\n",(int)gid));
+           LDAP_LOG( OPERATION, INFO, 
+                  "slap_init_user: Could not set effective group id to %d\n",
+                  (int)gid, 0, 0);
 #else
            Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n",
                       (int) gid, 0, 0 );
@@ -167,8 +168,9 @@ slap_init_user( char *user, char *group )
     if ( got_uid ) {
        if ( setuid( uid ) != 0 ) {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "slap_init_user: Could not set real user id to %d\n", (int)uid ));
+           LDAP_LOG( OPERATION, INFO, 
+                       "slap_init_user: Could not set real user id to %d\n", 
+                       (int)uid, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n",
                       (int) uid, 0, 0 );
@@ -179,8 +181,9 @@ slap_init_user( char *user, char *group )
 #ifdef HAVE_SETEUID
        if ( seteuid( uid ) != 0 ) {
 #ifdef NEW_LOGGING
-           LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                      "slap_init_user: Could not set effective user id to %d\n", (int)uid ));
+           LDAP_LOG( OPERATION, INFO, 
+                       "slap_init_user: Could not set effective user id to %d\n", 
+                       (int)uid, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n",
                       (int) uid, 0, 0 );
index bd47c26a61348ca92c9301008c6648510f4afd9e..cff77048992f51c5217df8aaa8f5e97a0913a2e8 100644 (file)
@@ -67,8 +67,9 @@ slurpd_read_config(
        cargv_size = ARGS_STEP + 1;
 
 #ifdef NEW_LOGGING
-    LDAP_LOG (( "config", LDAP_LEVEL_ARGS, 
-       "slurpd_read_config: Config: opening config file \"%s\"\n", fname ));
+    LDAP_LOG ( CONFIG, ARGS, 
+               "slurpd_read_config: Config: opening config file \"%s\"\n", 
+               fname, 0, 0 );
 #else
     Debug( LDAP_DEBUG_CONFIG, "Config: opening config file \"%s\"\n",
            fname, 0, 0 );
@@ -87,8 +88,8 @@ slurpd_read_config(
        }
 
 #ifdef NEW_LOGGING
-    LDAP_LOG (( "config", LDAP_LEVEL_DETAIL1, 
-               "slurpd_read_config: Config: (%s)\n", line ));
+    LDAP_LOG ( CONFIG, DETAIL1, 
+               "slurpd_read_config: Config: (%s)\n", line, 0, 0 );
 #else
        Debug( LDAP_DEBUG_CONFIG, "Config: (%s)\n", line, 0, 0 );
 #endif
@@ -132,9 +133,9 @@ slurpd_read_config(
 
             if ( cargc < 2 ) {
 #ifdef NEW_LOGGING
-                LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                LDAP_LOG( CONFIG, CRIT,
                         "%s: line %d: missing filename in \"include "
-                        "<filename>\" line.\n", fname, lineno ));
+                        "<filename>\" line.\n", fname, lineno , 0 );
 #else
                 Debug( LDAP_DEBUG_ANY,
         "%s: line %d: missing filename in \"include <filename>\" line\n",
@@ -156,9 +157,9 @@ slurpd_read_config(
     }
     fclose( fp );
 #ifdef NEW_LOGGING
-    LDAP_LOG (( "config", LDAP_LEVEL_RESULTS, 
+    LDAP_LOG ( CONFIG, RESULTS, 
                "slurpd_read_config: Config: "
-               "** configuration file successfully read and parsed\n" ));
+               "** configuration file successfully read and parsed\n", 0, 0, 0 );
 #else
     Debug( LDAP_DEBUG_CONFIG,
            "Config: ** configuration file successfully read and parsed\n",
@@ -344,11 +345,11 @@ add_replica(
        sglob->num_replicas--;
     } else {
 #ifdef NEW_LOGGING
-    LDAP_LOG (( "config", LDAP_LEVEL_RESULTS, 
+    LDAP_LOG ( CONFIG, RESULTS, 
                "add_replica: Config: ** successfully added replica \"%s%d\"\n", 
                sglob->replicas[ nr - 1 ]->ri_hostname == NULL ?
                "(null)" : sglob->replicas[ nr - 1 ]->ri_hostname,
-               sglob->replicas[ nr - 1 ]->ri_port, 0 ));
+               sglob->replicas[ nr - 1 ]->ri_port, 0 );
 #else
        Debug( LDAP_DEBUG_CONFIG,
                "Config: ** successfully added replica \"%s:%d\"\n",
index 36fab6540e346a8588ca56e9adb4f3c1fcfeffea..30ac5845d6428a5f073e816967dc942e97da02e9 100644 (file)
@@ -92,8 +92,8 @@ fm(
        if ( file_nonempty( sglob->slapd_replogfile )) {
            /* New work found - copy to slurpd replog file */
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "fm", LDAP_LEVEL_ARGS, 
-                       "fm: new work in %s\n", sglob->slapd_replogfile ));
+       LDAP_LOG ( SLURPD, ARGS, 
+                       "fm: new work in %s\n", sglob->slapd_replogfile, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ARGS, "new work in %s\n",
                    sglob->slapd_replogfile, 0, 0 );
@@ -104,8 +104,8 @@ fm(
            } else {
                if ( rc < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "fm", LDAP_LEVEL_CRIT, 
-                       "fm: Fatal error while copying replication log\n" ));
+               LDAP_LOG ( SLURPD, CRIT, 
+                               "fm: Fatal error while copying replication log\n" , 0, 0, 0);
 #else
                    Debug( LDAP_DEBUG_ANY,
                            "Fatal error while copying replication log\n",
@@ -127,9 +127,9 @@ fm(
            if (( rc = acquire_lock( sglob->slurpd_replogfile, &fp,
                    &lfp )) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "fm", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( SLURPD, ERR, 
                        "fm: Error: cannot acquire lock on \"%s\" for trimming\n",
-                       sglob->slurpd_replogfile ));
+                       sglob->slurpd_replogfile, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: cannot acquire lock on \"%s\" for trimming\n",
@@ -142,7 +142,7 @@ fm(
        }
     }
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "fm", LDAP_LEVEL_RESULTS, "fm: exiting\n" ));
+       LDAP_LOG ( SLURPD, RESULTS, "fm: exiting\n", 0, 0, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS, "fm: exiting\n", 0, 0, 0 );
 #endif
@@ -200,9 +200,9 @@ populate_queue(
 
     if ( acquire_lock( f, &fp, &lfp ) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "fm", LDAP_LEVEL_ERR, 
+       LDAP_LOG ( SLURPD, ERR, 
                "populate_queue: error: can't lock file \"%s\": %s\n", 
-               f, sys_errlist[ errno ] ));
+               f, sys_errlist[ errno ], 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "error: can't lock file \"%s\": %s\n",
@@ -217,9 +217,9 @@ populate_queue(
      */
     if ( fseek( fp, sglob->srpos, 0 ) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "fm", LDAP_LEVEL_ERR, 
+       LDAP_LOG ( SLURPD, ERR, 
                "populate_queue: error: can't seek to offset %ld in file \"%s\"\n", 
-               sglob->srpos, f ));
+               sglob->srpos, f, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "error: can't seek to offset %ld in file \"%s\"\n",
@@ -234,9 +234,9 @@ populate_queue(
                *t = '\0';
            }
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "fm", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( SLURPD, ERR, 
                        "populate_queue: error: malformed replog entry "
-                       "(begins with \"%s\")\n", p ));
+                       "(begins with \"%s\")\n", p, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "error: malformed replog entry (begins with \"%s\")\n",
index 577950e4b0af14e1cddc4ec89999182c68c12309..38882a1b42226351b564a2174a60d21276f683c3 100644 (file)
@@ -85,9 +85,10 @@ do_ldap(
                        lderr = op_ldap_add( ri, re, errmsg );
                        if ( lderr != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: "
+                               LDAP_LOG ( OPERATION, ERR, "do_ldap: "
                                        "Error: ldap_add_s failed adding \"%s\": %s\n",
-                                       *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn ));
+                                       *errmsg ? *errmsg : ldap_err2string( lderr ), 
+                                       re->re_dn, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "Error: ldap_add_s failed adding \"%s\": %s\n",
@@ -101,9 +102,10 @@ do_ldap(
                        lderr = op_ldap_modify( ri, re, errmsg );
                        if ( lderr != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: "
+                               LDAP_LOG ( OPERATION, ERR, "do_ldap: "
                                        "Error: ldap_modify_s failed modifying \"%s\": %s\n",
-                                       *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn ));
+                                       *errmsg ? *errmsg : ldap_err2string( lderr ), 
+                                       re->re_dn, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "Error: ldap_modify_s failed modifying \"%s\": %s\n",
@@ -117,9 +119,10 @@ do_ldap(
                        lderr = op_ldap_delete( ri, re, errmsg );
                        if ( lderr != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: "
+                               LDAP_LOG ( OPERATION, ERR, "do_ldap: "
                                        "Error: ldap_delete_s failed deleting \"%s\": %s\n",
-                                       *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn ));
+                                       *errmsg ? *errmsg : ldap_err2string( lderr ), 
+                                       re->re_dn, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "Error: ldap_delete_s failed deleting \"%s\": %s\n",
@@ -133,9 +136,10 @@ do_ldap(
                        lderr = op_ldap_modrdn( ri, re, errmsg );
                        if ( lderr != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: "
+                               LDAP_LOG ( OPERATION, ERR, "do_ldap: "
                                        "Error: ldap_modrdn_s failed modifying %s: %s\n",
-                                       *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn ));
+                                       *errmsg ? *errmsg : ldap_err2string( lderr ), 
+                                       re->re_dn, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "Error: ldap_modrdn_s failed modifying %s: %s\n",
@@ -147,9 +151,9 @@ do_ldap(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: "
+                       LDAP_LOG ( OPERATION, ERR, "do_ldap: "
                                "Error: bad op \"%d\", dn = \"%s\"\n",
-                               re->re_changetype, re->re_dn ));
+                               re->re_changetype, re->re_dn, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "Error: do_ldap: bad op \"%d\", dn = \"%s\"\n",
@@ -221,9 +225,9 @@ op_ldap_add(
 
        /* Perform the operation */
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "op_ldap_add: replica %s:%d - add dn \"%s\"\n",
-               ri->ri_hostname, ri->ri_port, re->re_dn ));
+               ri->ri_hostname, ri->ri_port, re->re_dn );
 #else
        Debug( LDAP_DEBUG_ARGS, "replica %s:%d - add dn \"%s\"\n",
                ri->ri_hostname, ri->ri_port, re->re_dn );
@@ -235,8 +239,8 @@ op_ldap_add(
     } else {
        *errmsg = "No modifications to do";
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-               "op_ldap_add: Error: no mods to do (%s)!\n", re->re_dn ));
+       LDAP_LOG ( OPERATION, ERR, 
+               "op_ldap_add: Error: no mods to do (%s)!\n", re->re_dn, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
               "Error: op_ldap_add: no mods to do (%s)!\n", re->re_dn, 0, 0 );
@@ -277,8 +281,8 @@ op_ldap_modify(
     if ( re->re_mods == NULL ) {
        *errmsg = "No arguments given";
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-               "op_ldap_modify: Error: no arguments\n" ));
+       LDAP_LOG ( OPERATION, ERR, 
+               "op_ldap_modify: Error: no arguments\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modify: no arguments\n",
                0, 0, 0 );
@@ -330,8 +334,8 @@ op_ldap_modify(
        default:
            if ( state == AWAITING_OP ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-                       "op_ldap_modify: Error: unknown mod type \"%s\"\n", type ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "op_ldap_modify: Error: unknown mod type \"%s\"\n", type, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: op_ldap_modify: unknown mod type \"%s\"\n",
@@ -348,10 +352,10 @@ op_ldap_modify(
             */
            if ( strcasecmp( type, ldm->mod_type )) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modify: Error: "
                        "malformed modify op, %s: %s (expecting \"%s\")\n", 
-                       type, value, ldm->mod_type ));
+                       type, value, ldm->mod_type );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: malformed modify op, %s: %s (expecting %s:)\n",
@@ -375,9 +379,9 @@ op_ldap_modify(
     if ( nops > 0 ) {
        /* Actually perform the LDAP operation */
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_DETAIL1, 
+       LDAP_LOG ( OPERATION, DETAIL1, 
                "op_ldap_modify: replica %s:%d - modify dn \"%s\"\n", 
-               ri->ri_hostname, ri->ri_port, re->re_dn ));
+               ri->ri_hostname, ri->ri_port, re->re_dn );
 #else
        Debug( LDAP_DEBUG_ARGS, "replica %s:%d - modify dn \"%s\"\n",
                ri->ri_hostname, ri->ri_port, re->re_dn );
@@ -404,9 +408,9 @@ op_ldap_delete(
     int                rc;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "op_ldap_delete: replica %s:%d - delete dn \"%s\"\n",
-           ri->ri_hostname, ri->ri_port, re->re_dn ));
+           ri->ri_hostname, ri->ri_port, re->re_dn );
 #else
     Debug( LDAP_DEBUG_ARGS, "replica %s:%d - delete dn \"%s\"\n",
            ri->ri_hostname, ri->ri_port, re->re_dn );
@@ -447,8 +451,8 @@ op_ldap_modrdn(
     if ( re->re_mods == NULL ) {
        *errmsg = "No arguments given";
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-               "op_ldap_modrdn: Error: no arguments\n" ));
+       LDAP_LOG ( OPERATION, ERR, 
+               "op_ldap_modrdn: Error: no arguments\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: no arguments\n",
                0, 0, 0 );
@@ -463,9 +467,9 @@ op_ldap_modrdn(
        if ( !strcmp( mi[ i ].mi_type, T_NEWRDNSTR )) {
                if( state & GOT_NEWRDN ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modrdn: Error: multiple newrdn arg \"%s\"\n",
-                       mi[ i ].mi_val ));
+                       mi[ i ].mi_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: op_ldap_modrdn: multiple newrdn arg \"%s\"\n",
@@ -481,9 +485,9 @@ op_ldap_modrdn(
        } else if ( !strcmp( mi[ i ].mi_type, T_DELOLDRDNSTR )) {
                if( state & GOT_DELOLDRDN ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modrdn: Error: multiple deleteoldrdn arg \"%s\"\n",
-                       mi[ i ].mi_val ));
+                       mi[ i ].mi_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: op_ldap_modrdn: multiple deleteoldrdn arg \"%s\"\n",
@@ -500,9 +504,9 @@ op_ldap_modrdn(
                drdnflag = 1;
            } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modrdn: Error: bad deleteoldrdn arg \"%s\"\n",
-                       mi[ i ].mi_val ));
+                       mi[ i ].mi_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: op_ldap_modrdn: bad deleteoldrdn arg \"%s\"\n",
@@ -515,9 +519,9 @@ op_ldap_modrdn(
        } else if ( !strcmp( mi[ i ].mi_type, T_NEWSUPSTR )) {
                if( state & GOT_NEWSUP ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modrdn: Error: multiple newsuperior arg \"%s\"\n",
-                       mi[ i ].mi_val ));
+                       mi[ i ].mi_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: op_ldap_modrdn: multiple newsuperior arg \"%s\"\n",
@@ -532,9 +536,9 @@ op_ldap_modrdn(
 
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "op_ldap_modrdn: Error: bad type \"%s\"\n",
-                       mi[ i ].mi_type ));
+                       mi[ i ].mi_type, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: bad type \"%s\"\n",
                    mi[ i ].mi_type, 0, 0 );
@@ -549,8 +553,8 @@ op_ldap_modrdn(
      */
     if ( !GOT_ALL_MODDN(state) ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-                       "op_ldap_modrdn: Error: missing arguments\n" ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "op_ldap_modrdn: Error: missing arguments\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: missing arguments\n",
                0, 0, 0 );
@@ -571,9 +575,9 @@ op_ldap_modrdn(
        snprintf( buf2, buf2len, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "op_ldap_modrdn: replica %s - modify rdn %s (flag: %d)\n",
-               buf, buf2, drdnflag ));
+               buf, buf2, drdnflag );
 #else
        Debug( LDAP_DEBUG_ARGS,
                "replica %s - modify rdn %s (flag: %d)\n",
@@ -712,9 +716,9 @@ do_unbind(
        rc = ldap_unbind( ri->ri_ldp );
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "do_unbind: ldap_unbind failed for %s:%d: %s\n",
-                   ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) ));
+                   ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "Error: do_unbind: ldap_unbind failed for %s:%d: %s\n",
@@ -751,7 +755,7 @@ do_bind(
 
     if ( ri == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: null ri ptr\n" ));
+       LDAP_LOG ( OPERATION, ERR, "do_bind: null ri ptr\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: do_bind: null ri ptr\n", 0, 0, 0 );
 #endif
@@ -762,8 +766,8 @@ do_bind(
        ldrc = ldap_unbind( ri->ri_ldp );
        if ( ldrc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
-                       "do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ) ));
+               LDAP_LOG ( OPERATION, ERR, 
+                       "do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ), 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "Error: do_bind: ldap_unbind failed: %s\n",
@@ -774,9 +778,9 @@ do_bind(
     }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "do_bind: Initializing session to %s:%d\n", 
-           ri->ri_hostname, ri->ri_port ));
+           ri->ri_hostname, ri->ri_port, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS, "Initializing session to %s:%d\n",
            ri->ri_hostname, ri->ri_port, 0 );
@@ -785,9 +789,9 @@ do_bind(
     ri->ri_ldp = ldap_init( ri->ri_hostname, ri->ri_port );
     if ( ri->ri_ldp == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, 
+               LDAP_LOG ( OPERATION, ERR, 
                        "do_bind: ldap_init (%s, %d) failed: %s\n",
-                       ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] ));
+                       ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] );
 #else
                Debug( LDAP_DEBUG_ANY, "Error: ldap_init(%s, %d) failed: %s\n",
                        ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] );
@@ -802,9 +806,9 @@ do_bind(
 
                if( err != LDAP_OPT_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ",
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n",
-                               ri->ri_hostname ));
+                               ri->ri_hostname, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n",
@@ -827,9 +831,9 @@ do_bind(
 
                if( err != LDAP_OPT_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ",
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "Error: ldap_set_option(%s, REFERRALS, OFF) failed!\n",
-                               ri->ri_hostname ));
+                               ri->ri_hostname, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "Error: ldap_set_option(%s,REFERRALS, OFF) failed!\n",
@@ -848,10 +852,10 @@ do_bind(
 
                if( err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ",
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "%s: ldap_start_tls failed: %s (%d)\n",
                                ri->ri_tls == TLS_CRITICAL ? "Error" : "Warning",
-                               ldap_err2string( err ), err ));
+                               ldap_err2string( err ), err );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "%s: ldap_start_tls failed: %s (%d)\n",
@@ -873,9 +877,9 @@ do_bind(
         * Bind with a plaintext password.
         */
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "do_bind: bind to %s:%d as %s (simple)\n", 
-               ri->ri_hostname, ri->ri_port, ri->ri_bind_dn ));
+               ri->ri_hostname, ri->ri_port, ri->ri_bind_dn );
 #else
        Debug( LDAP_DEBUG_ARGS, "bind to %s:%d as %s (simple)\n",
                ri->ri_hostname, ri->ri_port, ri->ri_bind_dn );
@@ -884,9 +888,9 @@ do_bind(
                ri->ri_password );
        if ( ldrc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+               LDAP_LOG ( OPERATION, ERR, "do_bind: "
                    "Error: ldap_simple_bind_s for %s:%d failed: %s\n",
-                   ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) ));
+                   ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "Error: ldap_simple_bind_s for %s:%d failed: %s\n",
@@ -901,11 +905,11 @@ do_bind(
 
        case AUTH_SASL:
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, 
+       LDAP_LOG ( OPERATION, ARGS, 
                "do_bind: bind to %s as %s via %s (SASL)\n", 
                ri->ri_hostname,
                ri->ri_authcId ? ri->ri_authcId : "-",
-               ri->ri_saslmech ));
+               ri->ri_saslmech );
 #else
        Debug( LDAP_DEBUG_ARGS, "bind to %s as %s via %s (SASL)\n",
                ri->ri_hostname,
@@ -921,9 +925,9 @@ do_bind(
 
                if( err != LDAP_OPT_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
-                               ri->ri_hostname, ri->ri_secprops ));
+                               ri->ri_hostname, ri->ri_secprops, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
                                "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
@@ -945,9 +949,9 @@ do_bind(
                    LDAP_SASL_QUIET, lutil_sasl_interact, defaults );
                if ( ldrc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "Error: LDAP SASL for %s:%d failed: %s\n",
-                           ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) ));
+                           ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) );
 #else
                        Debug( LDAP_DEBUG_ANY, "Error: LDAP SASL for %s:%d failed: %s\n",
                            ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ));
@@ -964,9 +968,9 @@ do_bind(
        break;
 #else
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                "Error: do_bind: SASL not supported %s:%d\n",
-                ri->ri_hostname, ri->ri_port ));
+               ri->ri_hostname, ri->ri_port, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: do_bind: SASL not supported %s:%d\n",
@@ -979,9 +983,9 @@ do_bind(
 
     default:
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                "Error: do_bind: unknown auth type \"%d\" for %s:%d\n",
-               ri->ri_bind_method, ri->ri_hostname, ri->ri_port ));
+               ri->ri_bind_method, ri->ri_hostname, ri->ri_port );
 #else
        Debug(  LDAP_DEBUG_ANY,
                "Error: do_bind: unknown auth type \"%d\" for %s:%d\n",
@@ -1008,9 +1012,9 @@ do_bind(
 
                if( err != LDAP_OPT_SUCCESS ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: "
+                       LDAP_LOG ( OPERATION, ERR, "do_bind: "
                                "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n",
-                               ri->ri_hostname ));
+                               ri->ri_hostname, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "Error: "
                                "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n",
@@ -1045,15 +1049,15 @@ dump_ldm_array(
     for ( i = 0; ldmarr[ i ] != NULL; i++ ) {
        ldm = ldmarr[ i ];
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: "
+       LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
                "Trace (%ld): *** ldmarr[ %d ] contents:\n",
-               (long) getpid(), i ));
-       LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: "
+               (long) getpid(), i, 0 );
+       LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
                "Trace (%ld): *** ldm->mod_op: %d\n",
-               (long) getpid(), ldm->mod_op ));
-       LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: "
+               (long) getpid(), ldm->mod_op, 0 );
+       LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
                "Trace (%ld): *** ldm->mod_type: %s\n",
-               (long) getpid(), ldm->mod_type ));
+               (long) getpid(), ldm->mod_type, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE,
                "Trace (%ld): *** ldmarr[ %d ] contents:\n",
@@ -1071,8 +1075,8 @@ dump_ldm_array(
                sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>",
                        j, b->bv_len, b->bv_val );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: "
-                       "Trace (%ld):%s\n", (long) getpid(), msgbuf ));
+               LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
+                       "Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 );
index d457cdfc21ae62aa655692e0bef074e06d05c21f..ce6fffb03102febd4d16b6a6ba0928252bd5f69d 100644 (file)
@@ -51,8 +51,8 @@ lock_fopen(
        strcat( buf, ".lock" );
        if ( (*lfp = fopen( buf, "w" )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "lock_fopen: "
-                       "Error: could not open \"%s\"\n", buf ));
+               LDAP_LOG ( SLURPD, ERR, "lock_fopen: "
+                       "Error: could not open \"%s\"\n", buf, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: could not open \"%s\"\n", buf, 0, 0 );
@@ -66,8 +66,8 @@ lock_fopen(
        /* open the log file */
        if ( (fp = fopen( fname, type )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "lock_fopen: "
-                       "Error: could not open \"%s\"\n", fname ));
+               LDAP_LOG ( SLURPD, ERR, "lock_fopen: "
+                       "Error: could not open \"%s\"\n", fname, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: could not open \"%s\"\n", fname, 0, 0 );
@@ -110,9 +110,9 @@ acquire_lock(
 {
     if (( *rfp = lock_fopen( file, "r+", lfp )) == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "acquire_lock: "
+       LDAP_LOG ( SLURPD, ERR, "acquire_lock: "
                "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n",
-               (long) getpid(), file ));
+               (long) getpid(), file, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n",
@@ -138,9 +138,9 @@ relinquish_lock(
 {
     if ( lock_fclose( rfp, lfp ) == EOF ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "relinguish_lock: "
+       LDAP_LOG ( SLURPD, ERR, "relinguish_lock: "
                "Error: relinquish_lock (%ld): Error closing \"%s\"\n",
-               (long) getpid(), file ));
+               (long) getpid(), file, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: relinquish_lock (%ld): Error closing \"%s\"\n",
index 8965ff0f79e1f4b0f031f63dba700d53a11a513a..5054b43ca509d3509539d435577c9eca5d949a93 100644 (file)
@@ -123,8 +123,8 @@ main(
                0, fm, (void *) NULL ) != 0 )
        {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "main", LDAP_LEVEL_ERR,
-               "main: file manager ldap_pvt_thread_create failed\n" ));
+       LDAP_LOG ( SLURPD, ERR,
+               "main: file manager ldap_pvt_thread_create failed\n" , 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
                0, 0, 0 );
@@ -165,8 +165,7 @@ main(
     ldap_pvt_thread_destroy();
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "main", LDAP_LEVEL_RESULTS,
-               "main: slurpd terminated\n" ));
+       LDAP_LOG ( SLURPD, RESULTS, "main: slurpd terminated\n", 0, 0, 0 );
 #else
     Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 );
 #endif
index b921728ef0c0ce9760a3fa9280e4f407336a72bc..dbde0bc43dbd947cdb62e61bd858f0b19e659e03 100644 (file)
@@ -83,8 +83,8 @@ Re_free(
     }
     if ( re->re_refcnt > 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_WARNING, "Re_free: "
-               "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn ));
+       LDAP_LOG ( SLURPD, WARNING, "Re_free: "
+               "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Warning: freeing re (dn: %s) with nonzero refcnt\n",
@@ -142,7 +142,7 @@ Re_parse(
 
     if ( re == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_parse: Error: re is NULL\n" ));
+       LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: re is NULL\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Re_parse: error: re is NULL\n", 0, 0, 0 );
 #endif
@@ -150,7 +150,7 @@ Re_parse(
     }
     if ( replbuf == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_parse: Error: replbuf is NULL\n" ));
+       LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: replbuf is NULL\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Re_parse: error: replbuf is NULL\n", 0, 0, 0 );
 #endif
@@ -179,8 +179,8 @@ Re_parse(
        buflen = strlen( buf );
        if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-                       "Re_parse: Error: malformed replog file\n" ));
+               LDAP_LOG ( SLURPD, ERR, 
+                       "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "Error: Re_parse: malformed replog file\n",
@@ -213,8 +213,8 @@ Re_parse(
        default:
            if ( !( state == GOT_ALL )) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-                       "Re_parse: Error: bad type <%s>\n", type ));
+               LDAP_LOG ( SLURPD, ERR, 
+                       "Re_parse: Error: bad type <%s>\n", type, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: Re_parse: bad type <%s>\n",
@@ -233,8 +233,8 @@ Re_parse(
 
     if ( state != GOT_ALL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-               "Re_parse: Error: malformed replog file\n" ));
+       LDAP_LOG ( SLURPD, ERR, 
+               "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: Re_parse: malformed replog file\n",
@@ -256,8 +256,8 @@ Re_parse(
        } else {
            if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-                       "Re_parse: Error: malformed replog line \"%s\"\n", buf ));
+               LDAP_LOG ( SLURPD, ERR, 
+                       "Re_parse: Error: malformed replog line \"%s\"\n", buf, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: malformed replog line \"%s\"\n",
@@ -375,8 +375,8 @@ get_repl_hosts(
        rh = (Rh *) ch_realloc((char *) rh, ( nreplicas + 2 ) * sizeof( Rh ));
        if ( rh == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-                       "get_repl_hosts: Out of memory\n" ));
+               LDAP_LOG ( SLURPD, ERR, 
+                       "get_repl_hosts: Out of memory\n", 0, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Out of memory in get_repl_hosts\n",
                    0, 0, 0 );
@@ -497,7 +497,7 @@ Re_dump(
 
     if ( re == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_dump: re is NULL\n" ));
+       LDAP_LOG ( SLURPD, ERR, "Re_dump: re is NULL\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "Re_dump: re is NULL\n", 0, 0, 0 );
 #endif
@@ -567,8 +567,8 @@ Re_write(
 
     if ( re == NULL || fp == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-               "Re_write: Internal error: NULL argument\n" ));
+       LDAP_LOG ( SLURPD, ERR, 
+               "Re_write: Internal error: NULL argument\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n",
                0, 0, 0 );
@@ -661,8 +661,8 @@ Re_write(
 bad:
     if ( rc != 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_ERR, 
-               "Re_write: Error while writing: %s\n", sys_errlist[ errno ] ));
+       LDAP_LOG ( SLURPD, ERR, 
+               "Re_write: Error while writing: %s\n", sys_errlist[ errno ], 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error while writing: %s\n",
                sys_errlist[ errno ], 0, 0 );
@@ -804,9 +804,9 @@ warn_unknown_replica(
     }
     if ( !found ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "re", LDAP_LEVEL_WARNING, "warn_unknown_replica: "
+       LDAP_LOG ( SLURPD, WARNING, "warn_unknown_replica: "
                "Warning: unknown replica %s:%d found in replication log\n",
-               host, port ));
+               host, port, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Warning: unknown replica %s:%d found in replication log\n",
index a8f2f657b79dca972b265e5f224bdb7144b872ec..91e1c6a11e42daaf4075f738db85893930d7e6f8 100644 (file)
@@ -66,9 +66,9 @@ write_reject(
        if (( rjfd = open( rejfile, O_RDWR | O_APPEND | O_CREAT,
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: "
+               LDAP_LOG ( SLURPD, ERR, "write_reject: "
                        "Error: Cannot create \"%s\":%s\n", 
-                       rejfile, sys_errlist[ errno ] ));
+                       rejfile, sys_errlist[ errno ], 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                "Error: write_reject: Cannot create \"%s\": %s\n",
@@ -82,8 +82,8 @@ write_reject(
     }
     if (( rc = acquire_lock( rejfile, &rfp, &lfp )) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: "
-               "Error: Cannot open reject file \"%s\"\n", rejfile ));
+       LDAP_LOG ( SLURPD, ERR, "write_reject: "
+               "Error: Cannot open reject file \"%s\"\n", rejfile, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: cannot open reject file \"%s\"\n",
                rejfile, 0, 0 );
@@ -97,8 +97,8 @@ write_reject(
        }
        if ((rc = re->re_write( ri, re, rfp )) < 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: "
-                       "Error: Cannot write reject file \"%s\"\n", rejfile ));
+               LDAP_LOG ( SLURPD, ERR, "write_reject: "
+                       "Error: Cannot write reject file \"%s\"\n", rejfile, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY,
                    "Error: cannot write reject file \"%s\"\n",
@@ -107,8 +107,9 @@ write_reject(
        }
        (void) relinquish_lock( rejfile, rfp, lfp );
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: "
-               "Error: ldap operation failed, data written to \"%s\"\n", rejfile ));
+       LDAP_LOG ( SLURPD, ERR, "write_reject: "
+               "Error: ldap operation failed, data written to \"%s\"\n", 
+               rejfile, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: ldap operation failed, data written to \"%s\"\n",
index f5bf393cb1ddbe21bd727fac61a1b5afaf0fcd2a..49fc9e178e0ba0d7cca7408b62505e01c31e2fdb 100644 (file)
@@ -28,7 +28,6 @@
 #include "slurp.h"
 #include "globals.h"
 
-
 /*
  * Just invoke the Ri's process() member function, and log the start and
  * finish.
@@ -41,9 +40,9 @@ replicate(
     Ri         *ri = (Ri *) ri_arg;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replica", LDAP_LEVEL_ARGS, "replicate: "
+       LDAP_LOG ( SLURPD, ARGS, "replicate: "
                "begin replication thread for %s:%d\n",
-           ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port ));
+           ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
            ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
@@ -52,9 +51,9 @@ replicate(
     ri->ri_process( ri );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replica", LDAP_LEVEL_ARGS, "replicate: "
+       LDAP_LOG ( SLURPD, ARGS, "replicate: "
                "begin replication thread for %s:%d\n",
-           ri->ri_hostname, ri->ri_port ));
+           ri->ri_hostname, ri->ri_port, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS, "end replication thread for %s:%d\n",
            ri->ri_hostname, ri->ri_port, 0 );
@@ -76,9 +75,9 @@ start_replica_thread(
     if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate,
            (void *) ri ) != 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replica", LDAP_LEVEL_ERR, "start_replica_thread: "
+       LDAP_LOG ( SLURPD, ERR, "start_replica_thread: "
                "replica %s:%d ldap_pvt_thread_create failed\n",
-           ri->ri_hostname, ri->ri_port ));
+           ri->ri_hostname, ri->ri_port, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n",
                ri->ri_hostname, ri->ri_port, 0 );
index f43965b8e7687d74569f9c66381d6efe07f0fa25..d1f63a2295f7668b69af411fb984d5637f01e532 100644 (file)
@@ -59,8 +59,8 @@ copy_replog(
     char       *p;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ARGS, "copy_replog: "
-               "copy replog \"%s\" to \"%s\"\n", src, dst ));
+       LDAP_LOG ( SLURPD, ARGS, "copy_replog: "
+               "copy replog \"%s\" to \"%s\"\n", src, dst, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS,
            "copy replog \"%s\" to \"%s\"\n", 
@@ -79,9 +79,9 @@ copy_replog(
     }
     if ( access( buf, W_OK ) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
                "Error: (%ld): Directory %s is not writable\n",
-               (long) getpid(), buf ));
+               (long) getpid(), buf, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog (%ld): Directory %s is not writable\n",
@@ -97,9 +97,9 @@ copy_replog(
     }
     if ( access( buf, W_OK ) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
                "Error: (%ld): Directory %s is not writable\n",
-               (long) getpid(), buf ));
+               (long) getpid(), buf, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog (%ld): Directory %s is not writable\n",
@@ -112,9 +112,9 @@ copy_replog(
     rfp = lock_fopen( src, "r", &lfp );
     if ( rfp == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
                "Error: Can't lock replog \"%s\" for read: %s\n",
-               src, sys_errlist[ errno ] ));
+               src, sys_errlist[ errno ], 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog: Can't lock replog \"%s\" for read: %s\n",
@@ -127,9 +127,9 @@ copy_replog(
     dfp = lock_fopen( dst, "a", &dlfp );
     if ( dfp == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
                "Error: Can't lock replog \"%s\" for write: %s\n",
-               src, sys_errlist[ errno ] ));
+               src, sys_errlist[ errno ], 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n",
@@ -153,8 +153,8 @@ copy_replog(
 
     if ( lock_fclose( dfp, dlfp ) == EOF ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
-               "Error: Error closing \"%s\"\n", src ));
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
+               "Error: Error closing \"%s\"\n", src, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog: Error closing \"%s\"\n",
@@ -163,8 +163,8 @@ copy_replog(
     }
     if ( lock_fclose( rfp, lfp ) == EOF ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: "
-               "Error: Error closing \"%s\"\n", src ));
+       LDAP_LOG ( SLURPD, ERR, "copy_replog: "
+               "Error: Error closing \"%s\"\n", src, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY,
                "Error: copy_replog: Error closing \"%s\"\n",
index f7f2227875e3ebdfacbc804fa8b3029245007ff1..c9f0a4ffa1ce5a9e17500e5bc1d14fa1887f69aa 100644 (file)
@@ -58,8 +58,8 @@ Ri_process(
 #endif
     if ( ri == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "ri", LDAP_LEVEL_ERR, "Ri_process: "
-               "Error: ri == NULL!\n" ));
+       LDAP_LOG ( SLURPD, ERR, "Ri_process: "
+               "Error: ri == NULL!\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error: Ri_process: ri == NULL!\n", 0, 0, 0 );
 #endif
@@ -93,9 +93,9 @@ Ri_process(
            if ( !ismine( ri, re )) {
                /* The Re doesn't list my host:port */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: "
+               LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
                        "Replica %s:%d, skip repl record for %s (not mine)\n",
-                       ri->ri_hostname, ri->ri_port, re->re_dn ));
+                       ri->ri_hostname, ri->ri_port, re->re_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "Replica %s:%d, skip repl record for %s (not mine)\n",
@@ -104,9 +104,9 @@ Ri_process(
            } else if ( !isnew( ri, re )) {
                /* This Re is older than my saved status information */
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: "
+               LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
                        "Replica %s:%d, skip repl record for %s (old)\n",
-                       ri->ri_hostname, ri->ri_port, re->re_dn ));
+                       ri->ri_hostname, ri->ri_port, re->re_dn );
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "Replica %s:%d, skip repl record for %s (old)\n",
@@ -118,9 +118,9 @@ Ri_process(
                case DO_LDAP_ERR_RETRYABLE:
                    ldap_pvt_thread_sleep( RETRY_SLEEP_TIME );
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: "
+                       LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
                                "Retrying operation for DN %s on replica %s:%d\n",
-                           re->re_dn, ri->ri_hostname, ri->ri_port ));
+                           re->re_dn, ri->ri_hostname, ri->ri_port );
 #else
                    Debug( LDAP_DEBUG_ANY,
                            "Retrying operation for DN %s on replica %s:%d\n",
@@ -148,8 +148,8 @@ Ri_process(
            }
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "ri", LDAP_LEVEL_ERR, "Ri_process: "
-                       "Error: re is null in Ri_process\n" ));
+               LDAP_LOG ( SLURPD, ERR, "Ri_process: "
+                       "Error: re is null in Ri_process\n", 0, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Error: re is null in Ri_process\n",
                    0, 0, 0 );
index 37098c9f3649e23aa29a1a943c8d63350d922039..87f2daeb59ee07ce0b8f22d40dba17937334cc96 100644 (file)
@@ -55,7 +55,6 @@
 #include "slurp.h"
 #include "globals.h"
 
-
 /*
  * Lock the replication queue.
  */
@@ -134,8 +133,8 @@ Rq_delhead(
 
     if ( savedhead->re_getrefcnt( savedhead ) != 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_WARNING, "Rq_delhead: "
-               "Warning: attempt to delete when refcnt != 0\n" ));
+       LDAP_LOG ( SLURPD, WARNING, "Rq_delhead: "
+               "Warning: attempt to delete when refcnt != 0\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Warning: attempt to delete when refcnt != 0\n",
                0, 0, 0 );
@@ -223,7 +222,7 @@ Rq_gc(
 {
     if ( rq == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_DETAIL1, "Rq_gc: rq is NULL!\n" ));
+       LDAP_LOG ( SLURPD, DETAIL1, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
 #endif
@@ -255,7 +254,7 @@ Rq_dump(
 
     if ( rq == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ARGS, "Rq_dump: rq is NULL!\n" ));
+       LDAP_LOG ( SLURPD, ARGS, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
 #endif
@@ -264,8 +263,8 @@ Rq_dump(
 
     if (unlink(SLURPD_DUMPFILE) == -1 && errno != ENOENT) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE ));
+       LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
+               "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: \"%s\" exists, and cannot unlink\n",
                SLURPD_DUMPFILE, 0, 0 );
@@ -274,8 +273,8 @@ Rq_dump(
     }
     if (( tmpfd = open(SLURPD_DUMPFILE, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "cannot open \"%s\" for write\n", SLURPD_DUMPFILE ));
+       LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
+               "cannot open \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot open \"%s\" for write\n",
                SLURPD_DUMPFILE, 0, 0 );
@@ -284,8 +283,8 @@ Rq_dump(
     }
     if (( fp = fdopen( tmpfd, "w" )) == NULL ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE ));
+       LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
+               "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot fdopen \"%s\" for write\n",
                SLURPD_DUMPFILE, 0, 0 );
@@ -322,8 +321,8 @@ Rq_write(
     }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ENTRY, "Rq_write: "
-               "re-write on-disk replication log\n" ));
+       LDAP_LOG ( SLURPD, ENTRY, "Rq_write: "
+               "re-write on-disk replication log\n", 0, 0, 0 );
 #else
     Debug( LDAP_DEBUG_ARGS, "re-write on-disk replication log\n",
            0, 0, 0 );
@@ -346,8 +345,8 @@ Rq_write(
     /* and truncate to correct len */
     if ( ftruncate( fileno( fp ), sglob->srpos ) < 0 ) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_write: "
-               "Error truncating replication log: %s\n", sys_errlist[ errno ] ));
+       LDAP_LOG ( SLURPD, ERR, "Rq_write: "
+               "Error truncating replication log: %s\n", sys_errlist[ errno ], 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "Error truncating replication log: %s\n",
                sys_errlist[ errno ], 0, 0 );
index ffe150ea241b505aa705b89e42a3e39f5a164e49..f6cc685fff707f09ae6b80d1bf3000aed072c2e0 100644 (file)
@@ -98,9 +98,9 @@ St_write (
                &(st->st_lfp))) < 0 ) {
            if ( !st->st_err_logged ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "st", LDAP_LEVEL_ERR, "St_write: "
+               LDAP_LOG ( SLURPD, ERR, "St_write: "
                        "Error: cannot open status file \"%s\":%s\n",
-                       sglob->slurpd_status_file, sys_errlist[ errno ] ));
+                       sglob->slurpd_status_file, sys_errlist[ errno ], 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "Error: cannot open status file \"%s\": %s\n",
@@ -184,9 +184,9 @@ St_read(
         */
        if (( fp = fopen( sglob->slurpd_status_file, "w" )) == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "st", LDAP_LEVEL_ERR, "St_write: "
+               LDAP_LOG ( SLURPD, ERR, "St_write: "
                        "Error: cannot create status file \"%s\"\n",
-                   sglob->slurpd_status_file ));
+                   sglob->slurpd_status_file, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ANY, "Error: cannot create status file \"%s\"\n",
                    sglob->slurpd_status_file, 0, 0 );
@@ -197,8 +197,8 @@ St_read(
        (void) fclose( fp );
        ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "st", LDAP_LEVEL_DETAIL1, "St_write: "
-               "No status file found, defaulting values\n" ));
+       LDAP_LOG ( SLURPD, DETAIL1, "St_write: "
+               "No status file found, defaulting values\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "No status file found, defaulting values\n",
                0, 0, 0 );
@@ -248,17 +248,17 @@ St_read(
            sprintf( tbuf, "%s:%s (timestamp %s.%s)", hostname, port,
                    timestamp, seq );
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "st", LDAP_LEVEL_DETAIL1, "St_write: "
-                       "Retrieved state information for %s\n", tbuf ));
+               LDAP_LOG ( SLURPD, DETAIL1, "St_write: "
+                       "Retrieved state information for %s\n", tbuf, 0, 0 );
 #else
            Debug( LDAP_DEBUG_ARGS,
                    "Retrieved state information for %s\n", tbuf, 0, 0 );
 #endif
        } else {
 #ifdef NEW_LOGGING
-               LDAP_LOG (( "st", LDAP_LEVEL_WARNING, "St_write: "
+               LDAP_LOG ( SLURPD, WARNING, "St_write: "
                        "Warning: saved state for %s:%s, not a known replica\n", 
-                       hostname, port ));
+                       hostname, port, 0 );
 #else
            Debug(  LDAP_DEBUG_ANY,
                    "Warning: saved state for %s:%s, not a known replica\n",