Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 3:20:46 AM (16 years ago)
Author:
landauf
Message:
  • changed output from std::cout to COUT(level)
  • added SoftDebugLevel config-variable (its a hack, but it works fine)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/Debug.h

    r499 r560  
    2525
    2626#include <stdio.h>
     27
     28int getSoftDebugLevel();
    2729
    2830// DEFINE ERROR MODES
     
    3840
    3941#define ORX_HARD_DEBUG_LEVEL ORX_DEBUG
    40 #define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting
     42//#define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting
    4143
    4244///////////////////////////////////////////////////
     
    6163  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    6264   #define PRINTF1 \
    63     if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR) \
     65    if (getSoftDebugLevel() >= ORX_ERROR) \
    6466     printf("Error (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
    6567  #else
     
    6971  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
    7072   #define PRINTF2 \
    71     if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
     73    if (getSoftDebugLevel() >= ORX_WARNING) \
    7274     printf("Warning (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
    7375  #else
     
    7779  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
    7880   #define PRINTF3 \
    79     if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
     81    if (getSoftDebugLevel() >= ORX_INFO) \
    8082     printf("Info (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
    8183  #else
     
    8587  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
    8688   #define PRINTF4 \
    87     if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
     89    if (getSoftDebugLevel() >= ORX_DEBUG) \
    8890     printf("Debug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
    8991  #else
     
    9395  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
    9496   #define PRINTF5 \
    95     if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
     97    if (getSoftDebugLevel() >= ORX_vDEBUG) \
    9698     printf("vDebug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
    9799  #else
     
    124126  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    125127   #define PRINT1  \
    126     if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR)  \
     128    if (getSoftDebugLevel() >= ORX_ERROR)  \
    127129     PRINT_EXEC
    128130  #else
     
    132134  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
    133135   #define PRINT2 \
    134     if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
     136    if (getSoftDebugLevel() >= ORX_WARNING) \
    135137     PRINT_EXEC
    136138  #else
     
    140142  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
    141143   #define PRINT3 \
    142     if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
     144    if (getSoftDebugLevel() >= ORX_INFO) \
    143145     PRINT_EXEC
    144146  #else
     
    148150  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
    149151   #define PRINT4 \
    150     if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
     152    if (getSoftDebugLevel() >= ORX_DEBUG) \
    151153     PRINT_EXEC
    152154  #else
     
    156158  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
    157159   #define PRINT5 \
    158     if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
     160    if (getSoftDebugLevel() >= ORX_vDEBUG) \
    159161     PRINT_EXEC
    160162  #else
     
    188190  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    189191   #define COUT1  \
    190     if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR)  \
     192    if (getSoftDebugLevel() >= ORX_ERROR)  \
    191193     COUT_EXEC
    192194  #else
     
    197199  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
    198200   #define COUT2 \
    199     if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
     201    if (getSoftDebugLevel() >= ORX_WARNING) \
    200202     COUT_EXEC
    201203  #else
     
    206208  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
    207209   #define COUT3 \
    208     if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
     210    if (getSoftDebugLevel() >= ORX_INFO) \
    209211     COUT_EXEC
    210212  #else
     
    215217  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
    216218   #define COUT4 \
    217     if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
     219    if (getSoftDebugLevel() >= ORX_DEBUG) \
    218220     COUT_EXEC
    219221  #else
     
    224226  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
    225227   #define COUT5 \
    226     if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
     228    if (getSoftDebugLevel() >= ORX_vDEBUG) \
    227229     COUT_EXEC
    228230  #else
Note: See TracChangeset for help on using the changeset viewer.