Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7729 in orxonox.OLD for trunk/src/defs


Ignore:
Timestamp:
May 19, 2006, 3:07:09 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better debug names
As DEBUG and ERROR are already given to windows.h and other files:
DEBUG is renamed to DEBUG_LEVEL
and all
NO, ERR, WARN, INFO, DEBUG, vDEBUG
are renamed to
ORX_NONE, ORX_ERR, ORX_WARN, ORX_INFO, ORX_DEBUG, ORX_vDEBUG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/debug.h

    r7711 r7729  
    3535
    3636// DEFINE ERROR MODES
    37 #define NO              0
    38 #define ERR             1
    39 #define WARN            2
    40 #define INFO            3
    41 #define DEBUG           4
    42 #define vDEBUG          5
     37#define ORX_NONE            0
     38#define ORX_ERR             1
     39#define ORX_WARN            2
     40#define ORX_INFO            3
     41#define ORX_DEBUG           4
     42#define ORX_vDEBUG          5
    4343
    4444extern int verbose;
     
    4646//definitions
    4747#ifndef MODULAR_DEBUG
    48  #define HARD_DEBUG_LEVEL DEBUG
     48 #define HARD_DEBUG_LEVEL ORX_DEBUG
    4949 #define SOFT_DEBUG_LEVEL verbose
    5050#else /* MODULAR_DEBUG */
     
    103103/// PRINTF: prints with filename and linenumber ///
    104104///////////////////////////////////////////////////
    105 #define PRINTFNO      PRINTF0
    106 #define PRINTFERR     PRINTF1
    107 #define PRINTFWARN    PRINTF2
    108 #define PRINTFINFO    PRINTF3
    109 #define PRINTFDEBUG   PRINTF4
    110 #define PRINTFVDEBUG  PRINTF5
    111 
    112 #if DEBUG <= 3
     105#define PRINTFORX_NONE    PRINTF0
     106#define PRINTFORX_ERR     PRINTF1
     107#define PRINTFORX_WARN    PRINTF2
     108#define PRINTFORX_INFO    PRINTF3
     109#define PRINTFORX_DEBUG   PRINTF4
     110#define PRINTFORX_VDEBUG  PRINTF5
     111
     112#if DEBUG_LEVEL <= 3
    113113#define PRINTF(x)        PRINT(x)
    114114#endif
     
    122122
    123123#ifndef PRINTF
    124 #ifdef DEBUG
     124#ifdef ORX_DEBUG
    125125
    126126#define PRINTF(x) \
    127127           PRINTF ## x
    128128
    129 #if HARD_DEBUG_LEVEL >= ERR
     129#if HARD_DEBUG_LEVEL >= ORX_ERR
    130130#define PRINTF1 \
    131     if (SOFT_DEBUG_LEVEL >= ERR) \
     131    if (SOFT_DEBUG_LEVEL >= ORX_ERR) \
    132132      printf("(EE)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    133133#else
    134 #define PRINTF1 if (NO)
    135 #endif
    136 
    137 #if HARD_DEBUG_LEVEL >= WARN
     134#define PRINTF1 if (ORX_NONE)
     135#endif
     136
     137#if HARD_DEBUG_LEVEL >= ORX_WARN
    138138#define PRINTF2 \
    139      if (SOFT_DEBUG_LEVEL >= WARN) \
     139     if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
    140140       printf("(WW)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    141141
    142142#else
    143 #define PRINTF2 if (NO)
    144 #endif
    145 
    146 #if HARD_DEBUG_LEVEL >= INFO
     143#define PRINTF2 if (ORX_NONE)
     144#endif
     145
     146#if HARD_DEBUG_LEVEL >= ORX_INFO
    147147#define PRINTF3 \
    148      if (SOFT_DEBUG_LEVEL >= INFO) \
     148     if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
    149149       printf("(II)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    150150#else
    151 #define PRINTF3 if (NO)
    152 #endif
    153 
    154 #if HARD_DEBUG_LEVEL >= DEBUG
     151#define PRINTF3 if (ORX_NONE)
     152#endif
     153
     154#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    155155#define PRINTF4 \
    156      if (SOFT_DEBUG_LEVEL >= DEBUG) \
     156     if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
    157157       printf("(DD)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    158158#else
    159 #define PRINTF4 if (NO)
    160 #endif
    161 
    162 #if HARD_DEBUG_LEVEL >= vDEBUG
     159#define PRINTF4 if (ORX_NONE)
     160#endif
     161
     162#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    163163#define PRINTF5 \
    164      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     164     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    165165       printf("(VD)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    166166#else
    167 #define PRINTF5 if (NO)
    168 #endif
    169 
    170 #else
    171 #define PRINTF(x) if (NO)
     167#define PRINTF5 if (ORX_NONE)
     168#endif
     169
     170#else
     171#define PRINTF(x) if (ORX_NONE)
    172172#endif
    173173
     
    179179///  PRINT: just prints output as is            ///
    180180///////////////////////////////////////////////////
    181 #define PRINTNO      PRINT0
    182 #define PRINTERR     PRINT1
    183 #define PRINTWARN    PRINT2
    184 #define PRINTINFO    PRINT3
    185 #define PRINTDEBUG   PRINT4
    186 #define PRINTVDEBUG  PRINT5
    187 
    188 #ifdef  DEBUG
     181#define PRINTORX_NONE    PRINT0
     182#define PRINTORX_ERR     PRINT1
     183#define PRINTORX_WARN    PRINT2
     184#define PRINTORX_INFO    PRINT3
     185#define PRINTORX_DEBUG   PRINT4
     186#define PRINTORX_vDEBUG  PRINT5
     187
     188#ifdef  DEBUG_LEVEL
    189189#define PRINT(x) \
    190190  PRINT ## x
    191191
    192 #if HARD_DEBUG_LEVEL >= ERR
     192#if HARD_DEBUG_LEVEL >= ORX_ERR
    193193#define PRINT1  \
    194   if (SOFT_DEBUG_LEVEL >= ERR)  \
     194  if (SOFT_DEBUG_LEVEL >= ORX_ERR)  \
    195195    PRINT_EXEC
    196196#else
    197 #define PRINT1 if (NO)
    198 #endif
    199 
    200 #if HARD_DEBUG_LEVEL >= WARN
     197#define PRINT1 if (ORX_NONE)
     198#endif
     199
     200#if HARD_DEBUG_LEVEL >= ORX_WARN
    201201#define PRINT2 \
    202   if (SOFT_DEBUG_LEVEL >= WARN) \
     202  if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
    203203    PRINT_EXEC
    204204
    205205#else
    206 #define PRINT2 if (NO)
    207 #endif
    208 
    209 #if HARD_DEBUG_LEVEL >= INFO
     206#define PRINT2 if (ORX_NONE)
     207#endif
     208
     209#if HARD_DEBUG_LEVEL >= ORX_INFO
    210210#define PRINT3 \
    211   if (SOFT_DEBUG_LEVEL >= INFO) \
     211  if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
    212212    PRINT_EXEC
    213213#else
    214 #define PRINT3 if (NO)
    215 #endif
    216 
    217 #if HARD_DEBUG_LEVEL >= DEBUG
     214#define PRINT3 if (ORX_NONE)
     215#endif
     216
     217#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    218218#define PRINT4 \
    219   if (SOFT_DEBUG_LEVEL >= DEBUG) \
     219  if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
    220220    PRINT_EXEC
    221221#else
    222 #define PRINT4 if (NO)
    223 #endif
    224 
    225 #if HARD_DEBUG_LEVEL >= vDEBUG
     222#define PRINT4 if (ORX_NONE)
     223#endif
     224
     225#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    226226#define PRINT5 \
    227      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     227     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    228228       PRINT_EXEC
    229229#else
    230 #define PRINT5 if (NO)
    231 #endif
    232 
    233 
    234 #else
    235 #define PRINT(x) if (NO)
     230#define PRINT5 if (ORX_NONE)
     231#endif
     232
     233
     234#else
     235#define PRINT(x) if (ORX_NONE)
    236236#endif
    237237
     
    244244///  COUT: just prints output as is with std::cout   ///
    245245////////////////////////////////////////////////////////
    246 #define COUTNO      COUT0
    247 #define COUTERR     COUT1
    248 #define COUTWARN    COUT2
    249 #define COUTINFO    COUT3
    250 #define COUTDEBUG   COUT4
    251 #define COUTVDEBUG  COUT5
    252 
    253 #ifdef  DEBUG
     246#define COUTORX_NONE    COUT0
     247#define COUTORX_ERR     COUT1
     248#define COUTORX_WARN    COUT2
     249#define COUTORX_INFO    COUT3
     250#define COUTORX_DEBUG   COUT4
     251#define COUTORX_vDEBUG  COUT5
     252
     253#ifdef  DEBUG_LEVEL
    254254#define COUT(x) \
    255255  COUT ## x
    256256
    257 #if HARD_DEBUG_LEVEL >= ERR
     257#if HARD_DEBUG_LEVEL >= ORX_ERR
    258258#define COUT1  \
    259   if (SOFT_DEBUG_LEVEL >= ERR)  \
    260     COUT_EXEC
    261 #else
    262 #define COUT1 if (NO)\
    263     COUT_EXEC
    264 #endif
    265 
    266 #if HARD_DEBUG_LEVEL >= WARN
     259  if (SOFT_DEBUG_LEVEL >= ORX_ERR)  \
     260    COUT_EXEC
     261#else
     262#define COUT1 if (ORX_NONE)\
     263    COUT_EXEC
     264#endif
     265
     266#if HARD_DEBUG_LEVEL >= ORX_WARN
    267267#define COUT2 \
    268   if (SOFT_DEBUG_LEVEL >= WARN) \
    269     COUT_EXEC
    270 
    271 #else
    272 #define COUT2 if (NO) \
    273     COUT_EXEC
    274 #endif
    275 
    276 #if HARD_DEBUG_LEVEL >= INFO
     268  if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
     269    COUT_EXEC
     270
     271#else
     272#define COUT2 if (ORX_NONE) \
     273    COUT_EXEC
     274#endif
     275
     276#if HARD_DEBUG_LEVEL >= ORX_INFO
    277277#define COUT3 \
    278   if (SOFT_DEBUG_LEVEL >= INFO) \
    279     COUT_EXEC
    280 #else
    281 #define COUT3 if (NO) \
    282     COUT_EXEC
    283 #endif
    284 
    285 #if HARD_DEBUG_LEVEL >= DEBUG
     278  if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
     279    COUT_EXEC
     280#else
     281#define COUT3 if (ORX_NONE) \
     282    COUT_EXEC
     283#endif
     284
     285#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    286286#define COUT4 \
    287   if (SOFT_DEBUG_LEVEL >= DEBUG) \
    288     COUT_EXEC
    289 #else
    290 #define COUT4 if (NO) \
    291     COUT_EXEC
    292 #endif
    293 
    294 #if HARD_DEBUG_LEVEL >= vDEBUG
     287  if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
     288    COUT_EXEC
     289#else
     290#define COUT4 if (ORX_NONE) \
     291    COUT_EXEC
     292#endif
     293
     294#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    295295#define COUT5 \
    296      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     296     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    297297       COUT_EXEC
    298298#else
    299 #define COUT5 if (NO) \
    300     COUT_EXEC
    301 #endif
    302 
    303 
    304 #else
    305 #define COUT(x) if (NO) \
     299#define COUT5 if (ORX_NONE) \
     300    COUT_EXEC
     301#endif
     302
     303
     304#else
     305#define COUT(x) if (ORX_NONE) \
    306306    COUT_EXEC
    307307#endif
Note: See TracChangeset for help on using the changeset viewer.