ocra-recipes
Doxygen documentation for the ocra-recipes repository
gOcraDebug.h
Go to the documentation of this file.
1 
13 #ifndef gOcraDEBUG_H
14 # define gOcraDEBUG_H
15 
16 //#define gOcra_DEBUG
17 #define gOcra_DEBUG_MODE 0
18 
19 
20 # include <cstdio>
21 # include <iostream>
22 # include <fstream>
23 # include <sstream>
24 
25 # ifndef gOcra_DEBUG_MODE
26 # define gOcra_DEBUG_MODE 0
27 # endif
28 
30  public :
31  IsirDebugTrace(std::ostream& os);
32 
33  std::ostream& outputbuffer;
34 
35 };
37 
38 # ifdef gOcra_DEBUG
39 # define isirPREDEBUG \
40  __FILE__ << ": " << __FUNCTION__ \
41  << "(#" << __LINE__ << ") :"
42 
43 # define isirTOTALDEBUG(level) \
44  if ((level>gOcra_DEBUG_MODE) || (!isirDEBUGFLOW.outputbuffer.good()) ) \
45  ; \
46  else isirDEBUGFLOW.outputbuffer << isirPREDEBUG
47 
48 # define isirDEBUG(level) \
49  if ((level>gOcra_DEBUG_MODE) || (!isirDEBUGFLOW.outputbuffer.good()) ) \
50  ; \
51  else isirDEBUGFLOW.outputbuffer
52 # else // gOcra_DEBUG
53 # define isirTOTALDEBUG(level) if( 1 ) ; else std::cout
54 # define isirDEBUG(level) if( 1 ) ; else std::cout
55 
56 #endif // gOcra_DEBUG
57 
58 #endif //ifndef gOcraDEBUG_H
std::ostream & outputbuffer
Definition: gOcraDebug.h:33
IsirDebugTrace isirDEBUGFLOW
IsirDebugTrace(std::ostream &os)
Definition: gOcraDebug.cpp:15