Index: code/branches/core3/src/asylum/audio/_AudioObject.cc
===================================================================
--- code/branches/core3/src/asylum/audio/_AudioObject.cc	(revision 1585)
+++ code/branches/core3/src/asylum/audio/_AudioObject.cc	(revision 1586)
@@ -30,5 +30,5 @@
 #include <string>
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "AudioObject.h"
 
Index: code/branches/core3/src/asylum/loader/LevelLoader.cc
===================================================================
--- code/branches/core3/src/asylum/loader/LevelLoader.cc	(revision 1585)
+++ code/branches/core3/src/asylum/loader/LevelLoader.cc	(revision 1586)
@@ -31,10 +31,9 @@
 #include <OgreOverlayManager.h>
 
+#include "core/BaseObject.h"
 #include "core/Error.h"
-#include "core/Debug.h"
 #include "core/CoreIncludes.h"
 
 #include "audio/AudioManager.h"
-#include "core/BaseObject.h"
 #include "orxonox/Orxonox.h"
 
Index: code/branches/core3/src/asylum/orxonox/SpaceshipSteering.cc
===================================================================
--- code/branches/core3/src/asylum/orxonox/SpaceshipSteering.cc	(revision 1585)
+++ code/branches/core3/src/asylum/orxonox/SpaceshipSteering.cc	(revision 1586)
@@ -31,5 +31,5 @@
 #include <OgreSceneNode.h>
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "util/Math.h"
 #include "SpaceshipSteering.h"
Index: code/branches/core3/src/asylum/util/String2Number.h
===================================================================
--- code/branches/core3/src/asylum/util/String2Number.h	(revision 1585)
+++ code/branches/core3/src/asylum/util/String2Number.h	(revision 1586)
@@ -36,5 +36,5 @@
 #include <iostream>
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 
 /**
Index: code/branches/core3/src/audio/AudioManager.cc
===================================================================
--- code/branches/core3/src/audio/AudioManager.cc	(revision 1585)
+++ code/branches/core3/src/audio/AudioManager.cc	(revision 1586)
@@ -35,5 +35,5 @@
 #include "AudioStream.h"
 #include "core/Error.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 
 namespace audio
Index: code/branches/core3/src/audio/AudioStream.cc
===================================================================
--- code/branches/core3/src/audio/AudioStream.cc	(revision 1585)
+++ code/branches/core3/src/audio/AudioStream.cc	(revision 1586)
@@ -28,5 +28,5 @@
 #include "AudioStream.h"
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/Error.h"
 
Index: code/branches/core3/src/core/CMakeLists.txt
===================================================================
--- code/branches/core3/src/core/CMakeLists.txt	(revision 1585)
+++ code/branches/core3/src/core/CMakeLists.txt	(revision 1586)
@@ -7,6 +7,4 @@
   ObjectListBase.cc
   OrxonoxClass.cc
-  OutputBuffer.cc
-  OutputHandler.cc
   Script.cc
   SignalHandler.cc
Index: code/branches/core3/src/core/ClassFactory.h
===================================================================
--- code/branches/core3/src/core/ClassFactory.h	(revision 1585)
+++ code/branches/core3/src/core/ClassFactory.h	(revision 1586)
@@ -43,5 +43,5 @@
 #include "Factory.h"
 #include "Identifier.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/CommandEvaluation.cc
===================================================================
--- code/branches/core3/src/core/CommandEvaluation.cc	(revision 1585)
+++ code/branches/core3/src/core/CommandEvaluation.cc	(revision 1586)
@@ -30,5 +30,5 @@
 #include "ConsoleCommand.h"
 #include "Identifier.h"
-#include "Debug.h"
+#include "util/Debug.h"
 #include "util/String.h"
 
Index: code/branches/core3/src/core/CommandExecutor.cc
===================================================================
--- code/branches/core3/src/core/CommandExecutor.cc	(revision 1585)
+++ code/branches/core3/src/core/CommandExecutor.cc	(revision 1586)
@@ -31,7 +31,7 @@
 #include "util/String.h"
 #include "util/Convert.h"
+#include "util/Debug.h"
 #include "Identifier.h"
 #include "Language.h"
-#include "Debug.h"
 #include "TclBind.h"
 
Index: code/branches/core3/src/core/ConsoleCommandCompilation.cc
===================================================================
--- code/branches/core3/src/core/ConsoleCommandCompilation.cc	(revision 1585)
+++ code/branches/core3/src/core/ConsoleCommandCompilation.cc	(revision 1586)
@@ -29,5 +29,5 @@
 #include "ConsoleCommandCompilation.h"
 #include "ConsoleCommand.h"
-#include "Debug.h"
+#include "util/Debug.h"
 #include "util/ExprParser.h"
 
Index: code/branches/core3/src/core/Core.cc
===================================================================
--- code/branches/core3/src/core/Core.cc	(revision 1585)
+++ code/branches/core3/src/core/Core.cc	(revision 1586)
@@ -107,4 +107,8 @@
             this->softDebugLevel_ = this->softDebugLevelShell_;
 
+        OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
+        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
+        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
+        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
 
         std::string temp = this->language_;
@@ -158,4 +162,6 @@
             else if (device == OutputHandler::LD_Shell)
                 Core::getInstance().softDebugLevelShell_ = level;
+
+            OutputHandler::setSoftDebugLevel(device, level);
         }
      }
@@ -199,11 +205,2 @@
     }
 }
-
-/**
-    @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
-    @return The soft debug level
-*/
-int getSoftDebugLevel()
-{
-    return orxonox::Core::getSoftDebugLevel();
-}
Index: code/branches/core3/src/core/Core.h
===================================================================
--- code/branches/core3/src/core/Core.h	(revision 1585)
+++ code/branches/core3/src/core/Core.h	(revision 1586)
@@ -41,5 +41,5 @@
 
 #include "OrxonoxClass.h"
-#include "OutputHandler.h"
+#include "util/OutputHandler.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/CoreIncludes.h
===================================================================
--- code/branches/core3/src/core/CoreIncludes.h	(revision 1585)
+++ code/branches/core3/src/core/CoreIncludes.h	(revision 1586)
@@ -46,5 +46,5 @@
 #include "Factory.h"
 #include "ClassFactory.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 
Index: code/branches/core3/src/core/CorePrereqs.h
===================================================================
--- code/branches/core3/src/core/CorePrereqs.h	(revision 1585)
+++ code/branches/core3/src/core/CorePrereqs.h	(revision 1586)
@@ -139,7 +139,4 @@
   class ObjectListBaseElement;
   class OrxonoxClass;
-  class OutputBuffer;
-  class OutputBufferListener;
-  class OutputHandler;
   class Shell;
   class ShellListener;
