Index: /code/branches/FICN/src/orxonox/core/Debug.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/Debug.h	(revision 698)
+++ /code/branches/FICN/src/orxonox/core/Debug.h	(revision 699)
@@ -68,6 +68,6 @@
 
 #define PRINT_EXEC  printf
-//#define COUT_EXEC   std::cout
-#define COUT_EXEC   orxonox::OutputHandler::getOutStream()
+#define COUT_EXEC(x) \
+  orxonox::OutputHandler::getOutStream().setOutputLevel(x)
 
 #ifndef PRINTF
@@ -207,8 +207,8 @@
    #define COUT1  \
     if (getSoftDebugLevel() >= ORX_ERROR)  \
-     COUT_EXEC
+     COUT_EXEC(1)
   #else
    #define COUT1 if (ORX_NONE)\
-    COUT_EXEC
+    COUT_EXEC(1)
   #endif
 
@@ -216,8 +216,8 @@
    #define COUT2 \
     if (getSoftDebugLevel() >= ORX_WARNING) \
-     COUT_EXEC
+     COUT_EXEC(2)
   #else
    #define COUT2 if (ORX_NONE) \
-    COUT_EXEC
+    COUT_EXEC(2)
   #endif
 
@@ -225,8 +225,8 @@
    #define COUT3 \
     if (getSoftDebugLevel() >= ORX_INFO) \
-     COUT_EXEC
+     COUT_EXEC(3)
   #else
    #define COUT3 if (ORX_NONE) \
-    COUT_EXEC
+    COUT_EXEC(3)
   #endif
 
@@ -234,8 +234,8 @@
    #define COUT4 \
     if (getSoftDebugLevel() >= ORX_DEBUG) \
-     COUT_EXEC
+     COUT_EXEC(4)
   #else
    #define COUT4 if (ORX_NONE) \
-    COUT_EXEC
+    COUT_EXEC(4)
   #endif
 
@@ -243,17 +243,17 @@
    #define COUT5 \
     if (getSoftDebugLevel() >= ORX_vDEBUG) \
-     COUT_EXEC
+     COUT_EXEC(5)
   #else
    #define COUT5 if (ORX_NONE) \
-    COUT_EXEC
+    COUT_EXEC(5)
   #endif
 
  #else /* if ORX_PRINT_DEBUG_OUTPUT */
   #define COUT(x) if (ORX_NONE) \
-   COUT_EXEC
+   COUT_EXEC(5)
  #endif /* if ORX_PRINT_DEBUG_OUTPUT */
 
  #define COUT0 \
-  COUT_EXEC
+  COUT_EXEC(0)
 #endif /* ifndef COUT */
 
Index: /code/branches/FICN/src/orxonox/core/DebugLevel.cc
===================================================================
--- /code/branches/FICN/src/orxonox/core/DebugLevel.cc	(revision 698)
+++ /code/branches/FICN/src/orxonox/core/DebugLevel.cc	(revision 699)
@@ -32,5 +32,4 @@
 
 #include "CoreIncludes.h"
-#include "Debug.h"
 #include "DebugLevel.h"
 
