source: git/factory/debug.h

spielwiese
Last change on this file was a3f0fea, checked in by Reimer Behrends <behrends@…>, 5 years ago
Modify variable declarions for pSingular.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3/**
4 * @file debug.h
5 *
6 * functions to print debug output
7 *
8 * @note needs --enable-debugoutput --enable-streamio at configure
9**/
10
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
22#include <iostream>
23#ifdef HAVE_IOSTREAM
24#include <iostream>
25#elif defined(HAVE_IOSTREAM_H)
26#include <iostream.h>
27#endif
28void deb_inc_level();
29void deb_dec_level();
30EXTERN_VAR char * deb_level_msg;
31#define DEBINCLEVEL(stream, msg) \
32(std::stream << deb_level_msg << "entering << " << msg << " >>" << std::endl, deb_inc_level())
33#define DEBDECLEVEL(stream, msg) \
34(deb_dec_level(), std::stream << deb_level_msg << "leaving << " << msg << " >>" << std::endl)
35#define DEBOUTSL(stream) \
36(std::stream << deb_level_msg, std::stream.flush())
37#define DEBOUT(stream, objects) \
38(std::stream << objects, std::stream.flush())
39#define DEBOUTENDL(stream) \
40(std::stream << std::endl)
41#define DEBOUTLN(stream, objects) \
42(std::stream << deb_level_msg << objects << std::endl)
43#else /* DEBUGOUTPUT */
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)
50#endif /* DEBUGOUTPUT */
Note: See TracBrowser for help on using the repository browser.