Changeset 3399 in orxonox.OLD for orxonox/branches/nico/src/debug.h
- Timestamp:
- Feb 6, 2005, 11:27:25 PM (20 years ago)
- Location:
- orxonox/branches/nico
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/nico
- Property svn:externals set to
-
orxonox/branches/nico/src/debug.h
r3238 r3399 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: ... 14 */ 15 16 /*! 17 \file debug.h 18 \brief Handles output to console for different Verbose-Modes. 19 */ 20 1 21 #ifndef _DEBUG_H 2 22 #define _DEBUG_H 3 23 24 #define NO 0 25 #define ERROR 1 26 #define WARNING 2 27 #define INFORMATION 3 28 #define DEBUGING 4 29 30 #include <stdio.h> 31 32 /////////////////////////////////////////////////// 33 /// PRINTF: prints with filename and linenumber /// 34 /////////////////////////////////////////////////// 35 4 36 #ifdef DEBUG 37 extern int verbose; 5 38 #define PRINTF(x) \ 6 39 PRINTF ## x 7 40 8 #if DEBUG >= 141 #if DEBUG >= ERROR 9 42 #define PRINTF1 \ 10 if (verbose >= 1) \43 if (verbose >= ERROR) \ 11 44 printf("%s:%d::", __FILE__, __LINE__) && printf 12 45 #else 13 #define PRINTF1 //46 #define PRINTF1 if (NO) 14 47 #endif 15 48 16 #if DEBUG >= 249 #if DEBUG >= WARNING 17 50 #define PRINTF2 \ 18 if (verbose >= 2) \51 if (verbose >= WARNING) \ 19 52 printf("%s:%d::", __FILE__, __LINE__) && printf 20 53 21 54 #else 22 #define PRINTF2 //55 #define PRINTF2 if (NO) 23 56 #endif 24 57 25 #if DEBUG >= 358 #if DEBUG >= INFORMATION 26 59 #define PRINTF3 \ 27 if (verbose >= 3) \60 if (verbose >= INFORMATION) \ 28 61 printf("%s:%d::", __FILE__, __LINE__) && printf 29 62 #else 30 #define PRINTF3 //63 #define PRINTF3 if (NO) 31 64 #endif 32 65 33 #if DEBUG >= 466 #if DEBUG >= DEBUGING 34 67 #define PRINTF4 \ 35 if (verbose >= 4) \68 if (verbose >= DEBUGING) \ 36 69 printf("%s:%d::", __FILE__, __LINE__) && printf 37 70 #else 38 #define PRINTF4 //71 #define PRINTF4 if (NO) 39 72 #endif 40 73 41 74 42 75 #else 43 #define PRINTF(x) //76 #define PRINTF(x) if (NO) 44 77 #endif 45 78 … … 47 80 printf("%s:%d::", __FILE__, __LINE__) && printf 48 81 82 83 /////////////////////////////////////////////////// 84 /// PRINT: just prints output as is /// 85 /////////////////////////////////////////////////// 86 #ifdef DEBUG 87 extern int verbose; 88 #define PRINT(x) \ 89 PRINT ## x 90 91 #if DEBUG >= ERROR 92 #define PRINT1 \ 93 if (verbose >= ERROR) \ 94 printf 95 #else 96 #define PRINT1 if (NO) 97 #endif 98 99 #if DEBUG >= WARNING 100 #define PRINT2 \ 101 if (verbose >= WARNING) \ 102 printf 103 104 #else 105 #define PRINT2 if (NO) 106 #endif 107 108 #if DEBUG >= INFORMATION 109 #define PRINT3 \ 110 if (verbose >= INFORMATION) \ 111 printf 112 #else 113 #define PRINT3 if (NO) 114 #endif 115 116 #if DEBUG >= DEBUGING 117 #define PRINT4 \ 118 if (verbose >= DEBUGING) \ 119 printf 120 #else 121 #define PRINT4 if (NO) 122 #endif 123 124 125 #else 126 #define PRINT(x) if (NO) 127 #endif 128 129 #define PRINT0 \ 130 printf 131 132 /////////////////////////////////////////////////// 133 /// COUT: simple cout print with verbose-check /// 134 /////////////////////////////////////////////////// 135 #ifdef DEBUG 136 #define COUT(x) \ 137 COUT ## x 138 139 #if DEBUG >= 1 140 #define COUT1 \ 141 if (verbose >= 1 ) \ 142 cout 143 #else 144 #define COUT1 if (NO) cout 145 #endif 146 147 #if DEBUG >= 2 148 #define COUT2 \ 149 if (verbose >= 2 ) \ 150 cout 151 152 #else 153 #define COUT2 if (NO) cout 154 #endif 155 156 #if DEBUG >= 3 157 #define COUT3 \ 158 if (verbose >= 3 ) \ 159 cout 160 #else 161 #define COUT3 if (NO) cout 162 #endif 163 164 #if DEBUG >= 4 165 #define COUT4 \ 166 if (verbose >= 4 ) \ 167 cout 168 #else 169 #define COUT4 if (NO) cout 170 #endif 171 172 173 #else 174 #define COUT(x) if (NO) cout 175 #endif 176 177 #define COUT0 \ 178 cout 179 49 180 #endif /* _DEBUG_H */
Note: See TracChangeset
for help on using the changeset viewer.