X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fldap_log.h;h=94a73bd893ba9c74a9167218ba8908ea7f332fbd;hb=5830fbc6c0dfff6a93c47ae3681c863c9a51ecd9;hp=f8b708005f246bef40721de3c1d706921b7745c6;hpb=acbb5cf689a4336af05c9f259d909d8141055bac;p=openldap diff --git a/include/ldap_log.h b/include/ldap_log.h index f8b708005f..94a73bd893 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2014 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -123,7 +123,7 @@ LDAP_BEGIN_DECL #define LDAP_DEBUG_SYNC 0x4000 #define LDAP_DEBUG_NONE 0x8000 -#define LDAP_DEBUG_ANY -1 +#define LDAP_DEBUG_ANY (-1) /* debugging stuff */ #ifdef LDAP_DEBUG @@ -226,28 +226,43 @@ extern void eb_syslog(int pri, const char *fmt, ...); lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \ } while ( 0 ) #define Debug( level, fmt, arg1, arg2, arg3 ) \ - Log3( (level), (fmt), (arg1), (arg2), (arg3) ) + Log3( (level), 0, (fmt), (arg1), (arg2), (arg3) ) #define LogTest(level) ( ldap_debug & (level) ) #endif /* ! LDAP_SYSLOG */ #else /* ! LDAP_DEBUG */ /* TODO: in case LDAP_DEBUG is undefined, make sure logs with appropriate * severity gets thru anyway */ -#define Log0( level, severity, fmt ) -#define Log1( level, severity, fmt, arg1 ) -#define Log2( level, severity, fmt, arg1, arg2 ) -#define Log3( level, severity, fmt, arg1, arg2, arg3 ) -#define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 ) -#define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 ) -#define Debug( level, fmt, arg1, arg2, arg3 ) +#define Log0( level, severity, fmt ) ((void)0) +#define Log1( level, severity, fmt, arg1 ) ((void)0) +#define Log2( level, severity, fmt, arg1, arg2 ) ((void)0) +#define Log3( level, severity, fmt, arg1, arg2, arg3 ) ((void)0) +#define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 ) ((void)0) +#define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 ) ((void)0) +#define Debug( level, fmt, arg1, arg2, arg3 ) ((void)0) #define LogTest(level) ( 0 ) #endif /* ! LDAP_DEBUG */ +/* Actually now in liblber/debug.c */ LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file )); LDAP_LUTIL_F(void) lutil_debug LDAP_P(( int debug, int level, const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4))); +#ifdef LDAP_DEFINE_LDAP_DEBUG +/* This struct matches the head of ldapoptions in */ +struct ldapoptions_prefix { + short ldo_valid; + int ldo_debug; +}; +#define ldap_debug \ + (*(int *) ((char *)&ldap_int_global_options \ + + offsetof(struct ldapoptions_prefix, ldo_debug))) + +struct ldapoptions; +LDAP_V ( struct ldapoptions ) ldap_int_global_options; +#endif /* LDAP_DEFINE_LDAP_DEBUG */ + LDAP_END_DECL #endif /* LDAP_LOG_H */