Changeset 560 for code/branches/FICN/src/orxonox/core
- Timestamp:
- Dec 17, 2007, 3:20:46 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/CMakeLists.txt
r555 r560 11 11 SignalHandler.cc 12 12 ArgReader.cc 13 DebugLevel.cc 13 14 ) 14 15 -
code/branches/FICN/src/orxonox/core/Debug.h
r499 r560 25 25 26 26 #include <stdio.h> 27 28 int getSoftDebugLevel(); 27 29 28 30 // DEFINE ERROR MODES … … 38 40 39 41 #define ORX_HARD_DEBUG_LEVEL ORX_DEBUG 40 #define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting42 //#define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting 41 43 42 44 /////////////////////////////////////////////////// … … 61 63 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 62 64 #define PRINTF1 \ 63 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \65 if (getSoftDebugLevel() >= ORX_ERROR) \ 64 66 printf("Error (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 65 67 #else … … 69 71 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 70 72 #define PRINTF2 \ 71 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \73 if (getSoftDebugLevel() >= ORX_WARNING) \ 72 74 printf("Warning (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 73 75 #else … … 77 79 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 78 80 #define PRINTF3 \ 79 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \81 if (getSoftDebugLevel() >= ORX_INFO) \ 80 82 printf("Info (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 81 83 #else … … 85 87 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 86 88 #define PRINTF4 \ 87 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \89 if (getSoftDebugLevel() >= ORX_DEBUG) \ 88 90 printf("Debug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 89 91 #else … … 93 95 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 94 96 #define PRINTF5 \ 95 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \97 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 96 98 printf("vDebug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 97 99 #else … … 124 126 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 125 127 #define PRINT1 \ 126 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \128 if (getSoftDebugLevel() >= ORX_ERROR) \ 127 129 PRINT_EXEC 128 130 #else … … 132 134 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 133 135 #define PRINT2 \ 134 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \136 if (getSoftDebugLevel() >= ORX_WARNING) \ 135 137 PRINT_EXEC 136 138 #else … … 140 142 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 141 143 #define PRINT3 \ 142 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \144 if (getSoftDebugLevel() >= ORX_INFO) \ 143 145 PRINT_EXEC 144 146 #else … … 148 150 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 149 151 #define PRINT4 \ 150 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \152 if (getSoftDebugLevel() >= ORX_DEBUG) \ 151 153 PRINT_EXEC 152 154 #else … … 156 158 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 157 159 #define PRINT5 \ 158 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \160 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 159 161 PRINT_EXEC 160 162 #else … … 188 190 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 189 191 #define COUT1 \ 190 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \192 if (getSoftDebugLevel() >= ORX_ERROR) \ 191 193 COUT_EXEC 192 194 #else … … 197 199 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 198 200 #define COUT2 \ 199 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \201 if (getSoftDebugLevel() >= ORX_WARNING) \ 200 202 COUT_EXEC 201 203 #else … … 206 208 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 207 209 #define COUT3 \ 208 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \210 if (getSoftDebugLevel() >= ORX_INFO) \ 209 211 COUT_EXEC 210 212 #else … … 215 217 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 216 218 #define COUT4 \ 217 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \219 if (getSoftDebugLevel() >= ORX_DEBUG) \ 218 220 COUT_EXEC 219 221 #else … … 224 226 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 225 227 #define COUT5 \ 226 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \228 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 227 229 COUT_EXEC 228 230 #else -
code/branches/FICN/src/orxonox/core/Error.cc
r513 r560 27 27 28 28 #include "Error.h" 29 #include "Debug.h" 29 30 30 31 namespace orxonox … … 42 43 Error::Error(int errorCode, std::string errorMsg) 43 44 { 44 std::cout<< "############################ "<< std::endl45 COUT(1) << "############################ "<< std::endl 45 46 << "# Error "<<errorCode<< " #"<< std::endl 46 47 << "############################ "<< std::endl … … 58 59 } 59 60 } 60 std::cout<< errorMsg << std::endl<< std::endl;61 COUT(1) << errorMsg << std::endl<< std::endl; 61 62 } 62 63 } -
code/branches/FICN/src/orxonox/core/SignalHandler.cc
r497 r560 14 14 */ 15 15 16 #include <assert.h> 17 16 18 #include "SignalHandler.h" 17 #include <assert.h>19 #include "Debug.h" 18 20 19 21 SignalHandler * SignalHandler::singletonRef = NULL; … … 101 103 } 102 104 103 printf( "recieved signal %s\ntry to write backtrace to file orxonox.log\n", sigName.c_str() );105 PRINTF(0)( "recieved signal %s\ntry to write backtrace to file orxonox.log\n", sigName.c_str() ); 104 106 105 107 int sigPipe[2]; … … 129 131 if ( someData != 0x12345678 ) 130 132 { 131 printf("something went wrong :(\n");133 PRINTF(0)("something went wrong :(\n"); 132 134 } 133 135 … … 278 280 if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() ) 279 281 { 280 printf( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length());282 PRINTF(0)( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length()); 281 283 exit(EXIT_FAILURE); 282 284 }
Note: See TracChangeset
for help on using the changeset viewer.