Changeset 20858

Show
Ignore:
Timestamp:
09/25/07 15:56:55 (1 year ago)
Author:
patrick
Message:

Back out r20698 and part of r20720. At a debug level higher than 2, the
infinite recursion bug rears its head. Until we figure out what is causing
that problem, colored debug output on Windows has to wait.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vapor/vpr/Util/Debug.cpp

    r20720 r20858  
    6161// If I did, then we could not output debug info in the Thread manager itself 
    6262TSObjectProxy<std::vector<int> > gVprDebugCurColumn;       // What column to indent to 
    63 TSObjectProxy<std::vector<color_out_t> > gVprDebugCurColor;        // What color to display "everything" in 
     63TSObjectProxy<std::vector<std::string> > gVprDebugCurColor;        // What color to display "everything" in 
    6464 
    6565// Register DEBUG categories 
     
    223223      else 
    224224      { 
    225          os << (*gVprDebugCurColor).back(); 
    226          //os << clrSetBOLD((*gVprDebugCurColor).back()); 
     225         os << clrSetBOLD((*gVprDebugCurColor).back()); 
    227226      } 
    228227   } 
     
    503502} 
    504503 
    505 void Debug::pushThreadLocalColor(const color_out_t& color) 
     504void Debug::pushThreadLocalColor(const std::string& color) 
    506505{ 
    507506   (*gVprDebugCurColor).push_back(color); 
  • juggler/trunk/modules/vapor/vpr/Util/Debug.h

    r20721 r20858  
    7373#define vprDBG_HEX_LVL 8 
    7474 
    75 #ifndef VPR_OS_Windows 
    7675// ANSI COLOR CONTROL CODES 
    7776// TODO: Make the work for windows 
     
    9089#define clrWHITE "37" 
    9190 
    92 #else 
    93  
    94 #define clrNONE     FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE 
    95 #define clrBOLD     FOREGROUND_INTENSITY 
    96 #define clrBLACK    FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE 
    97 #define clrRED      FOREGROUND_RED 
    98 #define clrGREEN    FOREGROUND_GREEN 
    99 #define clrYELLOW   FOREGROUND_GREEN|FOREGROUND_RED 
    100 #define clrBLUE     FOREGROUND_BLUE 
    101 #define clrMAGENTA  FOREGROUND_RED|FOREGROUND_BLUE 
    102 #define clrCYAN     FOREGROUND_GREEN|FOREGROUND_BLUE 
    103 #define clrWHITE    FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE 
    104 #endif 
    105  
    106 namespace vpr 
    107 { 
    10891#ifdef VPR_OS_Windows 
    109    struct out_color 
    110    { 
    111       explicit out_color(const WORD attribute) 
    112          : mOutColor(attribute) 
    113       {;} 
    114       WORD mOutColor; 
    115    }; 
    116  
    117    template <class _Elem, class _Traits> 
    118    std::basic_ostream<_Elem,_Traits>&  operator<<(std::basic_ostream<_Elem,_Traits>& i, out_color& c) 
    119    { 
    120        HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);  
    121        SetConsoleTextAttribute(hStdout, c.mOutColor); 
    122        return i; 
    123    } 
    124    typedef out_color color_out_t; 
    125 #else 
    126    typedef std::string color_out_t; 
    127 #endif 
    128 
    129  
    130 #ifdef VPR_OS_Windows 
    131 #  define clrSetNORM(color) vpr::out_color(color) 
    132 #  define clrSetBOLD(color) vpr::out_color(color|clrBOLD) 
    133 #  define clrRESET vpr::out_color(clrNONE) 
    134 #  define clrOutBOLD(color,text) vpr::out_color(color) << text << clrRESET 
    135 #  define clrOutNORM(color,text) vpr::out_color(color) << text << clrRESET 
     92#  define clrESC "" 
     93#  define clrCONTROL_CHARS(font, color) "" 
     94#  define clrSetNORM(color) "" 
     95#  define clrSetBOLD(color) "" 
     96#  define clrRESET "" 
     97#  define clrOutBOLD(color,text) text 
     98#  define clrOutNORM(color,text) text 
    13699#else 
    137100#  define clrESC char(27) 
     
    342305      void pushThreadLocalColumn(int column); 
    343306      void popThreadLocalColumn(); 
    344       void pushThreadLocalColor(const color_out_t& color); 
     307      void pushThreadLocalColor(const std::string& color); 
    345308      void popThreadLocalColor(); 
    346309      //@} 
     
    441404   struct DebugColorGuard 
    442405   { 
    443       DebugColorGuard(const color_out_t& color_val) 
     406      DebugColorGuard(const std::string& color_val) 
    444407      { 
    445408         vprDEBUG_PushTSColor(color_val);