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