xref: /titanic_51/usr/src/lib/libldap5/include/ldap/ldaplog.h (revision 342440ec94087b8c751c580ab9ed6c693d31d418)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * The contents of this file are subject to the Netscape Public
5  * License Version 1.1 (the "License"); you may not use this file
6  * except in compliance with the License. You may obtain a copy of
7  * the License at http://www.mozilla.org/NPL/
8  *
9  * Software distributed under the License is distributed on an "AS
10  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * rights and limitations under the License.
13  *
14  * The Original Code is Mozilla Communicator client code, released
15  * March 31, 1998.
16  *
17  * The Initial Developer of the Original Code is Netscape
18  * Communications Corporation. Portions created by Netscape are
19  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
20  * Rights Reserved.
21  *
22  * Contributor(s):
23  */
24 
25 #ifndef _LDAPLOG_H
26 #define _LDAPLOG_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define LDAP_DEBUG_TRACE	0x00001
33 #define LDAP_DEBUG_PACKETS	0x00002
34 #define LDAP_DEBUG_ARGS		0x00004
35 #define LDAP_DEBUG_CONNS	0x00008
36 #define LDAP_DEBUG_BER		0x00010
37 #define LDAP_DEBUG_FILTER	0x00020
38 #define LDAP_DEBUG_CONFIG	0x00040
39 #define LDAP_DEBUG_ACL		0x00080
40 #define LDAP_DEBUG_STATS	0x00100
41 #define LDAP_DEBUG_STATS2	0x00200
42 #define LDAP_DEBUG_SHELL	0x00400
43 #define LDAP_DEBUG_PARSE	0x00800
44 #define LDAP_DEBUG_HOUSE        0x01000
45 #define LDAP_DEBUG_REPL         0x02000
46 #define LDAP_DEBUG_ANY          0x04000
47 #define LDAP_DEBUG_CACHE        0x08000
48 #define LDAP_DEBUG_PLUGIN	0x10000
49 
50 /* debugging stuff */
51 /* Disable by default */
52 #define LDAPDebug( level, fmt, arg1, arg2, arg3 )
53 
54 #ifdef LDAP_DEBUG
55 #  undef LDAPDebug
56 
57 /* SLAPD_LOGGING should not be on for WINSOCK (16-bit Windows) */
58 #  if defined(SLAPD_LOGGING)
59 #    ifdef _WIN32
60        extern int	*module_ldap_debug;
61 #      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
62        { \
63 		if ( *module_ldap_debug & level ) { \
64 		        slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
65 	    } \
66        }
67 #    else /* _WIN32 */
68        extern int	ldap_debug;
69 #      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
70        { \
71 		if ( ldap_debug & level ) { \
72 		        slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
73 	    } \
74        }
75 #    endif /* Win32 */
76 #  else /* no SLAPD_LOGGING */
77      extern void ber_err_print( char * );
78      extern int	ldap_debug;
79 #    define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
80 		if ( ldap_debug & level ) { \
81 			char msg[256]; \
82 			sprintf( msg, fmt, arg1, arg2, arg3 ); \
83 			ber_err_print( msg ); \
84 		}
85 #  endif /* SLAPD_LOGGING */
86 #endif /* LDAP_DEBUG */
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* _LDAP_H */
93