This class is used to display debug or error messages.
It needs to be initialized with the file name, function name and line, of the place where it is created. It is best used by first instanciating the object and directly calling the () operator. This is used to mimic variadic macros.
This class is used to define the following macros:
The example below shows how to use these macros.
#define VP_TRACE // Activate the trace mode
#define VP_DEBUG // Activate the debug mode
#define VP_DEBUG_MODE 2 // Activate debug level 1 and 2
#include <visp3/core/vpDebug.h>
int main()
{
std::cout <<
"Debug level 1 active: " <<
vpDEBUG_ENABLE(1) << std::endl;
std::cout <<
"Debug level 2 active: " <<
vpDEBUG_ENABLE(2) << std::endl;
std::cout <<
"Debug level 3 active: " <<
vpDEBUG_ENABLE(3) << std::endl;
vpTRACE(1,
"C-like trace level 1");
vpCTRACE <<
"C++-like trace" << std::endl;
vpCERROR <<
"C++-like error trace" << std::endl;
vpCDEBUG(2) <<
"C++-like debug trace level 2" << std::endl;
}
Definition at line 136 of file vpDebug.h.