3 * Copyright 1998,1999 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 extern int ldap_debug;
52 #endif /* !ldap_debug */
55 extern int ldap_syslog;
56 extern int ldap_syslog_level;
57 #endif /* LDAP_SYSLOG */
59 /* this doesn't below as part of ldap.h */
61 #define Debug( level, fmt, arg1, arg2, arg3 ) \
63 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
64 if ( ldap_syslog & (level) ) \
65 syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
69 #define Debug( level, fmt, arg1, arg2, arg3 ) \
70 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) )
73 #else /* LDAP_DEBUG */
74 #define Debug( level, fmt, arg1, arg2, arg3 )
75 #endif /* LDAP_DEBUG */
77 LDAP_F(void) lutil_debug LDAP_P((
79 const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4)));
83 #endif /* _LDAP_LOG_H */