Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 22, 2011, 2:10:56 PM (13 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/Debug

    v1 v1  
     1= Debug =
     2
     3== Description ==
     4
     5Debug.h is a header-file, defining several macros for easy-to-use debug-output into the console, the logfile and the ingame [wiki:Shell] with different debug-levels. Debug.h defines macros for COUT, which passes the text over to the [wiki:archive/OutputHandler OutputHandler] which handles the redirection of output to the different streams.
     6
     7The user can set the desired maximal output levels for every device (console, logfile, Shell) in the [wiki:ConfigValue config file] in the section of the class [wiki:CoreSettings Core].
     8
     9== Macros ==
     10
     11 * '''COUT('''''level''''')''''' << text'': Acts like std::cout, but with a debug-level.
     12 * '''CCOUT('''''level''''')''''' << text'': Like COUT, but adds "ClassName: " in front (only works for OrxonoxClasses)
     13
     14== Debug-levels ==
     15
     16|| # || Meaning ||
     17|| || ||
     18|| 0 || Gets always displayed and is meant for very important messages ||
     19|| 1 || Errors. Something seriously bad has happened. Mostly in combination with assert() or an exception. ||
     20|| 2 || Warnings. The issue is not too bad, but everyone should see that something bad has happened. ||
     21|| 3 || Informations about what's happening ||
     22|| 4 || Debug information. Can be quite a lot of text. ||
     23|| 5 || Verbose debug information. That would be overkill in the shell or console. View the log! ||
     24|| 6 || Extreme debug information. You better use grep or another regex tool to read a log file for level 6. ||
     25
     26== Examples ==
     27
     28{{{
     29#!cpp
     30COUT(4) << "Start executing the function..." << std::endl;
     31
     32bool success = functionWithAMeaningfulReturnValue(params);
     33
     34COUT(4) << "...finished executing the function." << std::endl;
     35
     36
     37if (success)
     38  COUT(3) << "Info: The execution of the function was successful." << std::endl;
     39else
     40  COUT(1) << "Error: The execution of the function failed." << std::endl;
     41}}}