@@ -53,5 +52,14 @@
     void DebugLevel::setConfigValues()
     {
-        SetConfigValue(softDebugLevel_, 2);
+        SetConfigValue(softDebugLevelConsole_, 3);
+        SetConfigValue(softDebugLevelLogfile_, 3);
+        SetConfigValue(softDebugLevelShell_, 1);
+
+        // softDebugLevel_ is the maximum of the 3 variables
+        this->softDebugLevel_ = this->softDebugLevelConsole_;
+        if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelLogfile_;
+        if (this->softDebugLevelShell_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelShell_;
     }
 
@@ -59,5 +67,5 @@
         @brief Static function that holds the singleton.
     */
-    int DebugLevel::getSoftDebugLevel()
+    int DebugLevel::getSoftDebugLevel(OutputHandler::OutputDevice device)
     {
         static bool bCreatingSoftDebugLevelObject = true;   // Static variable - used to enhance the performance
@@ -67,5 +75,14 @@
         // If bReturnSoftDebugLevel is true, the instance of DebugLevel was created (it's set to true at the end of the constructor, call by reference)
         if (bReturnSoftDebugLevel)
-            return theOnlyDebugLevelObject->softDebugLevel_;
+        {
+            if (device == OutputHandler::LD_All)
+                return theOnlyDebugLevelObject->softDebugLevel_;
+            else if (device == OutputHandler::LD_Console)
+                return theOnlyDebugLevelObject->softDebugLevelConsole_;
+            else if (device == OutputHandler::LD_Logfile)
+                return theOnlyDebugLevelObject->softDebugLevelLogfile_;
+            else if (device == OutputHandler::LD_Shell)
+                return theOnlyDebugLevelObject->softDebugLevelShell_;
+        }
 
         // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
@@ -74,5 +91,5 @@
             bCreatingSoftDebugLevelObject = false;
             theOnlyDebugLevelObject = new DebugLevel(bReturnSoftDebugLevel);
-            return theOnlyDebugLevelObject->softDebugLevel_;
+            return getSoftDebugLevel(device);
         }
 
Index: /code/branches/FICN/src/orxonox/core/DebugLevel.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/DebugLevel.h	(revision 698)
+++ /code/branches/FICN/src/orxonox/core/DebugLevel.h	(revision 699)
@@ -31,5 +31,5 @@
 
     The DebugLevel class is a singleton, only used to configure the amount of debug
-    output (see Debug.h) into the console and the log-file (see OutputHandler.h).
+    output (see Debug.h) into the console and the logfile (see OutputHandler.h).
 */
 
@@ -39,4 +39,5 @@
 #include "CorePrereqs.h"
 #include "OrxonoxClass.h"
+#include "OutputHandler.h"
 
 namespace orxonox
@@ -46,5 +47,5 @@
     {
         public:
-            static int getSoftDebugLevel();
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
             void setConfigValues();
 
@@ -55,4 +56,7 @@
 
             int softDebugLevel_;                            //!< The debug level
+            int softDebugLevelConsole_;                     //!< The debug level for the console
+            int softDebugLevelLogfile_;                     //!< The debug level for the logfile
+            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
             ConfigValueContainer* softDebugLevelContainer_; //!< The config value container for the debug level
     };
Index: /code/branches/FICN/src/orxonox/core/OutputHandler.cc
===================================================================
--- /code/branches/FICN/src/orxonox/core/OutputHandler.cc	(revision 698)
+++ /code/branches/FICN/src/orxonox/core/OutputHandler.cc	(revision 699)
@@ -27,4 +27,5 @@
 
 #include "OutputHandler.h"
+#include "DebugLevel.h"
 
 namespace orxonox
@@ -61,4 +62,14 @@
 
     /**
+        @brief Returns the soft debug level for a given output device.
+        @param device The output device
+        @return The debug level
+    */
+    int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device)
+    {
+        return DebugLevel::getSoftDebugLevel(device);
+    }
+
+    /**
         @brief Overloaded << operator, redirects the output to the console and the logfile.
         @param sb The streambuffer that should be shown in the console
@@ -67,7 +78,13 @@
     OutputHandler& OutputHandler::operator<<(std::streambuf* sb)
     {
-        std::cout << sb;
-        this->logfile_ << sb;
-        this->logfile_.flush();
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            std::cout << sb;
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            this->logfile_ << sb;
+            this->logfile_.flush();
+        }
+
         return *this;
     }
@@ -80,7 +97,13 @@
     OutputHandler& OutputHandler::operator<<(std::ostream& (*manipulator)(std::ostream&))
     {
-        manipulator(std::cout);
-        manipulator(this->logfile_);
-        this->logfile_.flush();
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
         return *this;
     }
@@ -93,7 +116,13 @@
     OutputHandler& OutputHandler::operator<<(std::ios& (*manipulator)(std::ios&))
     {
-        manipulator(std::cout);
-        manipulator(this->logfile_);
-        this->logfile_.flush();
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
         return *this;
     }
@@ -106,86 +135,14 @@
     OutputHandler& OutputHandler::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
     {
-        manipulator(std::cout);
-        manipulator(this->logfile_);
-        this->logfile_.flush();
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
         return *this;
     }
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, char c)
-    {
-        std::cout << c;
-        out.getLogfile() << c;
-        out.getLogfile().flush();
-        return out;
-    }*/
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, signed char c)
-    {
-        std::cout << c;
-        out.getLogfile() << c;
-        out.getLogfile().flush();
-        return out;
-    }*/
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, unsigned char c)
-    {
-        std::cout << c;
-        out.getLogfile() << c;
-        out.getLogfile().flush();
-        return out;
-    }*/
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, const char* s)
-    {
-        std::cout << s;
-        out.getLogfile() << s;
-        out.getLogfile().flush();
-        return out;
-    }*/
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, const signed char* s)
-    {
-        std::cout << s;
-        out.getLogfile() << s;
-        out.getLogfile().flush();
-        return out;
-    }*/
-
-    /**
-        @brief Overloaded non-member << operator, redirects the output to the console and the logfile.
-        @param output The value that should be shown in the console
-        @return A reference to the OutputHandler itself
-    *//*
-    OutputHandler& operator<<(OutputHandler& out, const unsigned char* s)
-    {
-        std::cout << s;
-        out.getLogfile() << s;
-        out.getLogfile().flush();
-        return out;
-    }*/
- }
+}
Index: /code/branches/FICN/src/orxonox/core/OutputHandler.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/OutputHandler.h	(revision 698)
+++ /code/branches/FICN/src/orxonox/core/OutputHandler.h	(revision 699)
@@ -49,8 +49,27 @@
     {
         public:
+            enum OutputDevice
+            {
+                LD_All,
+                LD_Console,
+                LD_Logfile,
+                LD_Shell
+            };
+
             static OutputHandler& getOutStream();
 
             /** @returns a reference to the logfile. */
-            inline std::ofstream& getLogfile() { return this->logfile_; }
+            inline std::ofstream& getLogfile()
+                { return this->logfile_; }
+
+            /** @brief Sets the level of the incoming output. @param level The level of the incoming output @return The OutputHandler itself */
+            inline OutputHandler& setOutputLevel(int level)
+                { this->outputLevel_ = level; return *this; }
+
+            /** @returns the level of the incoming output. */
+            inline int getOutputLevel() const
+                { return this->outputLevel_; }
+
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device);
 
             template <class T>
