mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
Make all debug output macros conditional on defined(LDAP_DEBUG).
This commit is contained in:
parent
af0bd5ab68
commit
42de322f06
@ -139,6 +139,9 @@ LDAP_BEGIN_DECL
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
extern int ldap_loglevels[LDAP_SUBSYS_NUM];
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
|
||||
#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)\
|
||||
@ -150,10 +153,13 @@ extern int ldap_loglevels[LDAP_SUBSYS_NUM];
|
||||
(ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
|
||||
ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)
|
||||
|
||||
#endif /* LDAP_LOG */
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
#endif /* NEW_LOGGING */
|
||||
|
||||
#ifndef LDAP_LOG
|
||||
#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3)
|
||||
#define LDAP_LOGS_TEST(a, b) 0
|
||||
#endif
|
||||
|
||||
LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( const char *level ));
|
||||
|
@ -58,6 +58,9 @@
|
||||
#include "ldap_log.h"
|
||||
|
||||
#undef Debug
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
|
||||
#define Debug( level, fmt, arg1, arg2, arg3 ) \
|
||||
do { if ( ldap_debug & level ) \
|
||||
ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) ); \
|
||||
@ -66,6 +69,13 @@
|
||||
#define LDAP_Debug( subsystem, level, fmt, arg1, arg2, arg3 )\
|
||||
ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) )
|
||||
|
||||
#else
|
||||
|
||||
#define Debug( level, fmt, arg1, arg2, arg3 ) ((void)0)
|
||||
#define LDAP_Debug( subsystem, level, fmt, arg1, arg2, arg3 ) ((void)0)
|
||||
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
#include "ldap.h"
|
||||
|
||||
#include "ldap_pvt.h"
|
||||
|
@ -52,11 +52,19 @@ int ldap_int_inet4or6 = AF_INET;
|
||||
* ftp://koobera.math.uic.edu/www/docs/connect.html.
|
||||
*/
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
|
||||
#define osip_debug(ld,fmt,arg1,arg2,arg3) \
|
||||
do { \
|
||||
ldap_log_printf(NULL, LDAP_DEBUG_TRACE, fmt, arg1, arg2, arg3); \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
|
||||
#define osip_debug(ld,fmt,arg1,arg2,arg3) ((void)0)
|
||||
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
static void
|
||||
ldap_pvt_set_errno(int err)
|
||||
{
|
||||
|
@ -47,11 +47,19 @@
|
||||
|
||||
/* int ldap_int_tblsize = 0; */
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
|
||||
#define oslocal_debug(ld,fmt,arg1,arg2,arg3) \
|
||||
do { \
|
||||
ldap_log_printf(ld, LDAP_DEBUG_TRACE, fmt, arg1, arg2, arg3); \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
|
||||
#define oslocal_debug(ld,fmt,arg1,arg2,arg3) ((void)0)
|
||||
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
static void
|
||||
ldap_pvt_set_errno(int err)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user