diff options
Diffstat (limited to 'ldap/include')
-rw-r--r-- | ldap/include/ldaplog.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ldap/include/ldaplog.h b/ldap/include/ldaplog.h index 195f67c0..ef3559e4 100644 --- a/ldap/include/ldaplog.h +++ b/ldap/include/ldaplog.h @@ -73,9 +73,15 @@ extern "C" { /* Disable by default */ #define LDAPDebug( level, fmt, arg1, arg2, arg3 ) #define LDAPDebugLevelIsSet( level ) (0) +#define LDAPDebug0Args( level, fmt ) +#define LDAPDebug1Arg( level, fmt, arg ) +#define LDAPDebug2Args( level, fmt, arg1, arg2 ) #ifdef LDAP_DEBUG # undef LDAPDebug +# undef LDAPDebug0Args +# undef LDAPDebug1Arg +# undef LDAPDebug2Args # undef LDAPDebugLevelIsSet /* SLAPD_LOGGING should not be on for WINSOCK (16-bit Windows) */ @@ -90,6 +96,24 @@ extern "C" { slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \ } \ } +# define LDAPDebug0Args( level, fmt ) \ + { \ + if ( *module_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt ); \ + } \ + } +# define LDAPDebug1Arg( level, fmt, arg ) \ + { \ + if ( *module_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt, arg ); \ + } \ + } +# define LDAPDebug2Args( level, fmt, arg1, arg2 ) \ + { \ + if ( *module_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt, arg1, arg2 ); \ + } \ + } # define LDAPDebugLevelIsSet( level ) (0 != (*module_ldap_debug & level)) # else /* Not _WIN32 */ extern int slapd_ldap_debug; @@ -99,6 +123,24 @@ extern "C" { slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \ } \ } +# define LDAPDebug0Args( level, fmt ) \ + { \ + if ( slapd_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt ); \ + } \ + } +# define LDAPDebug1Arg( level, fmt, arg ) \ + { \ + if ( slapd_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt, arg ); \ + } \ + } +# define LDAPDebug2Args( level, fmt, arg1, arg2 ) \ + { \ + if ( slapd_ldap_debug & level ) { \ + slapd_log_error_proc( NULL, fmt, arg1, arg2 ); \ + } \ + } # define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level)) # endif /* Win32 */ # else /* no SLAPD_LOGGING */ @@ -110,6 +152,24 @@ extern "C" { PR_snprintf( msg, sizeof(msg), fmt, arg1, arg2, arg3 ); \ ber_err_print( msg ); \ } +# define LDAPDebug0Args( level, fmt ) \ + if ( slapd_ldap_debug & level ) { \ + char msg[256]; \ + PR_snprintf( msg, sizeof(msg), fmt ); \ + ber_err_print( msg ); \ + } +# define LDAPDebug1Arg( level, fmt, arg ) \ + if ( slapd_ldap_debug & level ) { \ + char msg[256]; \ + PR_snprintf( msg, sizeof(msg), fmt, arg ); \ + ber_err_print( msg ); \ + } +# define LDAPDebug2Args( level, fmt, arg1, arg2 ) \ + if ( slapd_ldap_debug & level ) { \ + char msg[256]; \ + PR_snprintf( msg, sizeof(msg), fmt, arg1, arg2 ); \ + ber_err_print( msg ); \ + } # define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level)) # endif /* SLAPD_LOGGING */ #endif /* LDAP_DEBUG */ |