2008-03-28 07:05:10 -04:00
|
|
|
// $OpenLDAP$
|
2000-09-01 14:46:32 -04:00
|
|
|
/*
|
2011-03-28 21:08:19 -04:00
|
|
|
* Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
|
2000-09-01 14:46:32 -04:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_H
|
|
|
|
|
#define DEBUG_H
|
|
|
|
|
#include <iostream>
|
2000-10-11 13:18:27 -04:00
|
|
|
#include "config.h"
|
2000-09-01 14:46:32 -04:00
|
|
|
#define LDAP_DEBUG_NONE 0x0000
|
|
|
|
|
#define LDAP_DEBUG_TRACE 0x0001
|
2000-10-03 14:25:34 -04:00
|
|
|
#define LDAP_DEBUG_CONSTRUCT 0x0002
|
|
|
|
|
#define LDAP_DEBUG_DESTROY 0x0004
|
2000-09-01 14:46:32 -04:00
|
|
|
#define LDAP_DEBUG_PARAMETER 0x0008
|
2000-10-11 13:18:27 -04:00
|
|
|
#define LDAP_DEBUG_ANY 0xffff
|
2000-09-01 14:46:32 -04:00
|
|
|
|
|
|
|
|
#define DEBUGLEVEL LDAP_DEBUG_ANY
|
|
|
|
|
|
|
|
|
|
#define PRINT_FILE \
|
2001-09-28 12:39:58 -04:00
|
|
|
std::cerr << "file: " __FILE__ << " line: " << __LINE__
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2000-10-05 10:16:16 -04:00
|
|
|
#ifdef WITH_DEBUG
|
2000-09-01 14:46:32 -04:00
|
|
|
#define DEBUG(level, arg) \
|
2000-10-03 14:25:34 -04:00
|
|
|
if((level) & DEBUGLEVEL){ \
|
2001-09-28 12:39:58 -04:00
|
|
|
std::cerr << arg ; \
|
2000-09-01 14:46:32 -04:00
|
|
|
}
|
2000-10-05 10:16:16 -04:00
|
|
|
#else
|
|
|
|
|
#undef DEBUG
|
|
|
|
|
#define DEBUG(level,arg)
|
|
|
|
|
#endif //WITH_DEBUG
|
2000-09-01 14:46:32 -04:00
|
|
|
|
|
|
|
|
#endif // DEBUG_H
|