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