[Orxonox-commit 3846] r8522 - in code/branches/unity_build/src: libraries/core/command libraries/util orxonox/overlays

rgrieder at orxonox.net rgrieder at orxonox.net
Fri May 20 16:05:33 CEST 2011


Author: rgrieder
Date: 2011-05-20 16:05:32 +0200 (Fri, 20 May 2011)
New Revision: 8522

Modified:
   code/branches/unity_build/src/libraries/core/command/IOConsoleWindows.cc
   code/branches/unity_build/src/libraries/core/command/Shell.h
   code/branches/unity_build/src/libraries/util/Debug.h
   code/branches/unity_build/src/libraries/util/OutputHandler.h
   code/branches/unity_build/src/orxonox/overlays/InGameConsole.cc
Log:
Added new output macro: DOUT. Use this instead of COUT(0) to produce temporary debug output.
If available, such output will be shown in vivid colours and with a "+++ " prefix.

Any occurrence of this macro in the trunk will be dealt with swiftly and painlessly (it's very easy to search for it).

Modified: code/branches/unity_build/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/branches/unity_build/src/libraries/core/command/IOConsoleWindows.cc	2011-05-20 07:46:05 UTC (rev 8521)
+++ code/branches/unity_build/src/libraries/core/command/IOConsoleWindows.cc	2011-05-20 14:05:32 UTC (rev 8522)
@@ -207,6 +207,7 @@
         case Shell::Ultra:   colour = FOREGROUND_INTENSITY                                     ; break;
         case Shell::Command: colour =                        FOREGROUND_GREEN                  | FOREGROUND_BLUE; break;
         case Shell::Hint:    colour =                        FOREGROUND_GREEN | FOREGROUND_RED                  ; break;
+        case Shell::TDebug:  colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED | FOREGROUND_BLUE; break;
         default:             colour =                        FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break;
         }
 

Modified: code/branches/unity_build/src/libraries/core/command/Shell.h
===================================================================
--- code/branches/unity_build/src/libraries/core/command/Shell.h	2011-05-20 07:46:05 UTC (rev 8521)
+++ code/branches/unity_build/src/libraries/core/command/Shell.h	2011-05-20 14:05:32 UTC (rev 8522)
@@ -90,6 +90,7 @@
             /// Defines the type of a line of text in the Shell - some types depend on the output level, others are of internal use.
             enum LineType
             {
+                TDebug  = OutputLevel::TDebug,
                 None    = OutputLevel::None,
                 Warning = OutputLevel::Warning,
                 Error   = OutputLevel::Error,

Modified: code/branches/unity_build/src/libraries/util/Debug.h
===================================================================
--- code/branches/unity_build/src/libraries/util/Debug.h	2011-05-20 07:46:05 UTC (rev 8521)
+++ code/branches/unity_build/src/libraries/util/Debug.h	2011-05-20 14:05:32 UTC (rev 8522)
@@ -122,4 +122,10 @@
         /*else*/ :                                                     \
             orxonox::OutputHandler::getOutStream(level)
 
+/** Logs debug output: You can use DOUT exactly like @c std::cout.
+    Use this macro to produce temporary debug output that will be removed later on.
+    The console output shall have a special colour if available.
+*/
+#define DOUT orxonox::OutputHandler::getOutStream(-1) << "+++ "
+
 #endif /* _Util_Debug_H__ */

Modified: code/branches/unity_build/src/libraries/util/OutputHandler.h
===================================================================
--- code/branches/unity_build/src/libraries/util/OutputHandler.h	2011-05-20 07:46:05 UTC (rev 8521)
+++ code/branches/unity_build/src/libraries/util/OutputHandler.h	2011-05-20 14:05:32 UTC (rev 8522)
@@ -61,6 +61,7 @@
     {
         enum Value
         {
+            TDebug  = -1,
             None    = 0,
             Error   = 1,
             Warning = 2,

Modified: code/branches/unity_build/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/unity_build/src/orxonox/overlays/InGameConsole.cc	2011-05-20 07:46:05 UTC (rev 8521)
+++ code/branches/unity_build/src/orxonox/overlays/InGameConsole.cc	2011-05-20 14:05:32 UTC (rev 8522)
@@ -589,6 +589,9 @@
         case Shell::Hint:    colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f);
                           colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); break;
 
+        case Shell::TDebug:  colourTop = ColourValue(0.90f, 0.00f, 0.90f, 1.00f);
+                          colourBottom = ColourValue(1.00f, 0.00f, 1.00f, 1.00f); break;
+
         default:             colourTop = ColourValue(0.90f, 0.90f, 0.90f, 1.00f);
                           colourBottom = ColourValue(1.00f, 1.00f, 1.00f, 1.00f); break;
         }




More information about the Orxonox-commit mailing list