| 
                Last change
                  on this file since 3372 was
                  3365,
                  checked in by bensch, 21 years ago
           | 
        
        
          | 
               
orxonox/trunk: merged branches/parenting back to the. 
merged with command: 
svn merge branches/parenting trunk -r 3247:HEAD 
resolved all conflicts in favor of parenting. 
 
           | 
        
        | 
            File size:
            2.4 KB
           | 
      
      
        
  | Line |   | 
|---|
| 1 | #ifndef _DEBUG_H | 
|---|
| 2 | #define _DEBUG_H | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 | /////////////////////////////////////////////////// | 
|---|
| 6 | /// PRINTF: prints with filename and linenumber /// | 
|---|
| 7 | /////////////////////////////////////////////////// | 
|---|
| 8 |  | 
|---|
| 9 | #ifdef  DEBUG | 
|---|
| 10 | extern int verbose; | 
|---|
| 11 | #define PRINTF(x) \ | 
|---|
| 12 |            PRINTF ## x | 
|---|
| 13 |  | 
|---|
| 14 | #if DEBUG >= 1 | 
|---|
| 15 | #define PRINTF1 \ | 
|---|
| 16 |     if (verbose >= 1 ) \ | 
|---|
| 17 |       printf("%s:%d::", __FILE__, __LINE__) && printf | 
|---|
| 18 | #else  | 
|---|
| 19 | #define PRINTF1 // | 
|---|
| 20 | #endif | 
|---|
| 21 |       | 
|---|
| 22 | #if DEBUG >= 2 | 
|---|
| 23 | #define PRINTF2 \ | 
|---|
| 24 |      if (verbose >= 2 ) \ | 
|---|
| 25 |        printf("%s:%d::", __FILE__, __LINE__) && printf | 
|---|
| 26 |           | 
|---|
| 27 | #else  | 
|---|
| 28 | #define PRINTF2 // | 
|---|
| 29 | #endif | 
|---|
| 30 |       | 
|---|
| 31 | #if DEBUG >= 3 | 
|---|
| 32 | #define PRINTF3 \ | 
|---|
| 33 |      if (verbose >= 3 ) \ | 
|---|
| 34 |        printf("%s:%d::", __FILE__, __LINE__) && printf | 
|---|
| 35 | #else  | 
|---|
| 36 | #define PRINTF3 // | 
|---|
| 37 | #endif | 
|---|
| 38 |       | 
|---|
| 39 | #if DEBUG >= 4 | 
|---|
| 40 | #define PRINTF4 \ | 
|---|
| 41 |      if (verbose >= 4 ) \ | 
|---|
| 42 |        printf("%s:%d::", __FILE__, __LINE__) && printf | 
|---|
| 43 | #else  | 
|---|
| 44 | #define PRINTF4 // | 
|---|
| 45 | #endif | 
|---|
| 46 |       | 
|---|
| 47 |       | 
|---|
| 48 | #else   | 
|---|
| 49 | #define PRINTF(x) // | 
|---|
| 50 | #endif | 
|---|
| 51 |  | 
|---|
| 52 | #define PRINTF0 \ | 
|---|
| 53 |     printf("%s:%d::", __FILE__, __LINE__) && printf | 
|---|
| 54 |  | 
|---|
| 55 |  | 
|---|
| 56 |  | 
|---|
| 57 |  | 
|---|
| 58 | /////////////////////////////////////////////////// | 
|---|
| 59 | ///  PRINT: just prints output as is            /// | 
|---|
| 60 | /////////////////////////////////////////////////// | 
|---|
| 61 |  | 
|---|
| 62 | #ifdef  DEBUG | 
|---|
| 63 | #define PRINT(x) \ | 
|---|
| 64 |            PRINT ## x | 
|---|
| 65 |  | 
|---|
| 66 | #if DEBUG >= 1 | 
|---|
| 67 | #define PRINT1 \ | 
|---|
| 68 |     if (verbose >= 1 ) \ | 
|---|
| 69 |       printf | 
|---|
| 70 | #else  | 
|---|
| 71 | #define PRINT1 // | 
|---|
| 72 | #endif | 
|---|
| 73 |       | 
|---|
| 74 | #if DEBUG >= 2 | 
|---|
| 75 | #define PRINT2 \ | 
|---|
| 76 |      if (verbose >= 2 ) \ | 
|---|
| 77 |        printf | 
|---|
| 78 |  | 
|---|
| 79 | #else  | 
|---|
| 80 | #define PRINT2 // | 
|---|
| 81 | #endif | 
|---|
| 82 |       | 
|---|
| 83 | #if DEBUG >= 3 | 
|---|
| 84 | #define PRINT3 \ | 
|---|
| 85 |      if (verbose >= 3 ) \ | 
|---|
| 86 |        printf | 
|---|
| 87 | #else | 
|---|
| 88 | #define PRINT3 // | 
|---|
| 89 | #endif | 
|---|
| 90 |       | 
|---|
| 91 | #if DEBUG >= 4 | 
|---|
| 92 | #define PRINT4 \ | 
|---|
| 93 |      if (verbose >= 4 ) \ | 
|---|
| 94 |        printf | 
|---|
| 95 | #else  | 
|---|
| 96 | #define PRINT4 // | 
|---|
| 97 | #endif | 
|---|
| 98 |       | 
|---|
| 99 |       | 
|---|
| 100 | #else   | 
|---|
| 101 | #define PRINT(x) // | 
|---|
| 102 | #endif | 
|---|
| 103 |  | 
|---|
| 104 | #define PRINT0 \ | 
|---|
| 105 |            printf | 
|---|
| 106 |  | 
|---|
| 107 |  | 
|---|
| 108 | /////////////////////////////////////////////////// | 
|---|
| 109 | /// COUT: simple cout print with verbose-check  /// | 
|---|
| 110 | /////////////////////////////////////////////////// | 
|---|
| 111 | #ifdef  DEBUG | 
|---|
| 112 | #define COUT(x) \ | 
|---|
| 113 |            COUT ## x | 
|---|
| 114 |  | 
|---|
| 115 | #if DEBUG >= 1 | 
|---|
| 116 | #define COUT1 \ | 
|---|
| 117 |     if (verbose >= 1 ) \ | 
|---|
| 118 |       cout | 
|---|
| 119 | #else  | 
|---|
| 120 | #define COUT1 // | 
|---|
| 121 | #endif | 
|---|
| 122 |       | 
|---|
| 123 | #if DEBUG >= 2 | 
|---|
| 124 | #define COUT2 \ | 
|---|
| 125 |      if (verbose >= 2 ) \ | 
|---|
| 126 |        cout | 
|---|
| 127 |  | 
|---|
| 128 | #else  | 
|---|
| 129 | #define COUT2 // | 
|---|
| 130 | #endif | 
|---|
| 131 |       | 
|---|
| 132 | #if DEBUG >= 3 | 
|---|
| 133 | #define COUT3 \ | 
|---|
| 134 |      if (verbose >= 3 ) \ | 
|---|
| 135 |        cout | 
|---|
| 136 | #else | 
|---|
| 137 | #define COUT3 // | 
|---|
| 138 | #endif | 
|---|
| 139 |       | 
|---|
| 140 | #if DEBUG >= 4 | 
|---|
| 141 | #define COUT4 \ | 
|---|
| 142 |      if (verbose >= 4 ) \ | 
|---|
| 143 |        cout | 
|---|
| 144 | #else  | 
|---|
| 145 | #define COUT4 // | 
|---|
| 146 | #endif | 
|---|
| 147 |       | 
|---|
| 148 |       | 
|---|
| 149 | #else   | 
|---|
| 150 | #define COUT(x) // | 
|---|
| 151 | #endif | 
|---|
| 152 |  | 
|---|
| 153 | #define COUT0 \ | 
|---|
| 154 |            cout | 
|---|
| 155 |  | 
|---|
| 156 | #endif /* _DEBUG_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.