]> www.ginac.de Git - ginac.git/blob - ginac/debugmsg.h
- switched to automake build environment
[ginac.git] / ginac / debugmsg.h
1 /** @file debugmsg.h
2  *
3  *  Utilities needed for debugging only. */
4
5 #ifndef _DEBUGMSG_H_
6 #define _DEBUGMSG_H_
7
8 #ifdef _DEBUG
9 #define VERBOSE
10 #define DOASSERT (VERBOSE||DEBUG)
11 #endif
12
13 #define LOGLEVEL_CONSTRUCT          0x0001
14 #define LOGLEVEL_DESTRUCT           0x0002
15 #define LOGLEVEL_ASSIGNMENT         0x0004
16 #define LOGLEVEL_DUPLICATE          0x0008
17 #define LOGLEVEL_PRINT              0x0010
18 #define LOGLEVEL_OPERATOR           0x0020
19 #define LOGLEVEL_MEMBER_FUNCTION    0x4000
20 #define LOGLEVEL_NONMEMBER_FUNCTION 0x8000
21 #define LOGLEVEL_ALL                0xffff
22
23 #define LOGMASK (LOGLEVEL_PRINT)
24 // #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION )
25
26 #include <assert.h>
27 #include <iostream>
28
29 #ifdef VERBOSE
30 #define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) clog << (msg) << endl;
31 #else
32 #define debugmsg(msg, loglevel)
33 #endif // def VERBOSE
34
35 #ifdef DOASSERT
36 #define ASSERT(X) assert(X)
37 #else
38 #define ASSERT(X) ((void)0)
39 #endif
40
41 #endif // ndef _DEBUGMSG_H_
42