Changeset 7401 for code/trunk/src/libraries/util/Debug.h
- Timestamp:
- Sep 11, 2010, 12:34:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/doc (added) merged: 7290-7292,7296-7300,7302-7304,7306-7312,7315-7318,7323,7325,7327,7331-7332,7334-7335,7345-7347,7352-7353,7356-7357,7361,7363-7367,7371-7375,7388
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/Debug.h
r6443 r7401 29 29 30 30 /** 31 @defgroup COUT COUT(x) output macro 32 @ingroup Util 33 */ 34 35 /** 31 36 @file 37 @ingroup COUT 32 38 @brief 33 Handles different output-levels of errors, warnings, infos and debug information.39 Handles different output-levels of errors, warnings, infos, and debug information. 34 40 35 The COUT(level) macro acts like std::cout, but the output is only performed if the given41 The COUT(level) macro acts like @c std::cout, but the output is only performed if the given 36 42 level is <= the soft debug level. 37 43 … … 39 45 - The hard debug level is used during compile time. It describes the highest allowed output level. 40 46 - The soft debug level is used during runtime and is the maximum of the three configurable 41 output-levels for console, log file and in game shell.47 output-levels for console, log file, and in game shell. 42 48 43 49 The separation between the three devices is done by the OutputHandler. 44 50 51 @anchor COUTlevels 45 52 Possible levels are: 46 0: Very important output47 1: Errors48 2: Warnings49 3: Information50 4: Debug information51 5: More debug information52 6: Crazy debug information53 - 0: Very important output 54 - 1: Errors 55 - 2: Warnings 56 - 3: Information 57 - 4: Debug information 58 - 5: More debug information 59 - 6: Crazy debug information 53 60 54 @example 61 Example: 62 @code 55 63 COUT(0) << "Very important output" << std::endl; 56 64 COUT(1) << "Error: Something went wrong!" << std::endl; … … 58 66 COUT(3) << "Info: It's Monday" << std::endl; 59 67 COUT(4) << "Debug: x is 1.23456" << std::endl; 68 @endcode 60 69 */ 61 70 … … 90 99 /** 91 100 @brief 92 Logs text output: use exactly like std::cout, but specify an output 93 level as argument. 94 @details 95 (a > b ? 0 : c << "text") is equivalent to (a > b ? 0 : (c << "text")) 96 where (a > b ? 0 : ) stands for COUT(x). This should explain how 101 Logs text output: You can use COUT(level) exactly like @c std::cout, but you have to specify an output level as argument. 102 @param level 103 The level of the following output (passed with <tt><< "text"</tt>). Lower levels are more important. See @ref COUTlevels "the description above" for a list of possible output levels. 104 105 Example: 106 @code 107 COUT(3) << "Some info" << std::endl; // Output with level 3 108 @endcode 109 @note 110 <tt>(a > b ? 0 : c << "text")</tt> is equivalent to <tt>(a > b ? 0 : (c << "text")</tt> 111 where <tt>(a > b ? 0 : )</tt> stands for COUT(x). This should explain how 97 112 this macro magic can possibly even work ;) 98 @example 99 COUT(3) << "Some info" << std::endl; 100 @note 101 The ? : operator requires both possible results to have the type of 113 @remarks 114 The <tt>? :</tt> operator requires both possible results to have the type of 102 115 the first. This is achieved by the int conversion operator dummy 103 in the OutputHandler.116 in the @ref orxonox::OutputHandler. 104 117 */ 105 118 #define COUT(level) \
Note: See TracChangeset
for help on using the changeset viewer.