Index: code/branches/core3/src/core/Debug.h
===================================================================
--- code/branches/core3/src/core/Debug.h	(revision 1585)
+++ 	(revision )
@@ -1,239 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Benjamin Grauer
- *   Co-authors:
- *      Fabian 'x3n' Landau
- *
- */
-
-/**
- * @file Debug.h
- * @brief Handles the output for different verbose-modes.
- *
- * There are two modes: HARD and SOFT. HARD is precessed during compiletime, while SOFT is for runtime.
- */
-
-#ifndef _Debug_H__
-#define _Debug_H__
-
-#include "CorePrereqs.h"
-
-#include <stdio.h>
-
-#include "OutputHandler.h"
-
-extern "C" _CoreExport int getSoftDebugLevel();
-
-// DEFINE ERROR MODES
-#define ORX_NONE            0
-#define ORX_ERROR           1
-#define ORX_WARNING         2
-#define ORX_INFO            3
-#define ORX_DEBUG           4
-#define ORX_VERBOSE         5
-#define ORX_ULTRA           6
-
-//definitions
-#define ORX_PRINT_DEBUG_OUTPUT 1
-#define ORX_HARD_DEBUG_LEVEL ORX_VERBOSE
-
-#define COUT_EXEC(x) orxonox::OutputHandler::getOutStream().setOutputLevel(x)
-
-////////////////////////////////////////////////////////
-///  COUT: just prints output as is with std::cout   ///
-////////////////////////////////////////////////////////
-#define COUTORX_NONE    COUT0
-#define COUTORX_ERROR   COUT1
-#define COUTORX_WARNING COUT2
-#define COUTORX_INFO    COUT3
-#define COUTORX_DEBUG   COUT4
-#define COUTORX_VERBOSE COUT5
-#define COUTORX_ULTRA   COUT6
-
-#ifndef COUT
- #if ORX_PRINT_DEBUG_OUTPUT
-  #define COUT(x) \
-   COUT ## x
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
-   #define COUT0  \
-    if (getSoftDebugLevel() >= ORX_NONE)  \
-     COUT_EXEC(0)
-  #else
-   #define COUT0 \
-    false ? COUT_EXEC(0) : COUT_EXEC(0)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
-   #define COUT1  \
-    if (getSoftDebugLevel() >= ORX_ERROR)  \
-     COUT_EXEC(1)
-  #else
-   #define COUT1 \
-    false ? COUT_EXEC(1) : COUT_EXEC(1)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
-   #define COUT2 \
-    if (getSoftDebugLevel() >= ORX_WARNING) \
-     COUT_EXEC(2)
-  #else
-   #define COUT2 \
-    false ? COUT_EXEC(2) : COUT_EXEC(2)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
-   #define COUT3 \
-    if (getSoftDebugLevel() >= ORX_INFO) \
-     COUT_EXEC(3)
-  #else
-   #define COUT3 \
-    false ? COUT_EXEC(3) : COUT_EXEC(3)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
-   #define COUT4 \
-    if (getSoftDebugLevel() >= ORX_DEBUG) \
-     COUT_EXEC(4)
-  #else
-   #define COUT4 \
-    false ? COUT_EXEC(4) : COUT_EXEC(4)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
-   #define COUT5 \
-    if (getSoftDebugLevel() >= ORX_VERBOSE) \
-     COUT_EXEC(5)
-  #else
-   #define COUT5 \
-    false ? COUT_EXEC(5) : COUT_EXEC(5)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
-   #define COUT6 \
-    if (getSoftDebugLevel() >= ORX_ULTRA) \
-     COUT_EXEC(6)
-  #else
-   #define COUT6 \
-    false ? COUT_EXEC(6) : COUT_EXEC(6)
-  #endif
-
- #else /* if ORX_PRINT_DEBUG_OUTPUT */
-  #define COUT(x) \
-    false ? COUT_EXEC(6) : COUT_EXEC(6)
- #endif /* if ORX_PRINT_DEBUG_OUTPUT */
-
-#endif /* ifndef COUT */
-
-
-/////////////////////////////////////////////////////////////////////
-///  CCOUT: Prints output with std::cout and adds the classname   ///
-/////////////////////////////////////////////////////////////////////
-#define CCOUTORX_NONE    CCOUT0
-#define CCOUTORX_ERROR   CCOUT1
-#define CCOUTORX_WARNING CCOUT2
-#define CCOUTORX_INFO    CCOUT3
-#define CCOUTORX_DEBUG   CCOUT4
-#define CCOUTORX_VERBOSE CCOUT5
-#define CCOUTORX_ULTRA   CCOUT6
-
-#define CCOUT_EXEC(x) \
-  orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
-  << this->getIdentifier()->getName() << ": "
-
-#ifndef CCOUT
- #if ORX_PRINT_DEBUG_OUTPUT
-  #define CCOUT(x) \
-   CCOUT ## x
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
-   #define CCOUT0  \
-    if (getSoftDebugLevel() >= ORX_NONE)  \
-     CCOUT_EXEC(0)
-  #else
-   #define CCOUT0 \
-    false ? CCOUT_EXEC(0) : CCOUT_EXEC(0)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
-   #define CCOUT1  \
-    if (getSoftDebugLevel() >= ORX_ERROR)  \
-     CCOUT_EXEC(1)
-  #else
-   #define CCOUT1 \
-    false ? CCOUT_EXEC(1) : CCOUT_EXEC(1)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
-   #define CCOUT2 \
-    if (getSoftDebugLevel() >= ORX_WARNING) \
-     CCOUT_EXEC(2)
-  #else
-   #define CCOUT2 \
-    false ? CCOUT_EXEC(2) : CCOUT_EXEC(2)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
-   #define CCOUT3 \
-    if (getSoftDebugLevel() >= ORX_INFO) \
-     CCOUT_EXEC(3)
-  #else
-   #define CCOUT3 \
-    false ? CCOUT_EXEC(3) : CCOUT_EXEC(3)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
-   #define CCOUT4 \
-    if (getSoftDebugLevel() >= ORX_DEBUG) \
-     CCOUT_EXEC(4)
-  #else
-   #define CCOUT4 \
-    false ? CCOUT_EXEC(4) : CCOUT_EXEC(4)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
-   #define CCOUT5 \
-    if (getSoftDebugLevel() >= ORX_VERBOSE) \
-     CCOUT_EXEC(5)
-  #else
-   #define CCOUT5 \
-    false ? CCOUT_EXEC(5) : CCOUT_EXEC(5)
-  #endif
-
-  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
-   #define CCOUT6 \
-    if (getSoftDebugLevel() >= ORX_ULTRA) \
-     CCOUT_EXEC(6)
-  #else
-   #define CCOUT6 \
-    false ? CCOUT_EXEC(6) : CCOUT_EXEC(6)
-  #endif
-
- #else /* if ORX_PRINT_DEBUG_OUTPUT */
-  #define CCOUT(x) \
-   false ? CCOUT_EXEC(6) : CCOUT_EXEC(6)
- #endif /* if ORX_PRINT_DEBUG_OUTPUT */
-
-#endif /* ifndef CCOUT */
-
-#endif /* _Debug_H__ */
Index: code/branches/core3/src/core/Error.cc
===================================================================
--- code/branches/core3/src/core/Error.cc	(revision 1585)
+++ code/branches/core3/src/core/Error.cc	(revision 1586)
@@ -33,5 +33,5 @@
 
 #include "Error.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/Executor.h
===================================================================
--- code/branches/core3/src/core/Executor.h	(revision 1585)
+++ code/branches/core3/src/core/Executor.h	(revision 1586)
@@ -37,5 +37,5 @@
 #include "util/Math.h"
 #include "Functor.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 
Index: code/branches/core3/src/core/Factory.cc
===================================================================
--- code/branches/core3/src/core/Factory.cc	(revision 1585)
+++ code/branches/core3/src/core/Factory.cc	(revision 1586)
@@ -34,6 +34,6 @@
 #include "Factory.h"
 #include "Identifier.h"
-#include "Debug.h"
 #include "BaseObject.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/Functor.h
