3 * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
12 * Copyright (c) 1990 Regents of the University of Michigan.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms are permitted
16 * provided that this notice is preserved and that due credit is given
17 * to the University of Michigan at Ann Arbor. The name of the University
18 * may not be used to endorse or promote products derived from this
19 * software without specific prior written permission. This software
20 * is provided ``as is'' without express or implied warranty.
26 #include <ldap_cdefs.h>
30 #define LDAP_DEBUG_TRACE 0x0001
31 #define LDAP_DEBUG_PACKETS 0x0002
32 #define LDAP_DEBUG_ARGS 0x0004
33 #define LDAP_DEBUG_CONNS 0x0008
34 #define LDAP_DEBUG_BER 0x0010
35 #define LDAP_DEBUG_FILTER 0x0020
36 #define LDAP_DEBUG_CONFIG 0x0040
37 #define LDAP_DEBUG_ACL 0x0080
38 #define LDAP_DEBUG_STATS 0x0100
39 #define LDAP_DEBUG_STATS2 0x0200
40 #define LDAP_DEBUG_SHELL 0x0400
41 #define LDAP_DEBUG_PARSE 0x0800
43 #define LDAP_DEBUG_DEPRECATED 0x1000
44 #define LDAP_DEBUG_NONE 0x8000
45 #define LDAP_DEBUG_ANY -1
51 * This is a bogus extern declaration for the compiler. No need to ensure
52 * a 'proper' dllimport.
55 extern int ldap_debug;
56 #endif /* !ldap_debug */
59 extern int ldap_syslog;
60 extern int ldap_syslog_level;
61 #endif /* LDAP_SYSLOG */
63 /* this doesn't below as part of ldap.h */
65 #define Debug( level, fmt, arg1, arg2, arg3 ) \
67 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
68 if ( ldap_syslog & (level) ) \
69 syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
73 #define Debug( level, fmt, arg1, arg2, arg3 ) \
74 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) )
77 #else /* LDAP_DEBUG */
78 #define Debug( level, fmt, arg1, arg2, arg3 )
79 #endif /* LDAP_DEBUG */
81 LIBLUTIL_F(void) lutil_debug LDAP_P((
83 const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4)));
87 #endif /* _LDAP_LOG_H */