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