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>
24 extern int ldap_debug;
25 #endif /* !ldap_debug */
28 extern int ldap_syslog;
29 extern int ldap_syslog_level;
30 #endif /* LDAP_SYSLOG */
32 #define LDAP_DEBUG_TRACE 0x0001
33 #define LDAP_DEBUG_PACKETS 0x0002
34 #define LDAP_DEBUG_ARGS 0x0004
35 #define LDAP_DEBUG_CONNS 0x0008
36 #define LDAP_DEBUG_BER 0x0010
37 #define LDAP_DEBUG_FILTER 0x0020
38 #define LDAP_DEBUG_CONFIG 0x0040
39 #define LDAP_DEBUG_ACL 0x0080
40 #define LDAP_DEBUG_STATS 0x0100
41 #define LDAP_DEBUG_STATS2 0x0200
42 #define LDAP_DEBUG_SHELL 0x0400
43 #define LDAP_DEBUG_PARSE 0x0800
45 #define LDAP_DEBUG_NONE 0x8000
46 #define LDAP_DEBUG_ANY -1
48 /* this doesn't below as part of ldap.h */
50 #define Debug( level, fmt, arg1, arg2, arg3 ) \
52 if ( ldap_debug & (level) ) \
53 fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
54 if ( ldap_syslog & level ) \
55 syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
57 #else /* LDAP_SYSLOG */
59 #define Debug( level, fmt, arg1, arg2, arg3 ) \
60 if ( ldap_debug & (level) ) \
61 fprintf( stderr, (fmt), (arg1), (arg2), (arg3) );
63 extern void Debug( int level, char* fmt, ... );
65 #endif /* LDAP_SYSLOG */
66 #else /* LDAP_DEBUG */
67 #define Debug( level, fmt, arg1, arg2, arg3 )
68 #endif /* LDAP_DEBUG */
72 #endif /* _LDAP_LOG_H */