Changeset 19918

Show
Ignore:
Timestamp:
04/09/07 09:28:20 (2 years ago)
Author:
patrick
Message:

MFT [rev 19917]: Use more consistent formatting for output messages

(especially for warnings and errors).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.0/modules/vrjuggler/vrj/Draw/OGL/GlWindowWin32.cpp

    r19032 r19918  
    391391      { 
    392392         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    393             << clrOutBOLD(clrYELLOW, "WARNING:") << " Display window '" 
     393            << clrOutBOLD(clrYELLOW, "WARNING") << ": Display window '" 
    394394            << mVrjDisplay->getName() << "'" << std::endl; 
    395395         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    396             << "has an out of date OpenGL frame buffer configuration.
    397             << std::endl
     396            << "         has an out of date OpenGL frame buffer
     397            << "configuration.\n"
    398398         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    399             << "Expected version 2 but found version " 
    400             << gl_fb_elt->getVersion() << ".\n"; 
     399            << "         Expected version 3 but found version " 
     400            << gl_fb_elt->getVersion() << ".  Default values\n"; 
    401401         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    402             << "Default values will be used for some frame buffer settings.\n" 
     402            << "        will be used for some frame buffer settings.\n" 
    403403            << vprDEBUG_FLUSH; 
    404404      } 
     
    448448      { 
    449449         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    450             << clrOutBOLD(clrYELLOW, "WARNING:") 
    451             << " Color buffer red channel size was negative (" 
     450            << clrOutBOLD(clrYELLOW, "WARNING") 
     451            << ": Color buffer red channel size was negative (" 
    452452            << red_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    453453         red_size = 1; 
     
    457457      { 
    458458         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    459             << clrOutBOLD(clrYELLOW, "WARNING:") 
    460             << " Color buffer green channel size was negative (" 
     459            << clrOutBOLD(clrYELLOW, "WARNING") 
     460            << ": Color buffer green channel size was negative (" 
    461461            << green_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    462462         green_size = 1; 
     
    466466      { 
    467467         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    468             << clrOutBOLD(clrYELLOW, "WARNING:") 
    469             << " Color buffer blue channel size was negative (" 
     468            << clrOutBOLD(clrYELLOW, "WARNING") 
     469            << ": Color buffer blue channel size was negative (" 
    470470            << blue_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    471471         blue_size = 1; 
     
    475475      { 
    476476         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    477             << clrOutBOLD(clrYELLOW, "WARNING:") 
    478             << " Color buffer alpha channel size was negative (" 
     477            << clrOutBOLD(clrYELLOW, "WARNING") 
     478            << ": Color buffer alpha channel size was negative (" 
    479479            << alpha_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    480480         alpha_size = 1; 
     
    484484      { 
    485485         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    486             << clrOutBOLD(clrYELLOW, "WARNING:") 
    487             << " Auxiliary buffer count was negative (" << num_aux_bufs 
     486            << clrOutBOLD(clrYELLOW, "WARNING") 
     487            << ": Auxiliary buffer count was negative (" << num_aux_bufs 
    488488            << ").  Setting to 0.\n" << vprDEBUG_FLUSH; 
    489489         num_aux_bufs = 0; 
     
    493493      { 
    494494         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    495             << clrOutBOLD(clrYELLOW, "WARNING:") 
    496             << " Depth buffer size was negative (" << db_size 
     495            << clrOutBOLD(clrYELLOW, "WARNING") 
     496            << ": Depth buffer size was negative (" << db_size 
    497497            << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    498498         db_size = 1; 
     
    502502      { 
    503503         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    504             << clrOutBOLD(clrYELLOW, "WARNING:") 
    505             << " Stencil buffer size was negative (" << stencil_size 
     504            << clrOutBOLD(clrYELLOW, "WARNING") 
     505            << ": Stencil buffer size was negative (" << stencil_size 
    506506            << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    507507         stencil_size = 1; 
     
    511511      { 
    512512         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    513             << clrOutBOLD(clrYELLOW, "WARNING:") 
    514             << " Accumulation buffer red channel size was negative (" 
     513            << clrOutBOLD(clrYELLOW, "WARNING") 
     514            << ": Accumulation buffer red channel size was negative (" 
    515515            << accum_red_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    516516         accum_red_size = 1; 
     
    520520      { 
    521521         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    522             << clrOutBOLD(clrYELLOW, "WARNING:") 
    523             << " Accumulation buffer green channel size was negative (" 
     522            << clrOutBOLD(clrYELLOW, "WARNING") 
     523            << ": Accumulation buffer green channel size was negative (" 
    524524            << accum_green_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    525525         accum_green_size = 1; 
     
    529529      { 
    530530         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    531             << clrOutBOLD(clrYELLOW, "WARNING:") 
    532             << " Accumulation buffer blue channel size was negative (" 
     531            << clrOutBOLD(clrYELLOW, "WARNING") 
     532            << ": Accumulation buffer blue channel size was negative (" 
    533533            << accum_blue_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    534534         accum_blue_size = 1; 
     
    538538      { 
    539539         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    540             << clrOutBOLD(clrYELLOW, "WARNING:") 
    541             << " Accumulation buffer alpha channel size was negative (" 
     540            << clrOutBOLD(clrYELLOW, "WARNING") 
     541            << ": Accumulation buffer alpha channel size was negative (" 
    542542            << accum_alpha_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    543543         accum_alpha_size = 1; 
  • juggler/branches/2.0/modules/vrjuggler/vrj/Draw/OGL/GlWindowXWin.cpp

    r19916 r19918  
    119119   { 
    120120      vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    121          << clrOutNORM(clrRED,"ERROR:") 
    122          << " [vrj::GlWindowXWin::open()] Window has not been configured\n" 
     121         << clrOutNORM(clrRED, "ERROR") 
     122         << ": [vrj::GlWindowXWin::open()] Window has not been configured\n" 
    123123         << vprDEBUG_FLUSH; 
    124124      return false; 
     
    128128   { 
    129129      vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    130          << clrOutNORM(clrRED,"ERROR:") 
    131          << " [vrj::GlWindowXWin::open()] Unable to open display '" 
     130         << clrOutNORM(clrRED, "ERROR") 
     131         << ": [vrj::GlWindowXWin::open()] Unable to open display '" 
    132132         << mXDisplayName << "'.\n" << vprDEBUG_FLUSH; 
    133133      return false; 
     
    142142      { 
    143143         vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    144             << clrOutNORM(clrRED,"ERROR:") << " Failed to get a GLX visual\n" 
    145             << vprDEBUG_FLUSH; 
     144            << clrOutNORM(clrRED, "ERROR") 
     145            << ": Failed to get a GLX visual!\n" << vprDEBUG_FLUSH; 
    146146         throw glwinx_OpenFailureException(); 
    147147      } 
     
    160160      { 
    161161         vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    162             << clrOutNORM(clrRED,"ERROR:") 
    163             << " vrj::GlWindowXWin: XCreateColorMap failed on '" 
     162            << clrOutNORM(clrRED, "ERROR") 
     163            << ": [vrj::GlWindowXWin::open()] XCreateColorMap failed on '" 
    164164            << mXDisplayName << "'.\n" << vprDEBUG_FLUSH; 
    165165         throw glwinx_OpenFailureException(); 
     
    191191      { 
    192192         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    193             << clrOutNORM(clrRED,"ERROR:") 
    194             << "vrj::GlWindowXWin: Couldn't create window for " << mXDisplayName 
    195             << std::endl << vprDEBUG_FLUSH; 
     193            << clrOutNORM(clrRED, "ERROR") 
     194            << ": [vrj::GlWindowXWin::open()] Couldn't create window for " 
     195            << mXDisplayName << std::endl << vprDEBUG_FLUSH; 
    196196         throw glwinx_OpenFailureException(); 
    197197      } 
     
    200200      /***************** Set Window Name/Class/Size/Pos *********************/ 
    201201 
    202       /* Before we map the window, we need a name for it (this is also useful for 
    203        * the resource cruft that'll get rid of the borders). 
     202      /* Before we map the window, we need a name for it (this is also useful 
     203       * for the resource cruft that'll get rid of the borders). 
    204204       */ 
    205205      classhint = ::XAllocClassHint(); 
     
    227227 
    228228      /* Get rid of window border, if configured to do so. 
    229        * This technique doesn't require any modifications to the .XDefaults file 
    230        * or anything, but it will only work with window managers based on MWM 
    231        * (the Motif window manager).  That covers most cases. 
     229       * This technique doesn't require any modifications to the .XDefaults 
     230       * file or anything, but it will only work with window managers based on 
     231       * MWM (the Motif window manager).  That covers most cases. 
    232232       * Unfortunately, the generic X resources for communicating with a window 
    233233       * manager don't support this feature. 
     
    236236      { 
    237237         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_HVERB_LVL) 
    238             << "[vrj::GlWindowXWin::open()] Attempting to make window borderless" 
    239             << std::endl << vprDEBUG_FLUSH; 
     238            << "[vrj::GlWindowXWin::open()] Attempting to make window " 
     239            << "borderless." << std::endl << vprDEBUG_FLUSH; 
     240 
    240241         Atom MotifHints = XInternAtom(mXDisplay, "_MOTIF_WM_HINTS", 0); 
    241242         if ( MotifHints == None ) 
    242243         { 
    243244            vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    244                << clrOutNORM(clrRED,"ERROR:") 
    245                << "vrj::GlWindowXWin: Could not get X atom for _MOTIF_WM_HINTS.
    246                << std::endl << vprDEBUG_FLUSH; 
     245               << clrOutNORM(clrRED, "ERROR") 
     246               << ": [vrj::GlWindowXWin::open()] Could not get X atom for
     247               << "_MOTIF_WM_HINTS." << std::endl << vprDEBUG_FLUSH; 
    247248         } 
    248249         else 
     
    264265      ::XSync(mXDisplay, 0); 
    265266 
    266       vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_VERB_LVL) << "vrj::GlWindowXWin: done mapping window\n" 
    267                                   << vprDEBUG_FLUSH; 
     267      vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_VERB_LVL) 
     268         << "[vrj::GlWindowXWin::open()] Done mapping window.\n" 
     269         << vprDEBUG_FLUSH; 
    268270 
    269271      /********************* OpenGL Context Stuff *********************/ 
     
    273275      { 
    274276         vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    275             << clrOutNORM(clrRED,"ERROR:") << "Couldn't create GlxContext for '" 
     277            << clrOutNORM(clrRED, "ERROR") 
     278            << ": Couldn't create GlxContext for '" 
    276279            << mXDisplayName << "'\n" << vprDEBUG_FLUSH; 
    277280         throw glwinx_OpenFailureException(); 
     
    532535   { 
    533536      vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    534          << clrOutNORM(clrRED, "ERROR:") << " X Display '" << mXDisplayName 
     537         << clrOutNORM(clrRED, "ERROR") << ": X Display '" << mXDisplayName 
    535538         << "' doesn't support GLX.\n" << vprDEBUG_FLUSH; 
    536539      return NULL; 
     
    557560      { 
    558561         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    559             << clrOutBOLD(clrYELLOW, "WARNING:") << " Display window '" 
     562            << clrOutBOLD(clrYELLOW, "WARNING") << ": Display window '" 
    560563            << mVrjDisplay->getName() << "'" << std::endl; 
    561564         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    562             << "has an out of date OpenGL frame buffer configuration.\n"; 
     565            << "         has an out of date OpenGL frame buffer " 
     566            << "configuration.\n"; 
    563567         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    564             << "Expected version 3 but found version " 
     568            << "         Expected version 3 but found version " 
    565569            << gl_fb_elt->getVersion() << ".  Default values\n"; 
    566570         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    567             << "will be used for some frame buffer settings.\n" 
     571            << "         will be used for some frame buffer settings.\n" 
    568572            << vprDEBUG_FLUSH; 
    569573      } 
     
    619623      { 
    620624         vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    621             << clrOutBOLD(clrRED, "ERROR:") 
    622             << " Failed to get X11 visual info for visual ID 0x
     625            << clrOutBOLD(clrRED, "ERROR") 
     626            << ": Failed to get X11 visual info for visual ID
    623627            << std::hex << visual_id << std::dec << std::endl 
    624628            << vprDEBUG_FLUSH; 
    625629         vprDEBUG_NEXT(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 
    626             << "Window '" << mVrjDisplay->getName() << "' cannot be opened" 
    627             << std::endl << vprDEBUG_FLUSH; 
     630            << "       Window '" << mVrjDisplay->getName() 
     631            << "' cannot be opened" << std::endl << vprDEBUG_FLUSH; 
    628632      } 
    629633 
     
    635639      { 
    636640         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    637             << clrOutBOLD(clrYELLOW, "WARNING:") 
    638             << " Color buffer red channel size was negative (" 
     641            << clrOutBOLD(clrYELLOW, "WARNING") 
     642            << ": Color buffer red channel size was negative (" 
    639643            << red_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    640644         red_size = 1; 
     
    644648      { 
    645649         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    646             << clrOutBOLD(clrYELLOW, "WARNING:") 
    647             << " Color buffer green channel size was negative (" 
     650            << clrOutBOLD(clrYELLOW, "WARNING") 
     651            << ": Color buffer green channel size was negative (" 
    648652            << green_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    649653         green_size = 1; 
     
    653657      { 
    654658         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    655             << clrOutBOLD(clrYELLOW, "WARNING:") 
    656             << " Color buffer blue channel size was negative (" 
     659            << clrOutBOLD(clrYELLOW, "WARNING") 
     660            << ": Color buffer blue channel size was negative (" 
    657661            << blue_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    658662         blue_size = 1; 
     
    662666      { 
    663667         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    664             << clrOutBOLD(clrYELLOW, "WARNING:") 
    665             << " Color buffer alpha channel size was negative (" 
     668            << clrOutBOLD(clrYELLOW, "WARNING") 
     669            << ": Color buffer alpha channel size was negative (" 
    666670            << alpha_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    667671         alpha_size = 1; 
     
    671675      { 
    672676         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    673             << clrOutBOLD(clrYELLOW, "WARNING:") 
    674             << " Auxiliary buffer count was negative (" << num_aux_bufs 
     677            << clrOutBOLD(clrYELLOW, "WARNING") 
     678            << ": Auxiliary buffer count was negative (" << num_aux_bufs 
    675679            << ").  Setting to 0.\n" << vprDEBUG_FLUSH; 
    676680         num_aux_bufs = 0; 
     
    680684      { 
    681685         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    682             << clrOutBOLD(clrYELLOW, "WARNING:") 
    683             << " Depth buffer size was negative (" << db_size 
     686            << clrOutBOLD(clrYELLOW, "WARNING") 
     687            << ": Depth buffer size was negative (" << db_size 
    684688            << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    685689         db_size = 1; 
     
    689693      { 
    690694         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    691             << clrOutBOLD(clrYELLOW, "WARNING:") 
    692             << " Stencil buffer size was negative (" << stencil_size 
     695            << clrOutBOLD(clrYELLOW, "WARNING") 
     696            << ": Stencil buffer size was negative (" << stencil_size 
    693697            << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    694698         stencil_size = 1; 
     
    698702      { 
    699703         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    700             << clrOutBOLD(clrYELLOW, "WARNING:") 
    701             << " Accumulation buffer red channel size was negative (" 
     704            << clrOutBOLD(clrYELLOW, "WARNING") 
     705            << ": Accumulation buffer red channel size was negative (" 
    702706            << accum_red_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    703707         accum_red_size = 1; 
     
    707711      { 
    708712         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    709             << clrOutBOLD(clrYELLOW, "WARNING:") 
    710             << " Accumulation buffer green channel size was negative (" 
     713            << clrOutBOLD(clrYELLOW, "WARNING") 
     714            << ": Accumulation buffer green channel size was negative (" 
    711715            << accum_green_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    712716         accum_green_size = 1; 
     
    716720      { 
    717721         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    718             << clrOutBOLD(clrYELLOW, "WARNING:") 
    719             << " Accumulation buffer blue channel size was negative (" 
     722            << clrOutBOLD(clrYELLOW, "WARNING") 
     723            << ": Accumulation buffer blue channel size was negative (" 
    720724            << accum_blue_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    721725         accum_blue_size = 1; 
     
    725729      { 
    726730         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    727             << clrOutBOLD(clrYELLOW, "WARNING:") 
    728             << " Accumulation buffer alpha channel size was negative (" 
     731            << clrOutBOLD(clrYELLOW, "WARNING") 
     732            << ": Accumulation buffer alpha channel size was negative (" 
    729733            << accum_alpha_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    730734         accum_alpha_size = 1; 
     
    10211025      { 
    10221026         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    1023             << "WARNING: Could not get an OpenGL visual for '" << mXDisplayName 
    1024             << "'\n"; 
     1027            << clrOutBOLD(clrYELLOW, "WARNING") << ": Could not get an " 
     1028            << "OpenGL visual for '" << mXDisplayName << "'\n"; 
    10251029         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    1026             << "with stereo rendering enabled; trying without.\n" 
     1030            << "         with stereo rendering enabled; trying without.\n" 
    10271031            << vprDEBUG_FLUSH; 
    10281032         mInStereo = false; 
     
    10471051      { 
    10481052         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    1049             << "WARNING: Could not get an OpenGL visual for '" << mXDisplayName 
    1050             << "'\n"; 
     1053            << clrOutBOLD(clrYELLOW, "WARNING") << ": Could not get an " 
     1054            << "OpenGL visual for '" << mXDisplayName << "'\n"; 
    10511055         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    1052             << "with accumulation buffer settings; trying without.\n" 
     1056            << "         with accumulation buffer settings; trying without.\n" 
    10531057            << vprDEBUG_FLUSH; 
    10541058 
     
    10691073      // Disabling the alpha channel may give us something usable. 
    10701074      vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    1071          << "WARNING: Could not get an OpenGL visual for '" << mXDisplayName 
    1072          << "'\n"; 
     1075         << clrOutBOLD(clrYELLOW, "WARNING") << ": Could not get an OpenGL " 
     1076         << "visual for '" << mXDisplayName << "'\n"; 
    10731077      vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_CRITICAL_LVL) 
    10741078         << "with a color buffer alpha channel; trying without.\n" 
     
    11241128} 
    11251129 
    1126  
    11271130} // namespace vrj