2 * Copyright (c) 1990 Regents of the University of Michigan.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that this notice is preserved and that due credit is given
7 * to the University of Michigan at Ann Arbor. The name of the University
8 * may not be used to endorse or promote products derived from this
9 * software without specific prior written permission. This software
10 * is provided ``as is'' without express or implied warranty.
16 #include <ldap_cdefs.h>
22 extern int ldap_debug;
24 extern int ldap_syslog;
25 extern int ldap_syslog_level;
26 #endif /* LDAP_SYSLOG */
28 #define LDAP_DEBUG_TRACE 0x001
29 #define LDAP_DEBUG_PACKETS 0x002
30 #define LDAP_DEBUG_ARGS 0x004
31 #define LDAP_DEBUG_CONNS 0x008
32 #define LDAP_DEBUG_BER 0x010
33 #define LDAP_DEBUG_FILTER 0x020
34 #define LDAP_DEBUG_CONFIG 0x040
35 #define LDAP_DEBUG_ACL 0x080
36 #define LDAP_DEBUG_STATS 0x100
37 #define LDAP_DEBUG_STATS2 0x200
38 #define LDAP_DEBUG_SHELL 0x400
39 #define LDAP_DEBUG_PARSE 0x800
40 #define LDAP_DEBUG_ANY 0xffff
42 /* this doesn't below as part of ldap.h */
44 #define Debug( level, fmt, arg1, arg2, arg3 ) \
46 if ( ldap_debug & (level) ) \
47 fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
48 if ( ldap_syslog & level ) \
49 syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
51 #else /* LDAP_SYSLOG */
53 #define Debug( level, fmt, arg1, arg2, arg3 ) \
54 if ( ldap_debug & (level) ) \
55 fprintf( stderr, (fmt), (arg1), (arg2), (arg3) );
57 extern void Debug( int level, char* fmt, ... );
59 #endif /* LDAP_SYSLOG */
60 #else /* LDAP_DEBUG */
61 #define Debug( level, fmt, arg1, arg2, arg3 )
62 #endif /* LDAP_DEBUG */
66 #endif /* _LDAP_LOG_H */