Changeset 3605 in orxonox.OLD for orxonox/branches/levelloader/src/defs
- Timestamp:
- Mar 18, 2005, 11:52:15 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/defs/debug.h
r3542 r3605 17 17 \file debug.h 18 18 \brief Handles output to console for different Verbose-Modes. 19 20 There are two main modes HARD and SOFT. HARD is precessed during compileTime where SOFT is for runtime. 21 \li HARD: One can choose between different modes. see: // DEFINE_MODULES \\ 22 \li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT 19 23 */ 20 24 … … 28 32 #include <stdio.h> 29 33 30 #ifndef DEBUG 31 #define DEBUG 4 32 #endif 33 34 // DEFINE ERROR MODES 34 35 #define NO 0 35 36 #define ERR 1 … … 37 38 #define INFO 3 38 39 #define DEBUGING 4 39 40 #define vDEBUGING 5 41 42 extern int verbose; 43 44 //definitions 45 #ifndef MODULAR_DEBUG 46 #define HARD_DEBUG_LEVEL DEBUG 47 #define SOFT_DEBUG_LEVEL verbose 48 #else /* MODULAR_DEBUG */ 49 #ifndef DEBUG_MODULE_SOFT 50 #define SOFT_DEBUG_LEVEL verbose 51 #else /* DEBUG_MODULE_SOFT */ 52 #define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT 53 #endif /* DEBUG_MODULE_SOFT */ 54 55 #ifndef DEBUG_SPECIAL_MODULE 56 #define HARD_DEBUG_LEVEL DEBUG 57 #else /* DEBUG_SPECIAL_MODULE */ 58 // DEFINE MODULES \\ 59 #define DEBUG_MODULE_ORXONOX 0 60 #define DEBUG_MODULE_WORLD 0 61 #define DEBUG_MODULE_PNODE 2 62 #define DEBUG_MODULE_WORLD_ENTITY 0 63 #define DEBUG_MODULE_COMMAND_NODE 0 64 65 #define DEBUG_MODULE_IMPORTER 0 66 #define DEBUG_MODULE_TRACK_MANAGER 0 67 #define DEBUG_MODULE_LIGHT 3 68 #define DEBUG_MODULE_PLAYER 0 69 #define DEBUG_MODULE_MATH 0 70 71 #define DEBUG_MODULE_NULL_PARENT 0 72 73 74 #define HARD_DEBUG_LEVEL DEBUG_SPECIAL_MODULE 75 #endif /* DEBUG_SPECIAL_MODULE */ 76 #endif /* MODULAR_DEBUG */ 40 77 /////////////////////////////////////////////////// 41 78 /// PRINTF: prints with filename and linenumber /// 42 79 /////////////////////////////////////////////////// 80 43 81 #ifdef DEBUG 44 extern int verbose; 82 45 83 #define PRINTF(x) \ 46 84 PRINTF ## x 47 48 #if DEBUG>= ERR85 86 #if HARD_DEBUG_LEVEL >= ERR 49 87 #define PRINTF1 \ 50 if ( verbose>= ERR) \51 printf(" %s:%d::ERROR:", __FILE__, __LINE__) && printf88 if (SOFT_DEBUG_LEVEL >= ERR) \ 89 printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf 52 90 #else 53 91 #define PRINTF1 if (NO) 54 92 #endif 55 93 56 #if DEBUG>= WARN94 #if HARD_DEBUG_LEVEL >= WARN 57 95 #define PRINTF2 \ 58 if ( verbose>= WARN) \59 printf(" %s:%d::WARNING:", __FILE__, __LINE__) && printf96 if (SOFT_DEBUG_LEVEL >= WARN) \ 97 printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf 60 98 61 99 #else … … 63 101 #endif 64 102 65 #if DEBUG>= INFO103 #if HARD_DEBUG_LEVEL >= INFO 66 104 #define PRINTF3 \ 67 if ( verbose>= INFO) \68 printf(" %s:%d::INFO:", __FILE__, __LINE__) && printf105 if (SOFT_DEBUG_LEVEL >= INFO) \ 106 printf("INFO::%s:%d:", __FILE__, __LINE__) && printf 69 107 #else 70 108 #define PRINTF3 if (NO) 71 109 #endif 72 110 73 #if DEBUG>= DEBUGING111 #if HARD_DEBUG_LEVEL >= DEBUGING 74 112 #define PRINTF4 \ 75 if ( verbose>= DEBUGING) \76 printf(" %s:%d::DEBUG:", __FILE__, __LINE__) && printf113 if (SOFT_DEBUG_LEVEL >= DEBUGING) \ 114 printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf 77 115 #else 78 116 #define PRINTF4 if (NO) 79 117 #endif 80 118 81 119 #if HARD_DEBUG_LEVEL >= vDEBUGING 120 #define PRINTF5 \ 121 if (SOFT_DEBUG_LEVEL >= vDEBUGING) \ 122 printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf 123 #else 124 #define PRINTF5 if (NO) 125 #endif 126 82 127 #else 83 128 #define PRINTF(x) if (NO) … … 92 137 /////////////////////////////////////////////////// 93 138 #ifdef DEBUG 94 extern int verbose;95 139 #define PRINT(x) \ 96 140 PRINT ## x 97 98 #if DEBUG>= ERR141 142 #if HARD_DEBUG_LEVEL >= ERR 99 143 #define PRINT1 \ 100 if ( verbose>= ERR) \144 if (SOFT_DEBUG_LEVEL >= ERR) \ 101 145 printf 102 146 #else … … 104 148 #endif 105 149 106 #if DEBUG>= WARN150 #if HARD_DEBUG_LEVEL >= WARN 107 151 #define PRINT2 \ 108 if ( verbose>= WARN) \152 if (SOFT_DEBUG_LEVEL >= WARN) \ 109 153 printf 110 154 … … 113 157 #endif 114 158 115 #if DEBUG>= INFO159 #if HARD_DEBUG_LEVEL >= INFO 116 160 #define PRINT3 \ 117 if ( verbose>= INFO) \161 if (SOFT_DEBUG_LEVEL >= INFO) \ 118 162 printf 119 163 #else … … 121 165 #endif 122 166 123 #if DEBUG>= DEBUGING167 #if HARD_DEBUG_LEVEL >= DEBUGING 124 168 #define PRINT4 \ 125 if ( verbose>= DEBUGING) \169 if (SOFT_DEBUG_LEVEL >= DEBUGING) \ 126 170 printf 127 171 #else 128 172 #define PRINT4 if (NO) 173 #endif 174 175 #if HARD_DEBUG_LEVEL >= vDEBUGING 176 #define PRINT5 \ 177 if (SOFT_DEBUG_LEVEL >= vDEBUGING) \ 178 printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf 179 #else 180 #define PRINT5 if (NO) 129 181 #endif 130 182 … … 144 196 COUT ## x 145 197 146 #if DEBUG>= 1198 #if HARD_DEBUG_LEVEL >= 1 147 199 #define COUT1 \ 148 if ( verbose>= 1 ) \200 if (SOFT_DEBUG_LEVEL >= 1 ) \ 149 201 cout 150 202 #else … … 152 204 #endif 153 205 154 #if DEBUG>= 2206 #if HARD_DEBUG_LEVEL >= 2 155 207 #define COUT2 \ 156 if ( verbose>= 2 ) \208 if (SOFT_DEBUG_LEVEL >= 2 ) \ 157 209 cout 158 210 … … 161 213 #endif 162 214 163 #if DEBUG>= 3215 #if HARD_DEBUG_LEVEL >= 3 164 216 #define COUT3 \ 165 if ( verbose>= 3 ) \217 if (SOFT_DEBUG_LEVEL >= 3 ) \ 166 218 cout 167 219 #else … … 169 221 #endif 170 222 171 #if DEBUG>= 4223 #if HARD_DEBUG_LEVEL >= 4 172 224 #define COUT4 \ 173 if ( verbose>= 4 ) \225 if (SOFT_DEBUG_LEVEL >= 4 ) \ 174 226 cout 175 227 #else
Note: See TracChangeset
for help on using the changeset viewer.