Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

debug.h

This is an archived page!
This page is very old and the content is not up to date.
Not everything (if any) which is written here will be in the final game!

file-link: source:orxonox.OLD/trunk/src/lib/util/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:

    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

    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

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.

Last modified 8 years ago Last modified on Apr 15, 2017, 3:44:48 PM