@@ -94,4 +113,5 @@
             std::ofstream logfile_;     //!< The logfile where the output is logged
             std::string logfilename_;   //!< The name of the logfile
+            int outputLevel_;           //!< The level of the incoming output
     };
 
@@ -104,18 +124,16 @@
     OutputHandler& OutputHandler::output(const T& output)
     {
-        std::cout << output;
-        this->logfile_ << output;
-        this->logfile_.flush();
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            std::cout << output;
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            this->logfile_ << output;
+            this->logfile_.flush();
+        }
+
         return *this;
     }
-/*
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, char c);
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, signed char c);
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, unsigned char c);
 
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, const char* s);
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, const signed char* s);
-    _CoreExport OutputHandler& operator<<(OutputHandler& out, const unsigned char* s);
-*/
     /**
         @brief Overloading of the non-member << operator to redirect the output of classes with self defined '<< to std::ostream' operators to the console and the logfile.
@@ -127,7 +145,13 @@
     OutputHandler& operator<<(OutputHandler& out, const T& output)
     {
-        std::cout << output;
-        out.getLogfile() << output;
-        out.getLogfile().flush();
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Console) >= out.getOutputLevel())
+            std::cout << output;
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Logfile) >= out.getOutputLevel())
+        {
+            out.getLogfile() << output;
+            out.getLogfile().flush();
+        }
+
         return out;
     }