===================================================================
--- code/branches/core3/src/core/Functor.h	(revision 1585)
+++ code/branches/core3/src/core/Functor.h	(revision 1586)
@@ -34,5 +34,5 @@
 
 #include "util/MultiTypeMath.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 #define MAX_FUNCTOR_ARGUMENTS 5
Index: code/branches/core3/src/core/Identifier.h
===================================================================
--- code/branches/core3/src/core/Identifier.h	(revision 1585)
+++ code/branches/core3/src/core/Identifier.h	(revision 1586)
@@ -60,6 +60,6 @@
 #include <utility>
 
-#include "Debug.h"
 #include "Iterator.h"
+#include "util/Debug.h"
 #include "util/String.h"
 
Index: code/branches/core3/src/core/Language.cc
===================================================================
--- code/branches/core3/src/core/Language.cc	(revision 1585)
+++ code/branches/core3/src/core/Language.cc	(revision 1586)
@@ -37,6 +37,5 @@
 
 #include "Core.h"
-
-#include "Debug.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/Loader.cc
===================================================================
--- code/branches/core3/src/core/Loader.cc	(revision 1585)
+++ code/branches/core3/src/core/Loader.cc	(revision 1586)
@@ -33,8 +33,8 @@
 #include "Iterator.h"
 #include "ObjectList.h"
-#include "Debug.h"
 #include "CoreIncludes.h"
 #include "Script.h"
 #include "Namespace.h"
+#include "util/Debug.h"
 
 #include "tinyxml/ticpp.h"
Index: code/branches/core3/src/core/MetaObjectList.cc
===================================================================
--- code/branches/core3/src/core/MetaObjectList.cc	(revision 1585)
+++ code/branches/core3/src/core/MetaObjectList.cc	(revision 1586)
@@ -33,5 +33,5 @@
 
 #include "MetaObjectList.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/NamespaceNode.cc
===================================================================
--- code/branches/core3/src/core/NamespaceNode.cc	(revision 1585)
+++ code/branches/core3/src/core/NamespaceNode.cc	(revision 1586)
@@ -28,5 +28,5 @@
 
 #include "NamespaceNode.h"
