Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 27, 2007, 9:45:37 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/DebugOutput

    v1 v1  
     1= debug.h =
     2file-link: source:/trunk/src/defs/debug.h#HEAD
     3
     4== IDEA ==
     5The idea behing the debugging system is, that all the output can be redirected, redesigned, and if you want be disabled.
     6
     7== Usage ==
     8In the code you wold make an output like this:
     9{{{
     10#!cpp
     11    PRINT(4)("print cool some text: %s\n", text);
     12}}}
     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"):
     15{{{
     16print some cool text: some very cool text
     17}}}
     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.
     20
     21Alternatively you could also output via
     22{{{
     23#!cpp
     24    PRINTF([level])([output-stuff]);
     25}}}
     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:
     27(LEVEL)::[filename]:[linenumber]:[output]
     28
     29try it out for yourself.
     30
     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) ||
     38
     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]
     42
     43everything is there.
     44
     45
     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]
     49
     50