00001
00002
00003
00004
00005
00006 #ifndef DEBUG_H
00007 #define DEBUG_H
00008 #include <iostream>
00009 #include "config.h"
00010 #define LDAP_DEBUG_NONE 0x0000
00011 #define LDAP_DEBUG_TRACE 0x0001
00012 #define LDAP_DEBUG_CONSTRUCT 0x0002
00013 #define LDAP_DEBUG_DESTROY 0x0004
00014 #define LDAP_DEBUG_PARAMETER 0x0008
00015 #define LDAP_DEBUG_ANY 0xffff
00016
00017 #define DEBUGLEVEL LDAP_DEBUG_ANY
00018
00019 #define PRINT_FILE \
00020 std::cerr << "file: " __FILE__ << " line: " << __LINE__
00021
00022 #ifdef WITH_DEBUG
00023 #define DEBUG(level, arg) \
00024 if((level) & DEBUGLEVEL){ \
00025 std::cerr << arg ; \
00026 }
00027 #else
00028 #undef DEBUG
00029 #define DEBUG(level,arg)
00030 #endif //WITH_DEBUG
00031
00032 #endif // DEBUG_H