Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7161 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Feb 18, 2006, 3:34:57 PM (19 years ago)
Author:
bensch
Message:

trunk: one should again be able to use cout <<

File:
1 edited

Legend:

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

    r7020 r7161  
    1919
    2020    There are two main modes HARD and SOFT. HARD is precessed during compileTime where SOFT is for runtime.
    21     \li HARD: One can choose between different modes. see: // DEFINE_MODULES
    22     \li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT
     21    @li HARD: One can choose between different modes. see: // DEFINE_MODULES
     22    @li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT
    2323*/
    2424
     
    115115#ifndef NO_SHELL
    116116#define PRINT_EXEC       ShellBuffer::addBufferLineStatic
     117#define COUT_EXEC        std::cout
    117118#else /* NO_SHELL */
    118119#define PRINT_EXEC       printf
     120#define COUT_EXEC        std::cout
    119121#endif
    120122
     
    237239  PRINT_EXEC
    238240
     241
     242
     243////////////////////////////////////////////////////////
     244///  COUT: just prints output as is with std::cout   ///
     245////////////////////////////////////////////////////////
     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
     254#define COUT(x) \
     255  COUT ## x
     256
     257#if HARD_DEBUG_LEVEL >= ERR
     258#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
     267#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
     277#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
     286#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
     295#define COUT5 \
     296     if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     297       COUT_EXEC
     298#else
     299#define COUT5 if (NO) \
     300    COUT_EXEC
     301#endif
     302
     303
     304#else
     305#define COUT(x) if (NO) \
     306    COUT_EXEC
     307#endif
     308
     309#define COUT0 \
     310  COUT_EXEC
     311
     312
    239313#endif /* _DEBUG_H */
Note: See TracChangeset for help on using the changeset viewer.