Changeset 6133 for code/branches/presentation2/src
- Timestamp:
- Nov 23, 2009, 11:29:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/util/Debug.h
r6105 r6133 73 73 //! Adjust to discard certain output with level > hardDebugLevel at compile time 74 74 const int hardDebugLevel = OutputLevel::Verbose; 75 76 //! This function simply returns 0 and helps to suppress the "statement has no effect" compiler warning 77 inline int debugDummyFunction() 78 { 79 return 0; 80 } 75 81 } 76 82 … … 79 85 Logs text output: use exactly like std::cout, but specify an output 80 86 level as argument. 87 @details 88 (a > b ? 0 : c << "text") is equivalent to (a > b ? 0 : (c << "text")) 89 where (a > b ? 0 : ) stands for COUT(x). This should explain how 90 this macro magic can possibly even work ;) 81 91 @example 82 92 COUT(3) << "Some info" << std::endl; … … 88 98 #define COUT(level) \ 89 99 /*if*/ (level > orxonox::hardDebugLevel) ? \ 90 0\100 orxonox::debugDummyFunction() \ 91 101 /*else*/ : \ 92 102 /*if*/ (level > orxonox::OutputHandler::getSoftDebugLevel()) ? \ 93 0\103 orxonox::debugDummyFunction() \ 94 104 /*else*/ : \ 95 105 orxonox::OutputHandler::getOutStream(level)
Note: See TracChangeset
for help on using the changeset viewer.