navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of ~archive/DebugOutput

Nov 27, 2007, 9:45:37 PM (12 years ago)


  • ~archive/DebugOutput

    v1 v1  
     1= debug.h =
     2file-link: source:/trunk/src/defs/debug.h#HEAD
     4== IDEA ==
     5The idea behing the debugging system is, that all the output can be redirected, redesigned, and if you want be disabled.
     7== Usage ==
     8In the code you wold make an output like this:
     11    PRINT(4)("print cool some text: %s\n", text);
     13This would tell the debugg-engine that output is to be printed if we are in mode '''4''' which is debug (see listing below).
     14The output of this would look as follows (given text = "some very cool text"):
     16print some cool text: some very cool text
     18As you may have noticed, there are two pairs of brackets ()().
     19The first one donates the debug-level, the second one the output in printf-style format.
     21Alternatively you could also output via
     24    PRINTF([level])([output-stuff]);
     26The 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:
     29try it out for yourself.
     31== what is the meaning of the debug-level ==
     32|| 0 || just output ||
     33|| 1 || ERROR (EE) ||
     34|| 2 || WARNING (WW) ||
     35|| 3 || INFORMATION (II) ||
     36|| 4 || DEBUG (DD) ||
     37|| 5 || Very much DEBUG (VD) ||
     39== select the level of output ==
     40the level of output is the maximum debug-mode, that can be outputted
     41  * have a look at [source:/trunk/src/defs/debug.h#HEAD debug.h]
     43everything is there.
     46== redirected to where?? ==
     47  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.
     48  * see [wiki:Shell Shell]