47 #ifndef DBGPRINTHELPER_HPP 48 #define DBGPRINTHELPER_HPP 59 #define OUTPUT_LEVEL_NONE 0 61 #define OUTPUT_LEVEL_MINIMUM 1 63 #define OUTPUT_LEVEL_VERBOSE 2 65 #define OUTPUT_LEVEL_PEDANTIC 3 67 #define OUTPUT_LEVEL_VERY_PEDANTIC 4 69 #define OUTPUT_LEVEL_VERY_VERY_PEDANTIC 5 77 #define DEBUG_LEVEL_NONE 0 79 #define DEBUG_LEVEL_MINIMUM 1 81 #define DEBUG_LEVEL_VERBOSE 2 83 #define DEBUG_LEVEL_PEDANTIC 3 85 #define DEBUG_LEVEL_VERY_PEDANTIC 4 87 #define DEBUG_LEVEL_PARANOIC 5 89 #define DEBUG_LEVEL_INFINITE 11 108 #define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex) void(0) 109 #define PRINT_DBG_STRING(dbgLevel, curDbgLevel, mex) void(0) 110 #define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex) void(0) 120 #define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex) \ 121 (((dbgLevel) <= (curDbgLevel)) ? std::cerr << mex << std::endl : std::cerr) 132 #define PRINT_DBG_STRING(dbgLevel, curDbgLevel, mex) (((dbgLevel) <= (curDbgLevel)) ? std::cerr << mex : std::cerr) 140 #define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex) \ 141 (((dbgLevel) <= (curDbgLevel)) ? \ 142 (panda_message = mex, \ 143 (std::string(panda_message) == "-->") ? \ 144 (null_stream << (indentation += 2)) : \ 145 ((std::string(panda_message).substr(0, 3) == "-->") ? \ 146 (std::cerr << std::string(indentation += 2, ' ') << std::string(panda_message).substr(3) \ 148 ((std::string(panda_message).substr(0, 3) == "---") ? \ 149 (std::cerr << std::string(indentation + 2, ' ') << std::string(panda_message).substr(3) \ 151 ((std::string(panda_message) == "<--") ? \ 152 (null_stream << (indentation -= 2)) : \ 153 ((std::string(panda_message).substr(0, 3) == "<--") ? \ 154 (std::cerr << std::string(indentation, ' ') << std::string(panda_message).substr(3) \ 156 null_stream << (indentation -= 2)) : \ 157 (std::cerr << std::string(indentation, ' ') << panda_message << std::endl)))))) : \ 164 #define INDENT_OUT_MEX(profLevel, curprofLevel, mex) (void(0)) 165 #define PRINT_OUT_MEX(profLevel, curprofLevel, mex) (void(0)) 166 #define PRINT_OUT_STRING(profLevel, curprofLevel, mex) (void(0)) 170 #define INDENT_OUT_MEX(outLevel, curOutLevel, mex) \ 171 (((outLevel) <= (curOutLevel)) ? \ 172 (panda_message = mex, \ 173 (std::string(panda_message) == "-->") ? \ 174 (null_stream << (indentation += 2)) : \ 175 ((std::string(panda_message).substr(0, 3) == "-->") ? \ 176 (std::cerr << std::string(indentation += 2, ' ') << std::string(panda_message).substr(3) \ 178 ((std::string(panda_message).substr(0, 3) == "---") ? \ 179 (std::cerr << std::string(indentation + 2, ' ') << std::string(panda_message).substr(3) \ 181 ((std::string(panda_message) == "<--") ? \ 182 (null_stream << (indentation -= 2)) : \ 183 ((std::string(panda_message).substr(0, 3) == "<--") ? \ 184 (std::cerr << std::string(indentation, ' ') << std::string(panda_message).substr(3) \ 186 null_stream << (indentation -= 2)) : \ 187 (std::cerr << std::string(indentation, ' ') << panda_message << std::endl)))))) : \ 190 #define PRINT_OUT_MEX(profLevel, curprofLevel, mex) \ 191 (((profLevel) <= (curprofLevel)) ? std::cerr << mex << std::endl : std::cerr) 193 #define PRINT_OUT_STRING(profLevel, curprofLevel, mex) (((profLevel) <= (curprofLevel)) ? std::cerr << mex : std::cerr) 197 #define PRINT_MSG(mex) std::cerr << mex << std::endl 198 #define PRINT_STRING(mex) std::cerr << mex std::string panda_message
This is the message to be printed.
size_t indentation
The current indentation for debug messages.