Changeset 6417 for code/trunk/src/libraries/util/Debug.h
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/Debug.h
r6105 r6417 71 71 using std::endl; 72 72 73 //! Adjust to discard certain output with level > hardDebugLevel at compile time 73 // Adjust this to discard certain output with level > hardDebugLevel at compile time already 74 #ifdef ORXONOX_RELEASE 75 const int hardDebugLevel = OutputLevel::Verbose 76 #elif defined(NDEBUG) 74 77 const int hardDebugLevel = OutputLevel::Verbose; 78 #else 79 //! Maximum level for debug output that should be even processed at run time 80 const int hardDebugLevel = OutputLevel::Ultra; 81 #endif 82 83 //! This function simply returns 0 and helps to suppress the "statement has no effect" compiler warning 84 inline int debugDummyFunction() 85 { 86 return 0; 87 } 75 88 } 76 89 … … 79 92 Logs text output: use exactly like std::cout, but specify an output 80 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 97 this macro magic can possibly even work ;) 81 98 @example 82 99 COUT(3) << "Some info" << std::endl; … … 88 105 #define COUT(level) \ 89 106 /*if*/ (level > orxonox::hardDebugLevel) ? \ 90 0\107 orxonox::debugDummyFunction() \ 91 108 /*else*/ : \ 92 109 /*if*/ (level > orxonox::OutputHandler::getSoftDebugLevel()) ? \ 93 0\110 orxonox::debugDummyFunction() \ 94 111 /*else*/ : \ 95 112 orxonox::OutputHandler::getOutStream(level)
Note: See TracChangeset
for help on using the changeset viewer.