-#include "Debug.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/OutputBuffer.cc
===================================================================
--- code/branches/core3/src/core/OutputBuffer.cc	(revision 1585)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OutputBuffer.h"
-
-#define OUTPUTBUFFER_MAX_LINE_LENGTH 16384
-
-namespace orxonox
-{
-    void OutputBuffer::registerListener(OutputBufferListener* listener)
-    {
-        this->listeners_.insert(this->listeners_.end(), listener);
-    }
-
-    void OutputBuffer::unregisterListener(OutputBufferListener* listener)
-    {
-        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
-        {
-            if ((*it) == listener)
-                this->listeners_.erase(it++);
-            else
-                ++it;
-        }
-    }
-
-    OutputBuffer& OutputBuffer::operator<<(std::ostream& (*manipulator)(std::ostream&))
-    {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
-    }
-
-    OutputBuffer& OutputBuffer::operator<<(std::ios& (*manipulator)(std::ios&))
-    {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
-    }
-
-    OutputBuffer& OutputBuffer::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
-    {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
-    }
-
-    bool OutputBuffer::getLine(std::string* output)
-    {
-        char line[OUTPUTBUFFER_MAX_LINE_LENGTH];
-
-        this->stream_.getline(line, OUTPUTBUFFER_MAX_LINE_LENGTH);
-        (*output) = std::string(line);
-
-        bool eof = this->stream_.eof();
-        bool fail = this->stream_.fail();
-
-        if (eof)
-            this->stream_.flush();
-
-        if (eof || fail)
-            this->stream_.clear();
-
-        return (!eof && !fail);
-    }
-
-    void OutputBuffer::callListeners()
-    {
-        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
-            (*it)->outputChanged();
-    }
-}
Index: code/branches/core3/src/core/OutputBuffer.h
===================================================================
--- code/branches/core3/src/core/OutputBuffer.h	(revision 1585)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _OutputBuffer_H__
-#define _OutputBuffer_H__
-
-#include <list>
-#include <sstream>
-#include <iostream>
-
-#include "CorePrereqs.h"
-
-namespace orxonox
-{
-    class _CoreExport OutputBufferListener
-    {
-        friend class OutputBuffer;
-
-        public:
-            virtual ~OutputBufferListener() {}
-
-        private:
-            virtual void outputChanged() = 0;
-    };
-
-    class _CoreExport OutputBuffer
-    {
-        public:
-            OutputBuffer() {}
-            ~OutputBuffer() {}
-
-            template <class T>
-            inline OutputBuffer& operator<<(T object)
-            {
-                this->stream_ << object;
-                this->callListeners();
-                return *this;
-            }
-
-            OutputBuffer& operator<<(std::ostream& (*manipulator)(std::ostream&));
-            OutputBuffer& operator<<(std::ios& (*manipulator)(std::ios&));
-            OutputBuffer& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
-
-            template <class T>
-            inline void add(T object)
-            {
-                this->stream_ << object;
-                this->callListeners();
-            }
-
-            template <class T>
-            inline void addLine(T object)
-            {
-                this->stream_ << object << std::endl;
-                this->callListeners();
-            }
-
-            inline void newline()
-            {
-                this->stream_ << std::endl;
-                this->callListeners();
-            }
-
-            inline void flush()
-            {
-                this->stream_.flush();
-            }
-
-            bool getLine(std::string* output);
-
-            void registerListener(OutputBufferListener* listener);
-            void unregisterListener(OutputBufferListener* listener);
-
-        private:
-            void callListeners();
-
-            std::stringstream stream_;
-            std::list<OutputBufferListener*> listeners_;
-    };
-}
-
-#endif /* _OutputBuffer_H__ */
Index: code/branches/core3/src/core/OutputHandler.cc
===================================================================
--- code/branches/core3/src/core/OutputHandler.cc	(revision 1585)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file OutputHandler.cc
-    @brief Implementation of the OutputHandler class.
-*/
-
-#include "OutputHandler.h"
-#include "Core.h"
-#include "ConsoleCommand.h"
-#include "Shell.h"
-
-namespace orxonox
-{
-    SetConsoleCommandShortcutGeneric(log,     createConsoleCommand(createFunctor(&OutputHandler::log),     "log"    ));
-    SetConsoleCommandShortcutGeneric(error,   createConsoleCommand(createFunctor(&OutputHandler::error),   "error"  ));
-    SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));
-    SetConsoleCommandShortcutGeneric(info,    createConsoleCommand(createFunctor(&OutputHandler::info),    "info"   ));
-    SetConsoleCommandShortcutGeneric(debug,   createConsoleCommand(createFunctor(&OutputHandler::debug),   "debug"  ));
-
-    /**
-        @brief Constructor: Opens the logfile and writes the first line.
-        @param logfilename The name of the logfile
-    */
-    OutputHandler::OutputHandler(const std::string& logfilename)
-    {
-        this->logfilename_ = logfilename;
-        this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
-        this->logfile_ << "Started log at yyyy/mm/dd hh:mm:ss" << std::endl;
-        this->logfile_.flush();
-    }
-
-    /**
-        @brief Destructor: Writes the last line to the logfile and closes it.
-    */
-    OutputHandler::~OutputHandler()
-    {
-        this->logfile_ << "Closed log" << std::endl;
-        this->logfile_.close();
-    }
-
-    /**
-        @brief Returns a reference to the only existing instance of the OutputHandler class.
-        @return The instance
-    */
-    OutputHandler& OutputHandler::getOutStream()
-    {
-        static OutputHandler orxout("orxonox.log");
-        return orxout;
-    }
-
-    /**
-        @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 Core::getSoftDebugLevel(device);
-    }
-
-    /**
-        @brief Returns the Shell's OutputBuffer. This is mere placed here to avoid
-               recompiling the entire project when Shell.h changes.
-        @return The OutputBuffer of the Shell
-    */
-    OutputBuffer& OutputHandler::getShellOutputBuffer()
-    {
-        return Shell::getInstance().getOutputBuffer();
-    }
-
-    /**
-        @brief Overloaded << operator, redirects the output to the console and the logfile.
-        @param sb The streambuffer that should be shown in the console
-        @return A reference to the OutputHandler itself
-    */
-    OutputHandler& OutputHandler::operator<<(std::streambuf* sb)
-    {
-        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
-            std::cout << sb;
-
-        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
-        {
-            this->logfile_ << sb;
-            this->logfile_.flush();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
-            Shell::getInstance().getOutputBuffer() << sb;
-
-        return *this;
-    }
-
-    /**
-        @brief Overloaded << operator, redirects the output to the console and the logfile.
-        @param manipulator A function, manipulating the outstream.
-        @return A reference to the OutputHandler itself
-    */
-    OutputHandler& OutputHandler::operator<<(std::ostream& (*manipulator)(std::ostream&))
-    {
-        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
-            manipulator(std::cout);
-
-        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
-        {
-            manipulator(this->logfile_);
-            this->logfile_.flush();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
-            Shell::getInstance().getOutputBuffer() << manipulator;
-
-        return *this;
-    }
-
-    /**
-        @brief Overloaded << operator, redirects the output to the console and the logfile.
-        @param manipulator A function, manipulating the outstream.
-        @return A reference to the OutputHandler itself
-    */
-    OutputHandler& OutputHandler::operator<<(std::ios& (*manipulator)(std::ios&))
-    {
-        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
-            manipulator(std::cout);
-
-        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
-        {
-            manipulator(this->logfile_);
-            this->logfile_.flush();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
-            Shell::getInstance().getOutputBuffer() << manipulator;
-
-        return *this;
-    }
-
-    /**
-        @brief Overloaded << operator, redirects the output to the console and the logfile.
-        @param manipulator A function, manipulating the outstream.
-        @return A reference to the OutputHandler itself
-    */
-    OutputHandler& OutputHandler::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
-    {
-        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
-            manipulator(std::cout);
-
-        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
-        {
-            manipulator(this->logfile_);
-            this->logfile_.flush();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
-            Shell::getInstance().getOutputBuffer() << manipulator;
-
-        return *this;
-    }
-}
Index: code/branches/core3/src/core/OutputHandler.h
===================================================================
--- code/branches/core3/src/core/OutputHandler.h	(revision 1585)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file OutputHandler.h
-    @brief Definition of the OutputHandler class.
-
-    The OutputHandler acts like std::cout, but output isn't only shown in the console,
-    but also written to the logfile.
-*/
-
-#ifndef _OutputHandler_H__
-#define _OutputHandler_H__
-
-#include "CorePrereqs.h"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-
-#include "OutputBuffer.h"
-
-namespace orxonox
-{
-    //! The OutputHandler acts like std::cout, but redirects output to the console AND the logfile.
-    class _CoreExport OutputHandler
-    {
-        public:
-            enum OutputDevice
-            {
-                LD_All,
-                LD_Console,
-                LD_Logfile,
-                LD_Shell
-            };
-
-            static OutputHandler& getOutStream();
-
-            /** @brief Puts some text on the outstream. @param text The text */
-            static inline std::string log(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
-
-            /** @brief Puts an error on the outstream. @param text The text */
-            static inline std::string error(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
-
-            /** @brief Puts a warning on the outstream. @param text The text */
-            static inline std::string warning(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
-
-            /** @brief Puts an info on the outstream. @param text The text */
-            static inline std::string info(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
-
-            /** @brief Puts some debug output on the outstream. @param text The text */
-            static inline std::string debug(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
-
-            /** @brief Returns a reference to the logfile. @return The 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; }
-
-            /** @brief Returns the level of the incoming output. @return The level */
-            inline int getOutputLevel() const
-                { return this->outputLevel_; }
-
-            static int getSoftDebugLevel(OutputHandler::OutputDevice device);
-
-            OutputBuffer& getShellOutputBuffer();
-
-            template <class T>
-            OutputHandler& output(const T& output);
-
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(unsigned char val)   { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(short val)           { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(unsigned short val)  { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(int val)             { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(unsigned int val)    { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(long val)            { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(unsigned long val)   { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(float val)           { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(double val)          { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(long double val)     { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(const void* val)     { return this->output(val); }
-            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
-            inline OutputHandler& operator<<(bool val)            { return this->output(val); }
-
-            OutputHandler& operator<<(std::streambuf* sb);
-
-            OutputHandler& operator<<(std::ostream& (*manipulator)(std::ostream&));
-            OutputHandler& operator<<(std::ios& (*manipulator)(std::ios&));
-            OutputHandler& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
-
-        private:
-            explicit OutputHandler(const std::string& logfilename);
-            OutputHandler(const OutputHandler& oh);  // don't copy
-            virtual ~OutputHandler();
-            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
-    };
-
-    /**
-        @brief 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
-    */
-    template<class T>
-    OutputHandler& OutputHandler::output(const T& output)
-    {
-        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();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
-            OutputHandler::getOutStream().getShellOutputBuffer() << output;
-
-        return *this;
-    }
-
-    /**
-        @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.
-        @param out The OutputHandler itself
-        @param output The class that should be shown in the console
-        @return The OutputHandler itself
-    */
-    template<class T>
-    OutputHandler& operator<<(OutputHandler& out, const T& output)
-    {
-        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();
-        }
-
-        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= out.getOutputLevel())
-            OutputHandler::getOutStream().getShellOutputBuffer() << output;
-
-        return out;
-    }
-
-}
-
-#endif /* _OutputHandler_H__ */
Index: code/branches/core3/src/core/Shell.cc
===================================================================
--- code/branches/core3/src/core/Shell.cc	(revision 1585)
+++ code/branches/core3/src/core/Shell.cc	(revision 1586)
@@ -34,4 +34,5 @@
 #include "ConsoleCommand.h"
 #include "input/InputInterfaces.h"
+#include "util/OutputHandler.h"
 
 #define SHELL_UPDATE_LISTENERS(function) \
@@ -43,4 +44,10 @@
     SetConsoleCommand(Shell, clearShell, true);
     SetConsoleCommand(Shell, history, true);
+
+    SetConsoleCommandShortcutGeneric(log,     createConsoleCommand(createFunctor(&OutputHandler::log),     "log"    ));
+    SetConsoleCommandShortcutGeneric(error,   createConsoleCommand(createFunctor(&OutputHandler::error),   "error"  ));
+    SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));
+    SetConsoleCommandShortcutGeneric(info,    createConsoleCommand(createFunctor(&OutputHandler::info),    "info"   ));
+    SetConsoleCommandShortcutGeneric(debug,   createConsoleCommand(createFunctor(&OutputHandler::debug),   "debug"  ));
 
     Shell::Shell()
Index: code/branches/core3/src/core/Shell.h
===================================================================
--- code/branches/core3/src/core/Shell.h	(revision 1585)
+++ code/branches/core3/src/core/Shell.h	(revision 1586)
@@ -37,5 +37,5 @@
 #include "OrxonoxClass.h"
 #include "input/InputBuffer.h"
-#include "OutputBuffer.h"
+#include "util/OutputBuffer.h"
 
 namespace orxonox
Index: code/branches/core3/src/core/SignalHandler.cc
===================================================================
--- code/branches/core3/src/core/SignalHandler.cc	(revision 1585)
+++ code/branches/core3/src/core/SignalHandler.cc	(revision 1586)
@@ -36,6 +36,4 @@
 #include <assert.h>
 #include <iostream>
-
-#include "Debug.h"
 
 SignalHandler * SignalHandler::singletonRef = NULL;
Index: code/branches/core3/src/core/TclBind.cc
===================================================================
--- code/branches/core3/src/core/TclBind.cc	(revision 1585)
+++ code/branches/core3/src/core/TclBind.cc	(revision 1586)
@@ -32,7 +32,7 @@
 #include "ConsoleCommand.h"
 #include "CommandExecutor.h"
-#include "Debug.h"
 #include "TclThreadManager.h"
 #include "TclBind.h"
+#include "util/Debug.h"
 #include "util/String.h"
 
Index: code/branches/core3/src/core/TclThreadManager.cc
===================================================================
--- code/branches/core3/src/core/TclThreadManager.cc	(revision 1585)
+++ code/branches/core3/src/core/TclThreadManager.cc	(revision 1586)
@@ -38,7 +38,7 @@
 #include "ConsoleCommand.h"
 #include "CommandExecutor.h"
-#include "Debug.h"
 #include "TclBind.h"
 #include "TclThreadManager.h"
+#include "util/Debug.h"
 #include "util/Convert.h"
 
Index: code/branches/core3/src/core/XMLPort.h
===================================================================
--- code/branches/core3/src/core/XMLPort.h	(revision 1585)
+++ code/branches/core3/src/core/XMLPort.h	(revision 1586)
@@ -32,9 +32,9 @@
 #include "CorePrereqs.h"
 
+#include "util/Debug.h"
 #include "util/XMLIncludes.h"
 #include "util/MultiTypeMath.h"
 #include "tinyxml/ticpp.h"
 #include "Executor.h"
-#include "Debug.h"
 #include "CoreIncludes.h"
 #include "BaseObject.h"
Index: code/branches/core3/src/core/input/Button.cc
===================================================================
--- code/branches/core3/src/core/input/Button.cc	(revision 1585)
+++ code/branches/core3/src/core/input/Button.cc	(revision 1586)
@@ -36,5 +36,5 @@
 #include "util/SubString.h"
 #include "util/String.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/ConsoleCommand.h"
 #include "core/CommandEvaluation.h"
Index: code/branches/core3/src/core/input/InputManager.cc
===================================================================
--- code/branches/core3/src/core/input/InputManager.cc	(revision 1585)
+++ code/branches/core3/src/core/input/InputManager.cc	(revision 1586)
@@ -39,8 +39,8 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Debug.h"
 #include "core/CommandExecutor.h"
 #include "core/ConsoleCommand.h"
 #include "core/Shell.h"               // hack!
+#include "util/Debug.h"
 
 #include "InputBuffer.h"
Index: code/branches/core3/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/core3/src/core/input/KeyBinder.cc	(revision 1585)
+++ code/branches/core3/src/core/input/KeyBinder.cc	(revision 1586)
@@ -36,5 +36,5 @@
 #include <string>
 #include "util/Convert.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
Index: code/branches/core3/src/core/input/KeyDetector.cc
===================================================================
--- code/branches/core3/src/core/input/KeyDetector.cc	(revision 1585)
+++ code/branches/core3/src/core/input/KeyDetector.cc	(revision 1586)
@@ -33,5 +33,5 @@
 
 #include "KeyDetector.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/CoreIncludes.h"
 #include "core/CommandExecutor.h"
Index: code/branches/core3/src/network/ClientConnection.cc
===================================================================
--- code/branches/core3/src/network/ClientConnection.cc	(revision 1585)
+++ code/branches/core3/src/network/ClientConnection.cc	(revision 1586)
@@ -45,5 +45,5 @@
 
 #include "util/Sleep.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 
 namespace network
@@ -91,5 +91,5 @@
     return getPacket(address);
   }*/
-  
+
   ENetEvent *ClientConnection::getEvent(){
     if(!buffer.isEmpty())
Index: code/branches/core3/src/network/PacketDecoder.cc
===================================================================
--- code/branches/core3/src/network/PacketDecoder.cc	(revision 1585)
+++ code/branches/core3/src/network/PacketDecoder.cc	(revision 1586)
@@ -40,5 +40,5 @@
 #include <iostream>
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 
 namespace network
Index: code/branches/core3/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/core3/src/orxonox/GraphicsEngine.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/GraphicsEngine.cc	(revision 1586)
@@ -47,8 +47,8 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Debug.h"
 #include "core/CommandExecutor.h"
 #include "core/ConsoleCommand.h"
 #include "core/input/InputManager.h"
+#include "util/Debug.h"
 
 #include "console/InGameConsole.h"
Index: code/branches/core3/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/core3/src/orxonox/Orxonox.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/Orxonox.cc	(revision 1586)
@@ -55,9 +55,9 @@
 #include "core/ConfigFileManager.h"
 #include "core/ConsoleCommand.h"
-#include "core/Debug.h"
 #include "core/Loader.h"
 #include "core/input/InputManager.h"
 #include "core/TclBind.h"
 #include "core/Core.h"
+#include "util/Debug.h"
 
 // audio
Index: code/branches/core3/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- code/branches/core3/src/orxonox/OrxonoxStableHeaders.h	(revision 1585)
+++ code/branches/core3/src/orxonox/OrxonoxStableHeaders.h	(revision 1586)
@@ -92,7 +92,10 @@
 
 #include "util/Convert.h"
+#include "util/Debug.h"
 #include "util/Math.h"
 #include "util/Multitype.h"
 #include "util/MultiTypeMath.h"
+#include "util/OutputBuffer.h"
+#include "util/OutputHandler.h"
 #include "util/Sleep.h"
 #include "util/String.h"
@@ -104,7 +107,4 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Debug.h"
-#include "core/OutputBuffer.h"
-#include "core/OutputHandler.h"
 #include "core/Executor.h"
 #include "core/XMLPort.h"
Index: code/branches/core3/src/orxonox/console/InGameConsole.cc
===================================================================
--- code/branches/core3/src/orxonox/console/InGameConsole.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/console/InGameConsole.cc	(revision 1586)
@@ -38,9 +38,9 @@
 #include <OgreStringConverter.h>
 
-#include "core/Debug.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/ConsoleCommand.h"
 #include "core/input/InputManager.h"
+#include "util/Debug.h"
 #include "util/Math.h"
 #include "GraphicsEngine.h"
@@ -457,4 +457,9 @@
             this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
             this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+        }
+        else if (colourcode == 6)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.30, 0.20, 0.30, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.50, 0.40, 0.50, 1.00));
         }
         else
Index: code/branches/core3/src/orxonox/hud/HUD.cc
===================================================================
--- code/branches/core3/src/orxonox/hud/HUD.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/hud/HUD.cc	(revision 1586)
@@ -37,5 +37,5 @@
 #include <OgreStringConverter.h>
 
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/ConsoleCommand.h"
 #include "objects/SpaceShip.h"
Index: code/branches/core3/src/orxonox/hud/Navigation.cc
===================================================================
--- code/branches/core3/src/orxonox/hud/Navigation.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/hud/Navigation.cc	(revision 1586)
@@ -41,5 +41,5 @@
 #include "RadarOverlayElement.h"
 #include "HUD.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "util/Math.h"
 
Index: code/branches/core3/src/orxonox/objects/Ambient.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Ambient.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/objects/Ambient.cc	(revision 1586)
@@ -39,9 +39,9 @@
 #include "util/Convert.h"
 #include "util/Math.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
 #include "core/XMLPort.h"
 #include "core/ConsoleCommand.h"
+#include "GraphicsEngine.h"
 
 namespace orxonox
@@ -68,10 +68,10 @@
       return Synchronisable::create();
     }
-    
+
     void Ambient::registerAllVariables(){
       registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
-      
+
     }
-    
+
     void Ambient::loadParams(TiXmlElement* xmlElem)
     {
@@ -94,5 +94,5 @@
    {
     	GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
-      ambientLight_=colour;	
+      ambientLight_=colour;
    }
 
Index: code/branches/core3/src/orxonox/objects/Camera.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Camera.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/objects/Camera.cc	(revision 1586)
@@ -42,5 +42,5 @@
 #include "util/Convert.h"
 #include "util/Math.h"
-#include "core/Debug.h"
+#include "util/Debug.h"
 #include "core/CoreIncludes.h"
 #include "GraphicsEngine.h"
Index: code/branches/core3/src/orxonox/objects/Skybox.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Skybox.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/objects/Skybox.cc	(revision 1586)
@@ -37,6 +37,6 @@
 #include "GraphicsEngine.h"
 #include "core/CoreIncludes.h"
-#include "core/Debug.h"
 #include "core/XMLPort.h"
+#include "util/Debug.h"
 
 namespace orxonox
Index: code/branches/core3/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/SpaceShip.cc	(revision 1585)
+++ code/branches/core3/src/orxonox/objects/SpaceShip.cc	(revision 1586)
@@ -38,16 +38,16 @@
 #include "util/Convert.h"
 #include "util/Math.h"
+#include "util/Debug.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Debug.h"
-#include "GraphicsEngine.h"
 #include "core/input/InputManager.h"
+#include "core/XMLPort.h"
+#include "core/ConsoleCommand.h"
 #include "tools/ParticleInterface.h"
+#include "network/Client.h"
+#include "hud/HUD.h"
 #include "RotatingProjectile.h"
 #include "ParticleProjectile.h"
-#include "core/XMLPort.h"
-#include "core/ConsoleCommand.h"
-#include "network/Client.h"
-#include "hud/HUD.h"
+#include "GraphicsEngine.h"
 
 namespace orxonox
Index: code/branches/core3/src/util/CMakeLists.txt
===================================================================
--- code/branches/core3/src/util/CMakeLists.txt	(revision 1585)
+++ code/branches/core3/src/util/CMakeLists.txt	(revision 1586)
@@ -7,4 +7,6 @@
   MultiTypeString.cc
   MultiTypeMath.cc
+  OutputBuffer.cc
+  OutputHandler.cc
   String.cc
   SubString.cc
Index: code/branches/core3/src/util/Convert.h
===================================================================
--- code/branches/core3/src/util/Convert.h	(revision 1585)
+++ code/branches/core3/src/util/Convert.h	(revision 1586)
@@ -41,4 +41,5 @@
 
 #include "Math.h"
+#include "Debug.h"
 #include "SubString.h"
 #include "MultiTypeMath.h"
@@ -74,5 +75,8 @@
     enum { specialized = false };
     static bool convert(ToType* output, const FromType& input)
-    { return false; }
+    {
+        COUT(2) << "Warning: Couldn't convert a value." << std::endl;
+        return false;
+    }
 };
 
@@ -139,4 +143,5 @@
     static bool convert(ToType* output, const FromType& input)
     {
+        COUT(2) << "Warning: Couldn't convert a value." << std::endl;
         return false;
     }
Index: code/branches/core3/src/util/Debug.h
===================================================================
--- code/branches/core3/src/util/Debug.h	(revision 1586)
+++ code/branches/core3/src/util/Debug.h	(revision 1586)
@@ -0,0 +1,248 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Grauer
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+/**
+ * @file Debug.h
+ * @brief Handles the output for different verbose-modes.
+ *
+ * There are two modes: HARD and SOFT. HARD is precessed during compiletime, while SOFT is for runtime.
+ */
+
+#ifndef _Debug_H__
+#define _Debug_H__
+
+#include "UtilPrereqs.h"
+
+#include <stdio.h>
+
+#include "OutputHandler.h"
+
+
+/**
+    @brief Returns the soft debug level, stored in the only existing instance of the OutputHandler class, configured in the config-file.
+    @return The soft debug level
+*/
+static inline int getSoftDebugLevel()
+{
+    return orxonox::OutputHandler::getSoftDebugLevel();
+}
+
+
+// DEFINE ERROR MODES
+#define ORX_NONE            0
+#define ORX_ERROR           1
+#define ORX_WARNING         2
+#define ORX_INFO            3
+#define ORX_DEBUG           4
+#define ORX_VERBOSE         5
+#define ORX_ULTRA           6
+
+//definitions
+#define ORX_PRINT_DEBUG_OUTPUT 1
+#define ORX_HARD_DEBUG_LEVEL ORX_VERBOSE
+
+#define COUT_EXEC(x) orxonox::OutputHandler::getOutStream().setOutputLevel(x)
+
+////////////////////////////////////////////////////////
+///  COUT: just prints output as is with std::cout   ///
+////////////////////////////////////////////////////////
+#define COUTORX_NONE    COUT0
+#define COUTORX_ERROR   COUT1
+#define COUTORX_WARNING COUT2
+#define COUTORX_INFO    COUT3
+#define COUTORX_DEBUG   COUT4
+#define COUTORX_VERBOSE COUT5
+#define COUTORX_ULTRA   COUT6
+
+#ifndef COUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define COUT(x) \
+   COUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define COUT0  \
+    if (getSoftDebugLevel() >= ORX_NONE)  \
+     COUT_EXEC(0)
+  #else
+   #define COUT0 \
+    false ? COUT_EXEC(0) : COUT_EXEC(0)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define COUT1  \
+    if (getSoftDebugLevel() >= ORX_ERROR)  \
+     COUT_EXEC(1)
+  #else
+   #define COUT1 \
+    false ? COUT_EXEC(1) : COUT_EXEC(1)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define COUT2 \
+    if (getSoftDebugLevel() >= ORX_WARNING) \
+     COUT_EXEC(2)
+  #else
+   #define COUT2 \
+    false ? COUT_EXEC(2) : COUT_EXEC(2)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define COUT3 \
+    if (getSoftDebugLevel() >= ORX_INFO) \
+     COUT_EXEC(3)
+  #else
+   #define COUT3 \
+    false ? COUT_EXEC(3) : COUT_EXEC(3)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define COUT4 \
+    if (getSoftDebugLevel() >= ORX_DEBUG) \
+     COUT_EXEC(4)
+  #else
+   #define COUT4 \
+    false ? COUT_EXEC(4) : COUT_EXEC(4)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
+   #define COUT5 \
+    if (getSoftDebugLevel() >= ORX_VERBOSE) \
+     COUT_EXEC(5)
+  #else
+   #define COUT5 \
+    false ? COUT_EXEC(5) : COUT_EXEC(5)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
+   #define COUT6 \
+    if (getSoftDebugLevel() >= ORX_ULTRA) \
+     COUT_EXEC(6)
+  #else
+   #define COUT6 \
+    false ? COUT_EXEC(6) : COUT_EXEC(6)
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define COUT(x) \
+    false ? COUT_EXEC(6) : COUT_EXEC(6)
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+#endif /* ifndef COUT */
+
+
+/////////////////////////////////////////////////////////////////////
+///  CCOUT: Prints output with std::cout and adds the classname   ///
+/////////////////////////////////////////////////////////////////////
+#define CCOUTORX_NONE    CCOUT0
+#define CCOUTORX_ERROR   CCOUT1
+#define CCOUTORX_WARNING CCOUT2
+#define CCOUTORX_INFO    CCOUT3
+#define CCOUTORX_DEBUG   CCOUT4
+#define CCOUTORX_VERBOSE CCOUT5
+#define CCOUTORX_ULTRA   CCOUT6
+
+#define CCOUT_EXEC(x) \
+  orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
+  << this->getIdentifier()->getName() << ": "
+
+#ifndef CCOUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define CCOUT(x) \
+   CCOUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define CCOUT0  \
+    if (getSoftDebugLevel() >= ORX_NONE)  \
+     CCOUT_EXEC(0)
+  #else
+   #define CCOUT0 \
+    false ? CCOUT_EXEC(0) : CCOUT_EXEC(0)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define CCOUT1  \
+    if (getSoftDebugLevel() >= ORX_ERROR)  \
+     CCOUT_EXEC(1)
+  #else
+   #define CCOUT1 \
+    false ? CCOUT_EXEC(1) : CCOUT_EXEC(1)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define CCOUT2 \
+    if (getSoftDebugLevel() >= ORX_WARNING) \
+     CCOUT_EXEC(2)
+  #else
+   #define CCOUT2 \
+    false ? CCOUT_EXEC(2) : CCOUT_EXEC(2)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define CCOUT3 \
+    if (getSoftDebugLevel() >= ORX_INFO) \
+     CCOUT_EXEC(3)
+  #else
+   #define CCOUT3 \
+    false ? CCOUT_EXEC(3) : CCOUT_EXEC(3)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define CCOUT4 \
+    if (getSoftDebugLevel() >= ORX_DEBUG) \
+     CCOUT_EXEC(4)
+  #else
+   #define CCOUT4 \
+    false ? CCOUT_EXEC(4) : CCOUT_EXEC(4)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
+   #define CCOUT5 \
+    if (getSoftDebugLevel() >= ORX_VERBOSE) \
+     CCOUT_EXEC(5)
+  #else
+   #define CCOUT5 \
+    false ? CCOUT_EXEC(5) : CCOUT_EXEC(5)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
+   #define CCOUT6 \
+    if (getSoftDebugLevel() >= ORX_ULTRA) \
+     CCOUT_EXEC(6)
+  #else
+   #define CCOUT6 \
+    false ? CCOUT_EXEC(6) : CCOUT_EXEC(6)
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define CCOUT(x) \
+   false ? CCOUT_EXEC(6) : CCOUT_EXEC(6)
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+#endif /* ifndef CCOUT */
+
+#endif /* _Debug_H__ */
Index: code/branches/core3/src/util/OutputBuffer.cc
===================================================================
--- code/branches/core3/src/util/OutputBuffer.cc	(revision 1586)
+++ code/branches/core3/src/util/OutputBuffer.cc	(revision 1586)
@@ -0,0 +1,96 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OutputBuffer.h"
+
+#define OUTPUTBUFFER_MAX_LINE_LENGTH 16384
+
+namespace orxonox
+{
+    void OutputBuffer::registerListener(OutputBufferListener* listener)
+    {
+        this->listeners_.insert(this->listeners_.end(), listener);
+    }
+
+    void OutputBuffer::unregisterListener(OutputBufferListener* listener)
+    {
+        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
+        {
+            if ((*it) == listener)
+                this->listeners_.erase(it++);
+            else
+                ++it;
+        }
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ostream& (*manipulator)(std::ostream&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ios& (*manipulator)(std::ios&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    bool OutputBuffer::getLine(std::string* output)
+    {
+        char line[OUTPUTBUFFER_MAX_LINE_LENGTH];
+
+        this->stream_.getline(line, OUTPUTBUFFER_MAX_LINE_LENGTH);
+        (*output) = std::string(line);
+
+        bool eof = this->stream_.eof();
+        bool fail = this->stream_.fail();
+
+        if (eof)
+            this->stream_.flush();
+
+        if (eof || fail)
+            this->stream_.clear();
+
+        return (!eof && !fail);
+    }
+
+    void OutputBuffer::callListeners()
+    {
+        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+            (*it)->outputChanged();
+    }
+}
Index: code/branches/core3/src/util/OutputBuffer.h
===================================================================
--- code/branches/core3/src/util/OutputBuffer.h	(revision 1586)
+++ code/branches/core3/src/util/OutputBuffer.h	(revision 1586)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _OutputBuffer_H__
+#define _OutputBuffer_H__
+
+#include <list>
+#include <sstream>
+#include <iostream>
+
+#include "UtilPrereqs.h"
+
+namespace orxonox
+{
+    class _UtilExport OutputBufferListener
+    {
+        friend class OutputBuffer;
+
+        public:
+            virtual ~OutputBufferListener() {}
+
+        private:
+            virtual void outputChanged() = 0;
+    };
+
+    class _UtilExport OutputBuffer
+    {
+        public:
+            OutputBuffer() {}
+            ~OutputBuffer() {}
+
+            template <class T>
+            inline OutputBuffer& operator<<(T object)
+            {
+                this->stream_ << object;
+                this->callListeners();
+                return *this;
+            }
+
+            template <const OutputBuffer&>
+            inline OutputBuffer& operator<<(const OutputBuffer& object)
+            {
+                this->stream_ << object.stream_;
+                this->callListeners();
+                return *this;
+            }
+
+            OutputBuffer& operator<<(std::ostream& (*manipulator)(std::ostream&));
+            OutputBuffer& operator<<(std::ios& (*manipulator)(std::ios&));
+            OutputBuffer& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
+
+            template <class T>
+            inline void add(T object)
+            {
+                this->stream_ << object;
+                this->callListeners();
+            }
+
+            template <class T>
+            inline void addLine(T object)
+            {
+                this->stream_ << object << std::endl;
+                this->callListeners();
+            }
+
+            inline void newline()
+            {
+                this->stream_ << std::endl;
+                this->callListeners();
+            }
+
+            inline void flush()
+            {
+                this->stream_.flush();
+            }
+
+            bool getLine(std::string* output);
+
+            void registerListener(OutputBufferListener* listener);
+            void unregisterListener(OutputBufferListener* listener);
+
+            inline std::stringstream& getStream()
+                { return this->stream_; }
+
+        private:
+            void callListeners();
+
+            std::stringstream stream_;
+            std::list<OutputBufferListener*> listeners_;
+    };
+}
+
+#endif /* _OutputBuffer_H__ */
Index: code/branches/core3/src/util/OutputHandler.cc
===================================================================
--- code/branches/core3/src/util/OutputHandler.cc	(revision 1586)
+++ code/branches/core3/src/util/OutputHandler.cc	(revision 1586)
@@ -0,0 +1,188 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file OutputHandler.cc
+    @brief Implementation of the OutputHandler class.
+*/
+
+#include "OutputHandler.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Opens the logfile and writes the first line.
+        @param logfilename The name of the logfile
+    */
+    OutputHandler::OutputHandler(const std::string& logfilename)
+    {
+        this->outputBuffer_ = &this->fallbackBuffer_;
+        this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2;
+        this->logfilename_ = logfilename;
+        this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
+        this->logfile_ << "Started log at yyyy/mm/dd hh:mm:ss" << std::endl;
+        this->logfile_.flush();
+    }
+
+    /**
+        @brief Destructor: Writes the last line to the logfile and closes it.
+    */
+    OutputHandler::~OutputHandler()
+    {
+        this->logfile_ << "Closed log" << std::endl;
+        this->logfile_.close();
+    }
+
+    /**
+        @brief Returns a reference to the only existing instance of the OutputHandler class.
+        @return The instance
+    */
+    OutputHandler& OutputHandler::getOutStream()
+    {
+        static OutputHandler orxout("orxonox.log");
+        return orxout;
+    }
+
+    /**
+        @brief Sets the soft debug level for a given output device.
+        @param device The output device
+        @param level The debug level
+    */
+    void OutputHandler::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
+    {
+        OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device] = level;
+    }
+
+    /**
+        @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 OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device];
+    }
+
+    /**
+        @brief Sets the OutputBuffer, representing the third output stream.
+        @param buffer The OutputBuffer
+    */
+    void OutputHandler::setOutputBuffer(OutputBuffer& buffer)
+    {
+        buffer.getStream() >> this->outputBuffer_->getStream().rdbuf();
+        this->outputBuffer_ = &buffer;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param sb The streambuffer that should be shown in the console
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::streambuf* sb)
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            std::cout << sb;
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            this->logfile_ << sb;
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << sb;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ostream& (*manipulator)(std::ostream&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ios& (*manipulator)(std::ios&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+}
Index: code/branches/core3/src/util/OutputHandler.h
===================================================================
--- code/branches/core3/src/util/OutputHandler.h	(revision 1586)
+++ code/branches/core3/src/util/OutputHandler.h	(revision 1586)
@@ -0,0 +1,200 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file OutputHandler.h
+    @brief Definition of the OutputHandler class.
+
+    The OutputHandler acts like std::cout, but output isn't only shown in the console,
+    but also written to the logfile.
+*/
+
+#ifndef _OutputHandler_H__
+#define _OutputHandler_H__
+
+#include "UtilPrereqs.h"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include "OutputBuffer.h"
+
+namespace orxonox
+{
+    //! The OutputHandler acts like std::cout, but redirects output to the console AND the logfile.
+    class _UtilExport OutputHandler
+    {
+        public:
+            enum OutputDevice
+            {
+                LD_All = 0,
+                LD_Console = 1,
+                LD_Logfile = 2,
+                LD_Shell = 3
+            };
+
+            static OutputHandler& getOutStream();
+
+            /** @brief Puts some text on the outstream. @param text The text */
+            static inline std::string log(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts an error on the outstream. @param text The text */
+            static inline std::string error(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts a warning on the outstream. @param text The text */
+            static inline std::string warning(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts an info on the outstream. @param text The text */
+            static inline std::string info(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts some debug output on the outstream. @param text The text */
+            static inline std::string debug(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Returns a reference to the logfile. @return The logfile */
+            inline std::ofstream& getLogfile()
+                { return this->logfile_; }
+
+            /** @brief Returns a pointer to the OutputBuffer. @return The OutputBuffer */
+            inline OutputBuffer* getOutputBuffer()
+                { return this->outputBuffer_; }
+
+            /** @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; }
+
+            /** @brief Returns the level of the incoming output. @return The level */
+            inline int getOutputLevel() const
+                { return this->outputLevel_; }
+
+            static void setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
+
+            void setOutputBuffer(OutputBuffer& buffer);
+
+            template <class T>
+            OutputHandler& output(const T& output);
+
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned char val)   { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(short val)           { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned short val)  { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(int val)             { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned int val)    { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(long val)            { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned long val)   { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(float val)           { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(double val)          { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(long double val)     { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(const void* val)     { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(bool val)            { return this->output(val); }
+
+            OutputHandler& operator<<(std::streambuf* sb);
+
+            OutputHandler& operator<<(std::ostream& (*manipulator)(std::ostream&));
+            OutputHandler& operator<<(std::ios& (*manipulator)(std::ios&));
+            OutputHandler& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
+
+        private:
+            explicit OutputHandler(const std::string& logfilename);
+            OutputHandler(const OutputHandler& oh);  // don't copy
+            virtual ~OutputHandler();
+
+            std::ofstream logfile_;              //!< The logfile where the output is logged
+            std::string logfilename_;            //!< The name of the logfile
+            OutputBuffer fallbackBuffer_;        //!< The OutputBuffer that gets used if there is no other OutputBuffer
+            OutputBuffer* outputBuffer_;         //!< The OutputBuffer to put output in (usually used by the Shell)
+            int outputLevel_;                    //!< The level of the incoming output
+            int softDebugLevel_[4];              //!< The soft debug level for each OutputDevice - the configurable maximal output level
+    };
+
+    /**
+        @brief 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
+    */
+    template<class T>
+    OutputHandler& OutputHandler::output(const T& output)
+    {
+        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();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << output;
+
+        return *this;
+    }
+
+    /**
+        @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.
+        @param out The OutputHandler itself
+        @param output The class that should be shown in the console
+        @return The OutputHandler itself
+    */
+    template<class T>
+    OutputHandler& operator<<(OutputHandler& out, const T& output)
+    {
+        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();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= out.getOutputLevel())
+            (*out.getOutputBuffer()) << output;
+
+        return out;
+    }
+}
+
+#endif /* _OutputHandler_H__ */
Index: code/branches/core3/src/util/String.h
===================================================================
--- code/branches/core3/src/util/String.h	(revision 1585)
+++ code/branches/core3/src/util/String.h	(revision 1586)
@@ -129,5 +129,5 @@
             std::string input = "3.14";
             float f;
-            bool success = string2Number(&f, input);
+            bool success = FromString(&f, input);
         */
         template <typename T>
@@ -151,5 +151,5 @@
             std::string input = "3.14";
             float f;
-            bool success = string2Number(&f, input, 0.000000);
+            bool success = FromString(&f, input, 0.000000);
         */
         template <typename T>
Index: code/branches/core3/src/util/UtilPrereqs.h
===================================================================
--- code/branches/core3/src/util/UtilPrereqs.h	(revision 1585)
+++ code/branches/core3/src/util/UtilPrereqs.h	(revision 1586)
@@ -65,7 +65,12 @@
 class MultiTypeString;
 class MultiTypeMath;
-template <class T>
-class String2Number;
+class OutputHandler;
 class SubString;
 
+namespace orxonox
+{
+    class OutputBuffer;
+    class OutputBufferListener;
+}
+
 #endif /* _UtilPrereqs_H__ */
