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