Go to the documentation of this file.
10 #ifndef SOT_CORE_DEBUG_HH
11 #define SOT_CORE_DEBUG_HH
21 #define VP_DEBUG_MODE 0
24 #ifndef VP_TEMPLATE_DEBUG_MODE
25 #define VP_TEMPLATE_DEBUG_MODE 0
28 #define SOT_COMMON_TRACES \
31 va_start(arg, format); \
32 vsnprintf(charbuffer, SIZE, format, arg); \
34 outputbuffer << tmpbuffer.str() << charbuffer << std::endl; \
45 char charbuffer[SIZE + 1];
56 inline void trace(
const char *format, ...) {
62 if (level <= traceLevel) outputbuffer << tmpbuffer.str();
84 static void openFile(
const char *filename = DEBUG_FILENAME_DEFAULT);
85 static void closeFile(
const char *filename = DEBUG_FILENAME_DEFAULT);
95 __FILE__ << ": " << __FUNCTION__ << "(#" << __LINE__ << ") :"
98 "\t!! " << __FILE__ << ": " << __FUNCTION__ << "(#" << __LINE__ << ") :"
100 #define sotDEBUG(level) \
101 if ((level > VP_DEBUG_MODE) || \
102 (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good())) \
105 dynamicgraph::sot::sotDEBUGFLOW.outputbuffer << sotPREDEBUG
107 #define sotDEBUGMUTE(level) \
108 if ((level > VP_DEBUG_MODE) || \
109 (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good())) \
112 dynamicgraph::sot::sotDEBUGFLOW.outputbuffer
115 if (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good()) \
118 dynamicgraph::sot::sotERRORFLOW.outputbuffer << sotPREERROR
121 if (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good()) \
124 dynamicgraph::sot::sotDEBUGFLOW \
125 .pre(dynamicgraph::sot::sotDEBUGFLOW.tmpbuffer << sotPREDEBUG, \
130 if (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good()) \
133 sot::sotERRORFLOW.pre(sot::sotERRORFLOW.tmpbuffer << sotPREERROR).trace
136 #define sotTDEBUG(level) \
137 if ((level > VP_TEMPLATE_DEBUG_MODE) || \
138 (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good())) \
141 dynamicgraph::sot::sotDEBUGFLOW.outputbuffer << sotPREDEBUG
144 if (!dynamicgraph::sot::sotDEBUGFLOW.outputbuffer.good()) \
147 dynamicgraph::sot::sotDEBUGFLOW \
148 .pre(dynamicgraph::sot::sotDEBUGFLOW.tmpbuffer << sotPREDEBUG, \
149 VP_TEMPLATE_DEBUG_MODE) \
166 #define sotPREERROR \
167 "\t!! " << __FILE__ << ": " << __FUNCTION__ << "(#" << __LINE__ << ") :"
168 #define sotDEBUG(level) \
172 ::dynamicgraph::sot::__null_stream()
173 #define sotDEBUGMUTE(level) \
177 ::dynamicgraph::sot::__null_stream()
178 #define sotERROR sotERRORFLOW.outputbuffer << sotPREERROR
189 static std::ostream os(NULL);
196 #define sotTDEBUG(level) \
200 ::dynamicgraph::sot::__null_stream()
209 #define sotDEBUG_ENABLE(level) false
210 #define sotTDEBUG_ENABLE(level) false
214 #define sotDEBUGIN(level) sotDEBUG(level) << "# In {" << std::endl
215 #define sotDEBUGOUT(level) sotDEBUG(level) << "# Out }" << std::endl
216 #define sotDEBUGINOUT(level) sotDEBUG(level) << "# In/Out { }" << std::endl
218 #define sotTDEBUGIN(level) sotTDEBUG(level) << "# In {" << std::endl
219 #define sotTDEBUGOUT(level) sotTDEBUG(level) << "# Out }" << std::endl
220 #define sotTDEBUGINOUT(level) sotTDEBUG(level) << "# In/Out { }" << std::endl
SOT_CORE_EXPORT DebugTrace sotDEBUGFLOW
SOT_CORE_EXPORT DebugTrace sotERRORFLOW
#define sotTDEBUG_ENABLE(level)
DebugTrace(std::ostream &os)
DebugTrace & pre(const std::ostream &)
#define VP_TEMPLATE_DEBUG_MODE
VP_DEBUG_MODE.
std::ostream & __null_stream()
void sotERRORF(const size_type, const char *,...)
void sotDEBUGF(const size_type, const char *,...)
std::stringstream tmpbuffer
void traceTemplate(const char *format,...)
#define SOT_COMMON_TRACES
VP_TEMPLATE_DEBUG_MODE.
void trace(const size_type level, const char *format,...)
#define sotDEBUG_ENABLE(level)
void trace(const char *format,...)
size_type traceLevelTemplate
static const char * DEBUG_FILENAME_DEFAULT
DebugTrace & pre(const std::ostream &, size_type level)
void trace(const size_type level=-1)
void traceTemplate(const size_type level, const char *format,...)
std::ostream & outputbuffer
void sotTDEBUGF(const size_type, const char *,...)
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31