2 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5 * Redistribution and use in source and binary forms are permitted only
6 * as authorized by the OpenLDAP Public License. A copy of this
7 * license is available at http://www.OpenLDAP.org/license.html or
8 * in file LICENSE in the top-level directory of the distribution.
11 * Copyright (c) 1990 Regents of the University of Michigan.
12 * All rights reserved.
14 * Redistribution and use in source and binary forms are permitted
15 * provided that this notice is preserved and that due credit is given
16 * to the University of Michigan at Ann Arbor. The name of the University
17 * may not be used to endorse or promote products derived from this
18 * software without specific prior written permission. This software
19 * is provided ``as is'' without express or implied warranty.
25 #include <ldap_cdefs.h>
29 #define LDAP_DEBUG_TRACE 0x0001
30 #define LDAP_DEBUG_PACKETS 0x0002
31 #define LDAP_DEBUG_ARGS 0x0004
32 #define LDAP_DEBUG_CONNS 0x0008
33 #define LDAP_DEBUG_BER 0x0010
34 #define LDAP_DEBUG_FILTER 0x0020
35 #define LDAP_DEBUG_CONFIG 0x0040
36 #define LDAP_DEBUG_ACL 0x0080
37 #define LDAP_DEBUG_STATS 0x0100
38 #define LDAP_DEBUG_STATS2 0x0200
39 #define LDAP_DEBUG_SHELL 0x0400
40 #define LDAP_DEBUG_PARSE 0x0800
42 #define LDAP_DEBUG_DEPRECATED 0x1000
43 #define LDAP_DEBUG_NONE 0x8000
44 #define LDAP_DEBUG_ANY -1
50 extern int ldap_debug;
51 #endif /* !ldap_debug */
54 extern int ldap_syslog;
55 extern int ldap_syslog_level;
56 #endif /* LDAP_SYSLOG */
58 /* this doesn't below as part of ldap.h */
60 #define Debug( level, fmt, arg1, arg2, arg3 ) \
62 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
63 if ( ldap_syslog & (level) ) \
64 syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
68 #define Debug( level, fmt, arg1, arg2, arg3 ) \
69 lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) )
72 #else /* LDAP_DEBUG */
73 #define Debug( level, fmt, arg1, arg2, arg3 )
74 #endif /* LDAP_DEBUG */
76 LDAP_F(void) lutil_debug LDAP_P((
78 const char* fmt, ... ));
82 #endif /* _LDAP_LOG_H */