= debug.h = file-link: source:/trunk/src/defs/debug.h#HEAD == IDEA == The idea behing the debugging system is, that all the output can be redirected, redesigned, and if you want be disabled. == Usage == In the code you wold make an output like this: {{{ #!cpp PRINT(4)("print cool some text: %s\n", text); }}} This would tell the debugg-engine that output is to be printed if we are in mode '''4''' which is debug (see listing below). The output of this would look as follows (given text = "some very cool text"): {{{ print some cool text: some very cool text }}} As you may have noticed, there are two pairs of brackets ()(). The first one donates the debug-level, the second one the output in printf-style format. Alternatively you could also output via {{{ #!cpp PRINTF([level])([output-stuff]); }}} The joke with PRINTF (notice the F at the end (it is the only thing that changes)) is, that in addition to just printing the output, it appends the level, code-file and file-line, where the error occured in the following from: (LEVEL)::[filename]:[linenumber]:[output] try it out for yourself. == what is the meaning of the debug-level == || 0 || just output || || 1 || ERROR (EE) || || 2 || WARNING (WW) || || 3 || INFORMATION (II) || || 4 || DEBUG (DD) || || 5 || Very much DEBUG (VD) || == select the level of output == the level of output is the maximum debug-mode, that can be outputted * have a look at [source:/trunk/src/defs/debug.h#HEAD debug.h] everything is there. == redirected to where?? == all the output generated with the Debugging engine is redirected to the Shell's Buffer, where it can be appendet to the Shell itself, and where output will be stored some line-lenght long. * see [wiki:Shell Shell]