Debian Codegraph @

contrib/ldapc++/src/debug.h

raw
1 // $OpenLDAP$
2 /*
3 * Copyright 2000-2024 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5 */
6
7 #ifndef DEBUG_H
8 #define DEBUG_H
9 #include <iostream>
10 #include "config.h"
11 #define LDAP_DEBUG_NONE 0x0000
12 #define LDAP_DEBUG_TRACE 0x0001
13 #define LDAP_DEBUG_CONSTRUCT 0x0002
14 #define LDAP_DEBUG_DESTROY 0x0004
15 #define LDAP_DEBUG_PARAMETER 0x0008
16 #define LDAP_DEBUG_ANY 0xffff
17
18 #define DEBUGLEVEL LDAP_DEBUG_ANY
19
20 #define PRINT_FILE \
21 std::cerr << "file: " __FILE__ << " line: " << __LINE__
22
23 #ifdef WITH_DEBUG
24 #define DEBUG(level, arg) \
25 if((level) & DEBUGLEVEL){ \
26 std::cerr << arg ; \
27 }
28 #else
29 #undef DEBUG
30 #define DEBUG(level,arg)
31 #endif //WITH_DEBUG
32
33 #endif // DEBUG_H