[3a3fce] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
| 2 | |
---|
[abddbe] | 3 | /** |
---|
| 4 | * @file debug.h |
---|
| 5 | * |
---|
| 6 | * functions to print debug output |
---|
| 7 | * |
---|
| 8 | * @note needs --enable-debugoutput --enable-streamio at configure |
---|
| 9 | **/ |
---|
| 10 | |
---|
[3a3fce] | 11 | /* It should be possible to include this file multiple times for different */ |
---|
| 12 | /* settings of DEBUGOUTPUT */ |
---|
| 13 | |
---|
| 14 | #undef DEBINCLEVEL |
---|
| 15 | #undef DEBDECLEVEL |
---|
| 16 | #undef DEBOUTSL |
---|
| 17 | #undef DEBOUT |
---|
| 18 | #undef DEBOUTENDL |
---|
| 19 | #undef DEBOUTLN |
---|
| 20 | |
---|
| 21 | #ifdef DEBUGOUTPUT |
---|
[346edc8] | 22 | #include <iostream> |
---|
[1dc616] | 23 | #ifdef HAVE_IOSTREAM |
---|
| 24 | #include <iostream> |
---|
| 25 | #elif defined(HAVE_IOSTREAM_H) |
---|
[3a3fce] | 26 | #include <iostream.h> |
---|
[1dc616] | 27 | #endif |
---|
[3a3fce] | 28 | void deb_inc_level(); |
---|
| 29 | void deb_dec_level(); |
---|
[a3f0fea] | 30 | EXTERN_VAR char * deb_level_msg; |
---|
[3a3fce] | 31 | #define DEBINCLEVEL(stream, msg) \ |
---|
[346edc8] | 32 | (std::stream << deb_level_msg << "entering << " << msg << " >>" << std::endl, deb_inc_level()) |
---|
[3a3fce] | 33 | #define DEBDECLEVEL(stream, msg) \ |
---|
[346edc8] | 34 | (deb_dec_level(), std::stream << deb_level_msg << "leaving << " << msg << " >>" << std::endl) |
---|
[3a3fce] | 35 | #define DEBOUTSL(stream) \ |
---|
[346edc8] | 36 | (std::stream << deb_level_msg, std::stream.flush()) |
---|
[3a3fce] | 37 | #define DEBOUT(stream, objects) \ |
---|
[346edc8] | 38 | (std::stream << objects, std::stream.flush()) |
---|
[3a3fce] | 39 | #define DEBOUTENDL(stream) \ |
---|
[346edc8] | 40 | (std::stream << std::endl) |
---|
[433d1a] | 41 | #define DEBOUTLN(stream, objects) \ |
---|
[346edc8] | 42 | (std::stream << deb_level_msg << objects << std::endl) |
---|
[3a3fce] | 43 | #else /* DEBUGOUTPUT */ |
---|
[346edc8] | 44 | #define DEBINCLEVEL(stream, msg) |
---|
| 45 | #define DEBDECLEVEL(stream, msg) |
---|
| 46 | #define DEBOUTSL(stream) |
---|
| 47 | #define DEBOUT(stream, objects) |
---|
| 48 | #define DEBOUTENDL(stream) |
---|
| 49 | #define DEBOUTLN(stream, objects) |
---|
[3a3fce] | 50 | #endif /* DEBUGOUTPUT */ |
---|