Index: code/trunk/src/libraries/core/BaseObject.cc
===================================================================
--- code/trunk/src/libraries/core/BaseObject.cc	(revision 8729)
+++ code/trunk/src/libraries/core/BaseObject.cc	(revision 8858)
@@ -109,5 +109,5 @@
     void BaseObject::registerEventListener(BaseObject* object)
     {
-        COUT(4) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << std::endl;
+        orxout(verbose, context::events) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << endl;
         this->eventListeners_.insert(object);
     }
@@ -186,5 +186,5 @@
             this->addTemplate(temp);
         else
-            COUT(1) << "Error: \"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << std::endl;
+            orxout(internal_error) << "\"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << endl;
     }
 
@@ -312,5 +312,5 @@
         if (it != this->eventStates_.end())
         {
-            COUT(2) << "Warning: Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << std::endl;
+            orxout(internal_warning, context::events) << "Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << endl;
             delete (it->second);
         }
@@ -379,5 +379,5 @@
         this->registerEventStates();
 
-        COUT(4) << this->getIdentifier()->getName() << " (&" << this << ") processing event. originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << "), activate: " << event.activate_ << ", name: " << event.name_ << ", statename: " << event.statename_ << "." << std::endl;
+        orxout(verbose, context::events) << this->getIdentifier()->getName() << " (&" << this << ") processing event. originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << "), activate: " << event.activate_ << ", name: " << event.name_ << ", statename: " << event.statename_ << "." << endl;
 
         std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(event.statename_);
@@ -385,7 +385,7 @@
             it->second->process(event, this);
         else if (!event.statename_.empty())
-            COUT(2) << "Warning: \"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
-        else
-            COUT(2) << "Warning: Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
+            orxout(internal_warning, context::events) << "\"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
+        else
+            orxout(internal_warning, context::events) << "Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
     }
 
@@ -412,5 +412,5 @@
         }
         else
-            COUT(2) << "Warning: No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << std::endl;
+            orxout(internal_warning, context::events) << "No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << endl;
     }
 
@@ -432,8 +432,8 @@
                     this->mainStateFunctor_ = it->second->getFunctor();
                 else
-                    COUT(2) << "Warning: Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << std::endl;
+                    orxout(internal_warning, context::events) << "Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << endl;
             }
             else
-                COUT(2) << "Warning: \"" << this->mainStateName_ << "\" is not a valid MainState." << std::endl;
+                orxout(internal_warning, context::events) << "\"" << this->mainStateName_ << "\" is not a valid MainState." << endl;
         }
     }
Index: code/trunk/src/libraries/core/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/CMakeLists.txt	(revision 8729)
+++ code/trunk/src/libraries/core/CMakeLists.txt	(revision 8858)
@@ -86,4 +86,5 @@
     input/KeyBinder.h
     input/KeyBinderManager.h
+    ../util/output/OutputDefinitions.h
   PCH_FILE
     CorePrecompiledHeaders.h
Index: code/trunk/src/libraries/core/ClassFactory.h
===================================================================
--- code/trunk/src/libraries/core/ClassFactory.h	(revision 8729)
+++ code/trunk/src/libraries/core/ClassFactory.h	(revision 8858)
@@ -42,5 +42,5 @@
 #include <string>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "Identifier.h"
 
@@ -73,5 +73,5 @@
             ClassFactory(const std::string& name, bool bLoadable = true)
             {
-                COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
+                orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
                 ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
                 ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);
Index: code/trunk/src/libraries/core/CommandLineParser.cc
===================================================================
--- code/trunk/src/libraries/core/CommandLineParser.cc	(revision 8729)
+++ code/trunk/src/libraries/core/CommandLineParser.cc	(revision 8858)
@@ -33,5 +33,5 @@
 
 #include "util/Convert.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/StringUtils.h"
@@ -229,6 +229,6 @@
         catch (const ArgumentException& ex)
         {
-            COUT(0) << "Could not parse command line: " << ex.what() << std::endl;
-            COUT(0) << CommandLineParser::getUsageInformation() << std::endl;
+            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
+            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
             throw GeneralException("");
         }
@@ -286,7 +286,7 @@
         }
 
-        infoStr << std::endl;
-        infoStr << "Usage: orxonox [options]" << std::endl;
-        infoStr << "Available options:" << std::endl;
+        infoStr << endl;
+        infoStr << "Usage: orxonox [options]" << endl;
+        infoStr << "Available options:" << endl;
 
         for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
@@ -305,5 +305,5 @@
             infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
             infoStr << ": " << it->second->getInformation();
-            infoStr << std::endl;
+            infoStr << endl;
         }
         return infoStr.str();
Index: code/trunk/src/libraries/core/CommandLineParser.h
===================================================================
--- code/trunk/src/libraries/core/CommandLineParser.h	(revision 8729)
+++ code/trunk/src/libraries/core/CommandLineParser.h	(revision 8858)
@@ -218,5 +218,5 @@
             "Cannot add a command line argument with name '" + name + "' twice.");
         OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
-               "Boolean command line arguments with positive default values are not supported." << std::endl
+               "Boolean command line arguments with positive default values are not supported." << endl
             << "Please use SetCommandLineSwitch and adjust your argument: " << name);
 
Index: code/trunk/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/trunk/src/libraries/core/ConfigFileManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/ConfigFileManager.cc	(revision 8858)
@@ -123,10 +123,7 @@
         for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
             if ((*it)->getName() == name)
-                if ((*it)->getIndex() > size)
-                    size = (*it)->getIndex();
-        if (size == 0)
-            return 0;
-        else
-            return (size + 1);
+                if ((*it)->getIndex() >= size)
+                    size = (*it)->getIndex() + 1;
+        return size;
     }
 
@@ -274,8 +271,8 @@
                         {
                             boost::filesystem::copy_file(defaultFilepath, filepath);
-                            COUT(3) << "Copied " << this->filename_ << " from the default config folder." << std::endl;
+                            orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl;
                         }
                         catch (const boost::filesystem::filesystem_error& ex)
-                        { COUT(1) << "Error in ConfigFile: " << ex.what() << std::endl; }
+                        { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; }
                     }
                 }
@@ -375,5 +372,5 @@
             file.close();
 
-            COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
+            orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl;
 
             // DO NOT save the file --> we can open supposedly read only config files
@@ -404,5 +401,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "Error: Couldn't open config-file \"" << filename << "\"." << std::endl;
+            orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl;
             return;
         }
@@ -410,15 +407,15 @@
         for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
         {
-            file << (*it)->getFileEntry() << std::endl;
+            file << (*it)->getFileEntry() << endl;
 
             for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
-                file << (*it_entries)->getFileEntry() << std::endl;
-
-            file << std::endl;
+                file << (*it_entries)->getFileEntry() << endl;
+
+            file << endl;
         }
 
         file.close();
 
-        COUT(4) << "Saved config file \"" << filename << "\"." << std::endl;
+        orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl;
     }
 
@@ -669,5 +666,5 @@
     {
         if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
-            COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
+            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
     }
 
@@ -682,5 +679,5 @@
     {
         if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
-            COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
+            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
     }
 
Index: code/trunk/src/libraries/core/ConfigValueContainer.cc
===================================================================
--- code/trunk/src/libraries/core/ConfigValueContainer.cc	(revision 8729)
+++ code/trunk/src/libraries/core/ConfigValueContainer.cc	(revision 8858)
@@ -143,5 +143,5 @@
         else
         {
-            COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
         }
         return false;
@@ -182,5 +182,5 @@
             if (index > MAX_VECTOR_INDEX)
             {
-                COUT(1) << "Error: Index " << index << " is too large." << std::endl;
+                orxout(user_error, context::config) << "Index " << index << " is too large." << endl;
                 return false;
             }
@@ -203,5 +203,5 @@
         else
         {
-            COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
             return false;
         }
@@ -218,5 +218,5 @@
             return this->set(this->valueVector_.size(), input);
 
-        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
         return false;
     }
@@ -241,8 +241,8 @@
                 return true;
             }
-            COUT(1) << "Error: Invalid vector-index." << std::endl;
-        }
-
-        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+            orxout(user_error, context::config) << "Invalid vector-index." << endl;
+        }
+
+        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
         return false;
     }
@@ -312,9 +312,9 @@
             if (!success)
             {
-                COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << std::endl;
+                orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << endl;
             }
             else
             {
-                COUT(1) << "Error: Invalid vector-index." << std::endl;
+                orxout(user_error, context::config) << "Invalid vector-index." << endl;
             }
             return false;
Index: code/trunk/src/libraries/core/ConfigValueIncludes.h
===================================================================
--- code/trunk/src/libraries/core/ConfigValueIncludes.h	(revision 8729)
+++ code/trunk/src/libraries/core/ConfigValueIncludes.h	(revision 8858)
@@ -87,6 +87,6 @@
     @code
     MyObject orxonoxobject;
-    std::cout << "Name:    " << orxonoxobject.getName() << std::endl;
-    std::cout << "Version: " << orxonoxobject.getVersion() << std::endl;
+    orxout() << "Name:    " << orxonoxobject.getName() << endl;
+    orxout() << "Version: " << orxonoxobject.getVersion() << endl;
     @endcode
 
@@ -200,6 +200,6 @@
         else
         {
-            COUT(2) << "Warning: Couldn't reset config-value '" << entryName << "' in class '"
-                    << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << std::endl;
+            orxout(user_warning, context::config) << "Couldn't reset config-value '" << entryName << "' in class '"
+                                                  << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << endl;
         }
     }
@@ -238,6 +238,6 @@
     else \
     { \
-        COUT(2) << "Warning: Couln't modify config-value '" << entryName << "' in class '" \
-                << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << std::endl; \
+        orxout(user_warning, context::config) << "Couldn't modify config-value '" << entryName << "' in class '" \
+                                              << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << endl; \
     }
 
Index: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Core.cc	(revision 8858)
@@ -52,6 +52,7 @@
 
 #include "util/Clock.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
+#include "util/output/LogWriter.h"
 #include "util/Scope.h"
 #include "util/ScopedSingletonManager.h"
@@ -111,4 +112,6 @@
         , destructionHelper_(this)
     {
+        orxout(internal_status) << "initializing Core object..." << endl;
+
         // Set the hard coded fixed paths
         this->pathConfig_ = new PathConfig();
@@ -118,4 +121,5 @@
 
         // Load modules
+        orxout(internal_info) << "Loading modules:" << endl;
         const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();
         for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)
@@ -127,5 +131,5 @@
             catch (...)
             {
-                COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;
+                orxout(user_error) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << endl;
             }
         }
@@ -136,4 +140,12 @@
         // Set configurable paths like log, config and media
         this->pathConfig_->setConfigurablePaths();
+
+        orxout(internal_info) << "Root path:       " << PathConfig::getRootPathString() << endl;
+        orxout(internal_info) << "Executable path: " << PathConfig::getExecutablePathString() << endl;
+        orxout(internal_info) << "Data path:       " << PathConfig::getDataPathString() << endl;
+        orxout(internal_info) << "Ext. data path:  " << PathConfig::getExternalDataPathString() << endl;
+        orxout(internal_info) << "Config path:     " << PathConfig::getConfigPathString() << endl;
+        orxout(internal_info) << "Log path:        " << PathConfig::getLogPathString() << endl;
+        orxout(internal_info) << "Modules path:    " << PathConfig::getModulePathString() << endl;
 
         // create a signal handler (only active for Linux)
@@ -141,7 +153,4 @@
         this->signalHandler_ = new SignalHandler();
         this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log");
-
-        // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% (Windows) was used
-        OutputHandler::getInstance().setLogPath(PathConfig::getLogPathString());
 
 #ifdef ORXONOX_PLATFORM_WINDOWS
@@ -155,4 +164,5 @@
 
         // Manage ini files and set the default settings file (usually orxonox.ini)
+        orxout(internal_info) << "Loading config:" << endl;
         this->configFileManager_ = new ConfigFileManager();
         this->configFileManager_->setFilename(ConfigFileType::Settings,
@@ -160,4 +170,5 @@
 
         // Required as well for the config values
+        orxout(internal_info) << "Loading language:" << endl;
         this->languageInstance_ = new Language();
 
@@ -165,7 +176,9 @@
         // possibility to configure everything below here
         RegisterRootObject(Core);
+        orxout(internal_info) << "configuring Core" << endl;
         this->setConfigValues();
-        // Rewrite the log file with the correct log levels
-        OutputHandler::getInstance().rewriteLogFile();
+
+        // Set the correct log path and rewrite the log file with the correct log levels
+        LogWriter::getInstance().setLogPath(PathConfig::getLogPathString());
 
 #if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
@@ -176,11 +189,16 @@
         }
         if (this->bStartIOConsole_)
+        {
+            orxout(internal_info) << "creating IO console" << endl;
             this->ioConsole_ = new IOConsole();
+        }
 #endif
 
         // creates the class hierarchy for all classes with factories
+        orxout(internal_info) << "creating class hierarchy" << endl;
         Identifier::createClassHierarchy();
 
         // Load OGRE excluding the renderer and the render window
+        orxout(internal_info) << "creating GraphicsManager:" << endl;
         this->graphicsManager_ = new GraphicsManager(false);
 
@@ -190,4 +208,5 @@
 
         // Create singletons that always exist (in other libraries)
+        orxout(internal_info) << "creating root scope:" << endl;
         this->rootScope_ = new Scope<ScopeID::Root>();
 
@@ -204,10 +223,14 @@
             }
             else
-                COUT(0) << "Error: Could not open file for documentation writing" << endl;
-        }
+                orxout(internal_error) << "Could not open file for documentation writing" << endl;
+        }
+
+        orxout(internal_status) << "finished initializing Core object" << endl;
     }
 
     void Core::destroy()
     {
+        orxout(internal_status) << "destroying Core object..." << endl;
+
         // Remove us from the object lists again to avoid problems when destroying them
         this->unregisterObject();
@@ -228,10 +251,6 @@
         safeObjectDelete(&dynLibManager_);
         safeObjectDelete(&pathConfig_);
-    }
-
-    namespace DefaultLevelLogFile
-    {
-        const OutputLevel::Value Dev  = OutputLevel::Debug;
-        const OutputLevel::Value User = OutputLevel::Info;
+
+        orxout(internal_status) << "finished destroying Core object" << endl;
     }
 
@@ -239,10 +258,22 @@
     void Core::setConfigValues()
     {
-        // Choose the default level according to the path Orxonox was started (build directory or not)
-        OutputLevel::Value defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
-
-        SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile", defaultLogLevel)
-            .description("The maximum level of debug output written to the log file");
-        OutputHandler::getInstance().setSoftDebugLevel("LogFile", debugLevelLogFile_);
+        SetConfigValueExternal(LogWriter::getInstance().configurableMaxLevel_,
+                               LogWriter::getInstance().getConfigurableSectionName(),
+                               LogWriter::getInstance().getConfigurableMaxLevelName(),
+                               LogWriter::getInstance().configurableMaxLevel_)
+            .description("The maximum level of output shown in the log file")
+            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevel);
+        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContextsMaxLevel_,
+                               LogWriter::getInstance().getConfigurableSectionName(),
+                               LogWriter::getInstance().getConfigurableAdditionalContextsMaxLevelName(),
+                               LogWriter::getInstance().configurableAdditionalContextsMaxLevel_)
+            .description("The maximum level of output shown in the log file for additional contexts")
+            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
+        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContexts_,
+                               LogWriter::getInstance().getConfigurableSectionName(),
+                               LogWriter::getInstance().getConfigurableAdditionalContextsName(),
+                               LogWriter::getInstance().configurableAdditionalContexts_)
+            .description("Additional output contexts shown in the log file")
+            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContexts);
 
         SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
@@ -279,15 +310,4 @@
     void Core::devModeChanged()
     {
-        bool isNormal = (bDevMode_ == PathConfig::buildDirectoryRun());
-        if (isNormal)
-        {
-            ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", update);
-        }
-        else
-        {
-            OutputLevel::Value level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
-            ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level);
-        }
-
         // Inform listeners
         ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
@@ -316,4 +336,6 @@
     void Core::loadGraphics()
     {
+        orxout(internal_info) << "loading graphics in Core" << endl;
+        
         // Any exception should trigger this, even in upgradeToGraphics (see its remarks)
         Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);
@@ -327,5 +349,5 @@
         {
             // Exit the application if the Ogre config dialog was canceled
-            COUT(1) << Exception::handleMessage() << std::endl;
+            orxout(user_error) << Exception::handleMessage() << endl;
             exit(EXIT_FAILURE);
         }
@@ -338,7 +360,7 @@
             // and reloaded between throw and catch (access violation in MSVC).
             // That's why we abort completely and only display the exception.
-            COUT(1) << "An exception occurred during upgrade to graphics. "
-                    << "That is unrecoverable. The message was:" << endl
-                    << Exception::handleMessage() << endl;
+            orxout(user_error) << "An exception occurred during upgrade to graphics. "
+                               << "That is unrecoverable. The message was:" << endl
+                               << Exception::handleMessage() << endl;
             abort();
         }
@@ -357,11 +379,16 @@
 
         // Create singletons associated with graphics (in other libraries)
+        orxout(internal_info) << "creating graphics scope:" << endl;
         graphicsScope_ = new Scope<ScopeID::Graphics>();
 
         unloader.Dismiss();
+
+        orxout(internal_info) << "finished loading graphics in Core" << endl;
     }
 
     void Core::unloadGraphics()
     {
+        orxout(internal_info) << "unloading graphics in Core" << endl;
+
         safeObjectDelete(&graphicsScope_);
         safeObjectDelete(&guiManager_);
@@ -374,7 +401,7 @@
         catch (...)
         {
-            COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl
-                    << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl
-                    << "Terminating the program." << std::endl;
+            orxout(user_error) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << endl
+                               << "Another exception might be being handled which may lead to undefined behaviour!" << endl
+                               << "Terminating the program." << endl;
             abort();
         }
Index: code/trunk/src/libraries/core/Core.h
===================================================================
--- code/trunk/src/libraries/core/Core.h	(revision 8729)
+++ code/trunk/src/libraries/core/Core.h	(revision 8858)
@@ -136,5 +136,4 @@
 
             bool                      bGraphicsLoaded_;
-            int                       debugLevelLogFile_;          //!< The debug level for the log file (belongs to OutputHandler)
             std::string               language_;                   //!< The language
             bool                      bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
Index: code/trunk/src/libraries/core/CoreIncludes.h
===================================================================
--- code/trunk/src/libraries/core/CoreIncludes.h	(revision 8729)
+++ code/trunk/src/libraries/core/CoreIncludes.h	(revision 8858)
@@ -34,5 +34,5 @@
 /**
     @file
-    @ingroup Object Factory
+    @ingroup Object Factory Class Identifier
     @brief Defines several very important macros used to register objects, create factories, and to work with identifiers.
 
@@ -78,5 +78,5 @@
 #include "CorePrereqs.h"
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "Identifier.h"
 #include "ClassFactory.h"
Index: code/trunk/src/libraries/core/CorePrecompiledHeaders.h
===================================================================
--- code/trunk/src/libraries/core/CorePrecompiledHeaders.h	(revision 8729)
+++ code/trunk/src/libraries/core/CorePrecompiledHeaders.h	(revision 8858)
@@ -51,5 +51,5 @@
 #include <set>      // 50
 
-#include "util/Debug.h" // 48
+#include "util/Output.h" // 48
 
 #include <deque>    // 43
Index: code/trunk/src/libraries/core/DynLib.cc
===================================================================
--- code/trunk/src/libraries/core/DynLib.cc	(revision 8729)
+++ code/trunk/src/libraries/core/DynLib.cc	(revision 8858)
@@ -68,5 +68,5 @@
     {
         // Log library load
-        COUT(2) << "Loading module " << mName << std::endl;
+        orxout(internal_info) << "Loading module " << mName << endl;
 
         std::string name = mName;
@@ -99,5 +99,5 @@
     {
         // Log library unload
-        COUT(4) << "Unloading module " << mName << std::endl;
+        orxout(internal_info) << "Unloading module " << mName << endl;
 
         if (DYNLIB_UNLOAD( m_hInst ))
Index: code/trunk/src/libraries/core/Event.cc
===================================================================
--- code/trunk/src/libraries/core/Event.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Event.cc	(revision 8858)
@@ -49,5 +49,5 @@
         if (this->bProcessingEvent_)
         {
-            COUT(2) << "Warning: Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << std::endl;
+            orxout(internal_warning, context::events) << "Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << endl;
             return;
         }
@@ -55,5 +55,5 @@
         this->bProcessingEvent_ = true;
 
-        COUT(4) << "Processing event (EventState) : originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << "), activate: " << event.activate_ << ", name: " << event.name_ << ", statename: " << event.statename_ << ", object: " << object->getIdentifier()->getName() << " (&" << object << ")" << "." << std::endl;
+        orxout(verbose, context::events) << "Processing event (EventState) : originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << "), activate: " << event.activate_ << ", name: " << event.name_ << ", statename: " << event.statename_ << ", object: " << object->getIdentifier()->getName() << " (&" << object << ")" << "." << endl;
 
         // check if the originator is an instance of the requested class
Index: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/GUIManager.cc	(revision 8858)
@@ -73,8 +73,9 @@
 #include "util/Clock.h"
 #include "util/Convert.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/Math.h"
 #include "util/OrxAssert.h"
+#include "util/output/BaseWriter.h"
 #include "ConfigValueIncludes.h"
 #include "Core.h"
@@ -101,16 +102,16 @@
         void logEvent(const CEGUI::String& message, CEGUI::LoggingLevel level = CEGUI::Standard)
         {
-            int orxonoxLevel = CEGUI::Standard;
+            OutputLevel orxonoxLevel = level::debug_output;
             switch (level)
             {
-                case CEGUI::Errors:      orxonoxLevel = 1; break;
-                case CEGUI::Warnings:    orxonoxLevel = 2; break;
-                case CEGUI::Standard:    orxonoxLevel = 4; break;
-                case CEGUI::Informative: orxonoxLevel = 5; break;
-                case CEGUI::Insane:      orxonoxLevel = 6; break;
+                case CEGUI::Errors:      orxonoxLevel = level::internal_error; break;
+                case CEGUI::Warnings:    orxonoxLevel = level::internal_warning; break;
+                case CEGUI::Standard:    orxonoxLevel = level::verbose; break;
+                case CEGUI::Informative: orxonoxLevel = level::verbose_more; break;
+                case CEGUI::Insane:      orxonoxLevel = level::verbose_ultra; break;
                 default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
             }
-            OutputHandler::getOutStream(orxonoxLevel)
-                << "CEGUI: " << message << std::endl;
+
+            orxout(orxonoxLevel, context::cegui) << message << endl;
 
             CEGUI::DefaultLogger::logEvent(message, level);
@@ -256,12 +257,15 @@
     {
         RegisterRootObject(GUIManager);
+
+        orxout(internal_status) << "initializing GUIManager..." << endl;
+
         this->setConfigValues();
 
         using namespace CEGUI;
 
-        COUT(3) << "Initialising CEGUI." << std::endl;
+        orxout(internal_info) << "Initialising CEGUI." << endl;
 
         this->oldCEGUI_ = false;
-        
+
         // Note: No SceneManager specified yet
 #ifdef ORXONOX_OLD_CEGUI
@@ -300,7 +304,5 @@
         std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
         ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log");
-        // Set the log level according to ours (translate by subtracting 1)
-        ceguiLogger->setLoggingLevel(
-            static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
+        ceguiLogger->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
         this->ceguiLogger_ = ceguiLogger.release();
 
@@ -336,8 +338,12 @@
         // Set up the sheet manager in the Lua framework
         this->luaState_->doFile("SheetManager.lua");
+
+        orxout(internal_status) << "finished initializing GUIManager" << endl;
     }
 
     void GUIManager::destroy()
     {
+        orxout(internal_status) << "destroying GUIManager..." << endl;
+
         using namespace CEGUI;
 
@@ -356,14 +362,23 @@
 #endif
         safeObjectDelete(&luaState_);
+
+        orxout(internal_status) << "finished destroying GUIManager" << endl;
     }
 
     void GUIManager::setConfigValues(void)
     {
-        SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.") .callback(this, &GUIManager::changedGUIScheme);
+        SetConfigValue(guiScheme_, GUIManager::defaultScheme_).description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme);
         SetConfigValue(numScrollLines_, 1).description("How many lines to scroll in a list if the scroll wheel is used");
+        SetConfigValueExternal(outputLevelCeguiLog_, BaseWriter::getConfigurableSectionName(), "outputLevelCeguiLog", CEGUI::Standard).description("The log level of the CEGUI log file").callback(this, &GUIManager::changedCeguiOutputLevel);
     }
 
     void GUIManager::changedGUIScheme(void)
     {
+    }
+
+    void GUIManager::changedCeguiOutputLevel()
+    {
+        if (this->ceguiLogger_)
+            this->ceguiLogger_->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
     }
 
@@ -670,5 +685,5 @@
         {
             // Display the error and proceed. See @remarks why this can be dangerous.
-            COUT(1) << ex.getMessage() << std::endl;
+            orxout(internal_error) << ex.getMessage() << endl;
             return true;
         }
Index: code/trunk/src/libraries/core/GUIManager.h
===================================================================
--- code/trunk/src/libraries/core/GUIManager.h	(revision 8729)
+++ code/trunk/src/libraries/core/GUIManager.h	(revision 8858)
@@ -152,4 +152,6 @@
         bool protectedCall(FunctionType function);
 
+        void changedCeguiOutputLevel();
+
         // keyHandler functions
         void buttonPressed (const KeyEvent& evt);
@@ -168,27 +170,28 @@
 
 #ifdef ORXONOX_OLD_CEGUI
-        CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
-        CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
+        CEGUI::OgreCEGUIRenderer*            guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
+        CEGUI::ResourceProvider*             resourceProvider_;     //!< CEGUI's resource provider
 #else
-        CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
-        CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
-        Ogre::RenderQueueListener*           rqListener_;       //!< RQ listener so we can draw UNDER Ogre overlays
+        CEGUI::OgreRenderer*                 guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
+        CEGUI::OgreResourceProvider*         resourceProvider_;     //!< CEGUI's resource provider
+        Ogre::RenderQueueListener*           rqListener_;           //!< RQ listener so we can draw UNDER Ogre overlays
         CEGUI::OgreImageCodec*               imageCodec_;
 #endif
-        LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
-        CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
-        CEGUI::System*                       guiSystem_;        //!< CEGUI's main system
-        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
-        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
-        CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
-        CEGUI::Window*                       hudRootWindow_;    //!< Root node for the HUD sheets
-        CEGUI::Window*                       menuRootWindow_;   //!< Root node for the menu sheets (used by Lua)
-        std::map<std::string, PlayerInfo*>   players_;          //!< Stores the player (owner) for each GUI
-        Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
+        LuaState*                            luaState_;             //!< LuaState, access point to the Lua engine
+        CEGUI::LuaScriptModule*              scriptModule_;         //!< CEGUI's script module to use Lua
+        CEGUI::System*                       guiSystem_;            //!< CEGUI's main system
+        shared_ptr<ResourceInfo>             rootFileInfo_;         //!< Resource information about the root script
+        CEGUI::Logger*                       ceguiLogger_;          //!< CEGUI's logger to be able to log CEGUI errors in our log
+        int                                  outputLevelCeguiLog_;  //!< CEGUI's log level
+        CEGUI::Window*                       rootWindow_;           //!< Root node for all windows
+        CEGUI::Window*                       hudRootWindow_;        //!< Root node for the HUD sheets
+        CEGUI::Window*                       menuRootWindow_;       //!< Root node for the menu sheets (used by Lua)
+        std::map<std::string, PlayerInfo*>   players_;              //!< Stores the player (owner) for each GUI
+        Ogre::Camera*                        camera_;               //!< Camera used to render the scene with the GUI
 
         /// Helper object that executes the surrogate destructor destroy()
         DestructionHelper<GUIManager>        destructionHelper_;
 
-        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
+        static GUIManager*                   singletonPtr_s;        //!< Singleton reference to GUIManager
 
         // The used CEGUI scheme.
@@ -196,5 +199,5 @@
         std::string guiScheme_;
         bool oldCEGUI_;
-        
+
         int numScrollLines_; ///< How many lines to scroll in a list if the scroll wheel is used
 
Index: code/trunk/src/libraries/core/Game.cc
===================================================================
--- code/trunk/src/libraries/core/Game.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Game.cc	(revision 8858)
@@ -40,5 +40,5 @@
 
 #include "util/Clock.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/Sleep.h"
@@ -60,8 +60,8 @@
     SetConsoleCommand("exit", &stop_game);
     static void printFPS()
-        { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
+        { orxout(message) << Game::getInstance().getAvgFPS() << endl; }
     SetConsoleCommand("Stats", "printFPS", &printFPS);
     static void printTickTime()
-        { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }
+        { orxout(message) << Game::getInstance().getAvgTickTime() << endl; }
     SetConsoleCommand("Stats", "printTickTime", &printTickTime);
 
@@ -84,4 +84,6 @@
         , destructionHelper_(this)
     {
+        orxout(internal_status) << "initializing Game object..." << endl;
+
 #ifdef ORXONOX_PLATFORM_WINDOWS
         minimumSleepTime_ = 1000/*us*/;
@@ -106,4 +108,5 @@
 
         // Create the Core
+        orxout(internal_info) << "creating Core object:" << endl;
         this->core_ = new Core(cmdLine);
 
@@ -125,8 +128,12 @@
         this->loadedTopStateNode_ = this->rootStateNode_;
         this->loadedStates_.push_back(this->getState(rootStateNode_->name_));
+
+        orxout(internal_status) << "finished initializing Game object" << endl;
     }
 
     void Game::destroy()
     {
+        orxout(internal_status) << "destroying Game object..." << endl;
+
         // Remove us from the object lists again to avoid problems when destroying them
         this->unregisterObject();
@@ -139,4 +146,6 @@
         safeObjectDelete(&core_);
         safeObjectDelete(&gameClock_);
+
+        orxout(internal_status) << "finished destroying Game object..." << endl;
     }
 
@@ -163,5 +172,12 @@
     {
         if (this->requestedStateNodes_.empty())
-            COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl;
+            orxout(user_error) << "Starting game without requesting GameState. This automatically terminates the program." << endl;
+
+        // Update the GameState stack if required. We do this already here to have a properly initialized game before entering the main loop
+        this->updateGameStateStack();
+
+        orxout(user_status) << "Game loaded" << endl;
+        orxout(internal_status) << "--------------------------------------------------" << endl;
+        orxout(internal_status) << "starting main loop..." << endl;
 
         // START GAME
@@ -189,6 +205,6 @@
             catch (...)
             {
-                COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl;
-                COUT(0) << "This should really never happen! Closing the program." << std::endl;
+                orxout(user_error) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << endl;
+                orxout(user_error) << "This should really never happen! Closing the program." << endl;
                 this->stop();
                 break;
@@ -203,6 +219,6 @@
             catch (...)
             {
-                COUT(0) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << std::endl;
-                COUT(0) << "This should really never happen! Closing the program." << std::endl;
+                orxout(user_error) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << endl;
+                orxout(user_error) << "This should really never happen! Closing the program." << endl;
                 this->stop();
                 break;
@@ -217,4 +233,7 @@
                 this->updateFPSLimiter();
         }
+
+        orxout(internal_status) << "finished main loop" << endl;
+        orxout(internal_status) << "--------------------------------------------------" << endl;
 
         // UNLOAD all remaining states
@@ -241,8 +260,8 @@
                 catch (...)
                 {
-                    COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl;
+                    orxout(user_error) << "Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << endl;
                     // All scheduled operations have now been rendered inert --> flush them and issue a warning
                     if (this->requestedStateNodes_.size() > 1)
-                        COUT(4) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << std::endl;
+                        orxout(internal_info) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << endl;
                     this->requestedStateNodes_.clear();
                     break;
@@ -272,7 +291,7 @@
             catch (...)
             {
-                COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl;
-                COUT(1) << "This should really never happen!" << std::endl;
-                COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl;
+                orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl;
+                orxout(user_error) << "This should really never happen!" << endl;
+                orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
                 shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
                 while (current->name_ != (*it)->getName() && current)
@@ -338,4 +357,5 @@
     void Game::stop()
     {
+        orxout(user_status) << "Exit" << endl;
         this->bAbort_ = true;
     }
@@ -355,5 +375,5 @@
         if (!this->checkState(name))
         {
-            COUT(2) << "Warning: GameState named '" << name << "' doesn't exist!" << std::endl;
+            orxout(user_warning) << "GameState named '" << name << "' doesn't exist!" << endl;
             return;
         }
@@ -361,5 +381,5 @@
         if (this->bChangingState_)
         {
-            COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;
+            orxout(user_warning) << "Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << endl;
             return;
         }
@@ -372,5 +392,5 @@
         if (name == lastRequestedNode->name_)
         {
-            COUT(2) << "Warning: Requesting the currently active state! Ignoring." << std::endl;
+            orxout(user_warning) << "Requesting the currently active state! Ignoring." << endl;
             return;
         }
@@ -403,5 +423,5 @@
 
         if (requestedNodes.empty())
-            COUT(1) << "Error: Requested GameState transition is not allowed. Ignoring." << std::endl;
+            orxout(user_error) << "Requested GameState transition is not allowed. Ignoring." << endl;
         else
             this->requestedStateNodes_.insert(requestedStateNodes_.end(), requestedNodes.begin(), requestedNodes.end());
@@ -425,5 +445,5 @@
             this->requestState(lastRequestedNode->parent_.lock()->name_);
         else
-            COUT(2) << "Warning: Can't pop the internal dummy root GameState" << std::endl;
+            orxout(internal_warning) << "Can't pop the internal dummy root GameState" << endl;
     }
 
@@ -437,7 +457,7 @@
             std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name);
             if (it != gameStateDeclarations_s.end())
-                COUT(1) << "Error: GameState '" << name << "' has not yet been loaded." << std::endl;
+                orxout(internal_error) << "GameState '" << name << "' has not yet been loaded." << endl;
             else
-                COUT(1) << "Error: Could not find GameState '" << name << "'." << std::endl;
+                orxout(internal_error) << "Could not find GameState '" << name << "'." << endl;
             return shared_ptr<GameState>();
         }
@@ -507,4 +527,7 @@
         if (!GameMode::showsGraphics())
         {
+            orxout(user_status) << "Loading graphics" << endl;
+            orxout(internal_info) << "loading graphics in Game" << endl;
+
             core_->loadGraphics();
             Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
@@ -524,4 +547,6 @@
             }
             graphicsUnloader.Dismiss();
+
+            orxout(internal_info) << "finished loading graphics in Game" << endl;
         }
     }
@@ -531,4 +556,7 @@
         if (GameMode::showsGraphics())
         {
+            orxout(user_status) << "Unloading graphics" << endl;
+            orxout(internal_info) << "unloading graphics in Game" << endl;
+
             // Destroy all the GameStates that require graphics
             for (GameStateMap::iterator it = constructedStates_.begin(); it != constructedStates_.end();)
@@ -555,4 +583,6 @@
     void Game::loadState(const std::string& name)
     {
+        orxout(internal_status) << "loading state '" << name << "'" << endl;
+
         this->bChangingState_ = true;
         LOKI_ON_BLOCK_EXIT_OBJ(*this, &Game::resetChangingState); (void)LOKI_ANONYMOUS_VARIABLE(scopeGuard);
@@ -577,4 +607,6 @@
     void Game::unloadState(const std::string& name)
     {
+        orxout(internal_status) << "unloading state '" << name << "'" << endl;
+
         this->bChangingState_ = true;
         try
@@ -589,6 +621,6 @@
         catch (...)
         {
-            COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl;
-            COUT(2) << "         There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl;
+            orxout(internal_warning) << "Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << endl;
+            orxout(internal_warning) << "There might be potential resource leaks involved! To avoid this, improve exception-safety." << endl;
         }
         // Check if graphics is still required
Index: code/trunk/src/libraries/core/Game.h
===================================================================
--- code/trunk/src/libraries/core/Game.h	(revision 8729)
+++ code/trunk/src/libraries/core/Game.h	(revision 8858)
@@ -47,5 +47,5 @@
 #include <boost/preprocessor/cat.hpp>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/DestructionHelper.h"
 #include "util/Singleton.h"
@@ -215,6 +215,6 @@
         else
         {
-            COUT(0) << "Error: Cannot declare two GameStates with the same name." << std::endl;
-            COUT(0) << "       Ignoring second one ('" << stateName << "')." << std::endl;
+            orxout(internal_warning) << "Cannot declare two GameStates with the same name." << endl;
+            orxout(internal_warning) << "Ignoring second one ('" << stateName << "')." << endl;
         }
 
Index: code/trunk/src/libraries/core/GameState.cc
===================================================================
--- code/trunk/src/libraries/core/GameState.cc	(revision 8729)
+++ code/trunk/src/libraries/core/GameState.cc	(revision 8858)
@@ -35,5 +35,4 @@
 #include "GameState.h"
 
-#include "util/Debug.h"
 #include "util/Exception.h"
 #include "util/OrxAssert.h"
Index: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/GraphicsManager.cc	(revision 8858)
@@ -104,4 +104,5 @@
         RegisterObject(GraphicsManager);
 
+        orxout(internal_status) << "initializing GraphicsManager..." << endl;
         this->setConfigValues();
 
@@ -114,5 +115,5 @@
         resources_.reset(new XMLFile("DefaultResources.oxr"));
         resources_->setLuaSupport(false);
-        Loader::open(resources_.get());
+        Loader::open(resources_.get(), ClassTreeMask(), false);
 
         // Only for runs in the build directory (not installed)
@@ -122,5 +123,5 @@
         extResources_.reset(new XMLFile("resources.oxr"));
         extResources_->setLuaSupport(false);
-        Loader::open(extResources_.get());
+        Loader::open(extResources_.get(), ClassTreeMask(), false);
 
         if (bLoadRenderer)
@@ -129,8 +130,12 @@
             this->upgradeToGraphics();
         }
+
+        orxout(internal_status) << "finished initializing GraphicsManager" << endl;
     }
 
     void GraphicsManager::destroy()
     {
+        orxout(internal_status) << "destroying GraphicsManager..." << endl;
+
         Loader::unload(debugOverlay_.get());
 
@@ -148,4 +153,6 @@
         safeObjectDelete(&ogreLogger_);
         safeObjectDelete(&ogreWindowEventListener_);
+
+        orxout(internal_status) << "finished destroying GraphicsManager" << endl;
     }
 
@@ -158,10 +165,4 @@
         SetConfigValue(ogreLogFile_,     "ogre.log")
             .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
-        SetConfigValue(ogreLogLevelTrivial_ , 5)
-            .description("Corresponding orxonox debug level for ogre Trivial");
-        SetConfigValue(ogreLogLevelNormal_  , 4)
-            .description("Corresponding orxonox debug level for ogre Normal");
-        SetConfigValue(ogreLogLevelCritical_, 2)
-            .description("Corresponding orxonox debug level for ogre Critical");
     }
 
@@ -179,4 +180,6 @@
             return;
 
+        orxout(internal_info) << "GraphicsManager upgrade to graphics" << endl;
+
         // load all the required plugins for Ogre
         this->loadOgrePlugins();
@@ -189,4 +192,6 @@
         // choose another resource group.
         Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+        orxout(internal_info) << "GraphicsManager finished upgrade to graphics" << endl;
     }
 
@@ -197,14 +202,14 @@
     void GraphicsManager::loadOgreRoot()
     {
-        COUT(3) << "Setting up Ogre..." << std::endl;
+        orxout(internal_info) << "Setting up Ogre..." << endl;
 
         if (ogreConfigFile_.empty())
         {
-            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
+            orxout(internal_warning) << "Ogre config file set to \"\". Defaulting to config.cfg" << endl;
             ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
         }
         if (ogreLogFile_.empty())
         {
-            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
+            orxout(internal_warning) << "Ogre log file set to \"\". Defaulting to ogre.log" << endl;
             ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
         }
@@ -216,15 +221,15 @@
         // Ogre::Root will detect that we've already created a Log
         ogreLogger_ = new Ogre::LogManager();
-        COUT(4) << "Ogre LogManager created" << std::endl;
+        orxout(internal_info) << "Ogre LogManager created" << endl;
 
         // create our own log that we can listen to
         Ogre::Log *myLog;
         myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
-        COUT(4) << "Ogre Log created" << std::endl;
+        orxout(internal_info) << "Ogre Log created" << endl;
 
         myLog->setLogDetail(Ogre::LL_BOREME);
         myLog->addListener(this);
 
-        COUT(4) << "Creating Ogre Root..." << std::endl;
+        orxout(internal_info) << "Creating Ogre Root..." << endl;
 
         // check for config file existence because Ogre displays (caught) exceptions if not
@@ -240,9 +245,11 @@
         ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
 
-        COUT(3) << "Ogre set up done." << std::endl;
+        orxout(internal_info) << "Ogre set up done." << endl;
     }
 
     void GraphicsManager::loadOgrePlugins()
     {
+        orxout(internal_info) << "loading ogre plugins" << endl;
+
         // Plugin path can have many different locations...
         std::string pluginPath = specialConfig::ogrePluginsDirectory;
@@ -277,9 +284,9 @@
     void GraphicsManager::loadRenderer()
     {
-        CCOUT(4) << "Configuring Renderer" << std::endl;
+        orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl;
 
         bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp();
         if (updatedConfig)
-            COUT(2) << "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << std::endl;
+            orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl;
 
         if (!ogreRoot_->restoreConfig() || updatedConfig)
@@ -291,5 +298,5 @@
         }
 
-        CCOUT(4) << "Creating render window" << std::endl;
+        orxout(internal_info) << "Creating render window" << endl;
 
         this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox");
@@ -317,7 +324,7 @@
     {
         // Load debug overlay to show info about fps and tick time
-        COUT(4) << "Loading Debug Overlay..." << std::endl;
+        orxout(internal_info) << "Loading Debug Overlay..." << endl;
         debugOverlay_.reset(new XMLFile("debug.oxo"));
-        Loader::open(debugOverlay_.get());
+        Loader::open(debugOverlay_.get(), ClassTreeMask(), false);
     }
 
@@ -396,10 +403,10 @@
         Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName)
     {
-        int orxonoxLevel;
+        OutputLevel orxonoxLevel;
         std::string introduction;
         // Do not show caught OGRE exceptions in front
         if (message.find("EXCEPTION") != std::string::npos)
         {
-            orxonoxLevel = OutputLevel::Debug;
+            orxonoxLevel = level::internal_error;
             introduction = "Ogre, caught exception: ";
         }
@@ -409,19 +416,19 @@
             {
             case Ogre::LML_TRIVIAL:
-                orxonoxLevel = this->ogreLogLevelTrivial_;
+                orxonoxLevel = level::verbose_more;
                 break;
             case Ogre::LML_NORMAL:
-                orxonoxLevel = this->ogreLogLevelNormal_;
+                orxonoxLevel = level::verbose;
                 break;
             case Ogre::LML_CRITICAL:
-                orxonoxLevel = this->ogreLogLevelCritical_;
+                orxonoxLevel = level::internal_warning;
                 break;
             default:
-                orxonoxLevel = 0;
+                orxonoxLevel = level::debug_output;
             }
             introduction = "Ogre: ";
         }
-        OutputHandler::getOutStream(orxonoxLevel)
-            << introduction << message << std::endl;
+
+        orxout(orxonoxLevel, context::ogre) << introduction << message << endl;
     }
 
Index: code/trunk/src/libraries/core/GraphicsManager.h
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.h	(revision 8729)
+++ code/trunk/src/libraries/core/GraphicsManager.h	(revision 8858)
@@ -134,7 +134,4 @@
         std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
         std::string         ogreLogFile_;              //!< log filename for Ogre log messages
-        int                 ogreLogLevelTrivial_;      //!< Corresponding Orxonox debug level for LL_TRIVIAL
-        int                 ogreLogLevelNormal_;       //!< Corresponding Orxonox debug level for LL_NORMAL
-        int                 ogreLogLevelCritical_;     //!< Corresponding Orxonox debug level for LL_CRITICAL
 
         /// Helper object that executes the surrogate destructor destroy()
Index: code/trunk/src/libraries/core/Identifier.cc
===================================================================
--- code/trunk/src/libraries/core/Identifier.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Identifier.cc	(revision 8858)
@@ -130,5 +130,5 @@
         {
             // If no: We have to store the information and initialize the Identifier
-            COUT(4) << "*** ClassIdentifier: Register Class in " << this->getName() << "-Singleton -> Initialize Singleton." << std::endl;
+            orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;
             if (bRootClass)
                 this->initialize(0); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
@@ -144,5 +144,5 @@
     void Identifier::initialize(std::set<const Identifier*>* parents)
     {
-        COUT(4) << "*** Identifier: Initialize " << this->name_ << "-Singleton." << std::endl;
+        orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;
         this->bCreatedOneObject_ = true;
 
@@ -191,5 +191,5 @@
     void Identifier::createClassHierarchy()
     {
-        COUT(3) << "*** Identifier: Create class-hierarchy" << std::endl;
+        orxout(internal_status) << "Create class-hierarchy" << endl;
         Identifier::startCreatingHierarchy();
         for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMap().begin(); it != Identifier::getStringIdentifierMap().end(); ++it)
@@ -203,5 +203,5 @@
         }
         Identifier::stopCreatingHierarchy();
-        COUT(3) << "*** Identifier: Finished class-hierarchy creation" << std::endl;
+        orxout(internal_status) << "Finished class-hierarchy creation" << endl;
     }
 
@@ -242,7 +242,7 @@
         else
         {
-            COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
-            COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
-            COUT(1) << "Aborting..." << std::endl;
+            orxout(user_error) << "An error occurred in Identifier.cc:" << endl;
+            orxout(user_error) << "Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << endl;
+            orxout(user_error) << "Aborting..." << endl;
             abort();
             return 0;
@@ -404,5 +404,5 @@
         if (it != this->configValues_.end())
         {
-            COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << std::endl;
+            orxout(internal_warning) << "Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << endl;
             delete (it->second);
         }
@@ -450,5 +450,5 @@
         if (it != this->xmlportParamContainers_.end())
         {
-            COUT(2) << "Warning: Overwriting XMLPortParamContainer in class " << this->getName() << '.' << std::endl;
+            orxout(internal_warning) << "Overwriting XMLPortParamContainer in class " << this->getName() << '.' << endl;
             delete (it->second);
         }
@@ -481,5 +481,5 @@
         if (it != this->xmlportObjectContainers_.end())
         {
-            COUT(2) << "Warning: Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << std::endl;
+            orxout(internal_warning) << "Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << endl;
             delete (it->second);
         }
Index: code/trunk/src/libraries/core/Identifier.h
===================================================================
--- code/trunk/src/libraries/core/Identifier.h	(revision 8729)
+++ code/trunk/src/libraries/core/Identifier.h	(revision 8858)
@@ -64,5 +64,5 @@
     for (Iterator<BaseObject> it = objects.begin(); it != objects.end(); ++it)  // iterate through the objects
         ++count;
-    COUT(0) << count << std::endl;                                              // prints "2" because we created 2 instances of MyClass so far
+    orxout() << count << endl;                                                  // prints "2" because we created 2 instances of MyClass so far
 
 
@@ -89,5 +89,5 @@
 #include <loki/TypeTraits.h>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "MetaObjectList.h"
 #include "ObjectList.h"
@@ -405,9 +405,9 @@
         if (ClassIdentifier<T>::classIdentifier_s == proposal)
         {
-            COUT(4) << "*** Identifier: Requested Identifier for " << name << " was not yet existing and got created." << std::endl;
+            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was not yet existing and got created." << endl;
         }
         else
         {
-            COUT(4) << "*** Identifier: Requested Identifier for " << name << " was already existing and got assigned." << std::endl;
+            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was already existing and got assigned." << endl;
         }
     }
@@ -423,7 +423,7 @@
     {
         if (bRootClass)
-            COUT(5) << "*** Register Root-Object: " << className << std::endl;
+            orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl;
         else
-            COUT(5) << "*** Register Object: " << className << std::endl;
+            orxout(verbose, context::object_list) << "Register Object: " << className << endl;
 
         object->identifier_ = this;
@@ -444,5 +444,5 @@
         else
         {
-            COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
+            orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
             object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
 
Index: code/trunk/src/libraries/core/Language.cc
===================================================================
--- code/trunk/src/libraries/core/Language.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Language.cc	(revision 8858)
@@ -35,5 +35,5 @@
 
 #include <fstream>
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/StringUtils.h"
 #include "Core.h"
@@ -131,5 +131,5 @@
         }
 
-        COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << std::endl;
+        orxout(internal_warning, context::language) << "Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << endl;
         return it->second;
     }
@@ -142,5 +142,5 @@
     void Language::addEntry(const LanguageEntryLabel& label, const std::string& entry)
     {
-        COUT(5) << "Language: Called addEntry with\n  label: " << label << "\n  entry: " <<  entry << std::endl;
+        orxout(verbose, context::language) << "Called addEntry with" << '\n' << "label: " << label << '\n' << "entry: " <<  entry << endl;
         std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(label);
         if (it == this->languageEntries_.end())
@@ -179,5 +179,5 @@
         {
             // Uh, oh, an undefined entry was requested: return the default string
-            COUT(2) << "Warning: Language entry \"" << label << "\" not found!" << std::endl;
+            orxout(internal_warning, context::language) << "Language entry \"" << label << "\" not found!" << endl;
             return this->defaultLocalisation_;
         }
@@ -201,5 +201,5 @@
     void Language::readDefaultLanguageFile()
     {
-        COUT(4) << "Read default language file." << std::endl;
+        orxout(internal_info, context::language) << "Read default language file." << endl;
 
         const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
@@ -216,6 +216,6 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
+            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << endl;
             return;
         }
@@ -237,5 +237,5 @@
                 else
                 {
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << std::endl;
+                    orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << endl;
                 }
             }
@@ -250,5 +250,5 @@
     void Language::readTranslatedLanguageFile()
     {
-        COUT(4) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << std::endl;
+        orxout(internal_info, context::language) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << endl;
 
         const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getLanguage());
@@ -260,8 +260,8 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << std::endl;
+            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << endl;
             Core::getInstance().resetLanguage();
-            COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << '.' << std::endl;
+            orxout(internal_info, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl;
             return;
         }
@@ -291,5 +291,5 @@
                 else
                 {
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << std::endl;
+                    orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << endl;
                 }
             }
@@ -304,5 +304,5 @@
     void Language::writeDefaultLanguageFile() const
     {
-        COUT(4) << "Language: Write default language file." << std::endl;
+        orxout(verbose, context::language) << "Write default language file." << endl;
 
         const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
@@ -314,6 +314,6 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
+            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << endl;
             return;
         }
@@ -322,5 +322,5 @@
         for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
         {
-            file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl;
+            file << it->second->getLabel() << '=' << it->second->getDefault() << endl;
         }
 
Index: code/trunk/src/libraries/core/Language.h
===================================================================
--- code/trunk/src/libraries/core/Language.h	(revision 8729)
+++ code/trunk/src/libraries/core/Language.h	(revision 8858)
@@ -51,5 +51,5 @@
      - Get the localisation of the entry in the configured language:
        @code
-       std::cout << Language::getInstance()->getLocalisation("name of the entry") << std::endl;
+       orxout() << Language::getInstance()->getLocalisation("name of the entry") << endl;
        @endcode
 
@@ -58,5 +58,5 @@
     int age = 20;
     AddLanguageEntry("user_age", "Age");
-    std::cout << GetLocalisation("user_age") << ": " << age << std::endl;
+    orxout() << GetLocalisation("user_age") << ": " << age << endl;
     @endcode
 
Index: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Loader.cc	(revision 8858)
@@ -33,5 +33,5 @@
 #include <boost/scoped_ptr.hpp>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/StringUtils.h"
@@ -49,8 +49,8 @@
     ClassTreeMask Loader::currentMask_s;
 
-    bool Loader::open(const XMLFile* file, const ClassTreeMask& mask)
+    bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
     {
         Loader::add(file, mask);
-        return Loader::load(file, mask);
+        return Loader::load(file, mask, bVerbose);
     }
 
@@ -93,14 +93,14 @@
     @param mask
         A ClassTreeMask, which defines which types of classes are loaded and which aren't.
-    @param verbose
+    @param bVerbose
         Whether the loader is verbose (prints its progress in a low output level) or not.
     @return
         Returns true if successful.
     */
-    bool Loader::load(const ClassTreeMask& mask, bool verbose)
+    bool Loader::load(const ClassTreeMask& mask, bool bVerbose)
     {
         bool success = true;
         for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
-            if (!Loader::load(it->first, it->second * mask, verbose))
+            if (!Loader::load(it->first, it->second * mask, bVerbose))
                 success = false;
 
@@ -124,13 +124,13 @@
     @param mask
         A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
-    @param verbose
+    @param bVerbose
         Whether the loader is verbose (prints its progress in a low output level) or not.
     @return
         Returns true if successful.
     */
-    bool Loader::reload(const ClassTreeMask& mask, bool verbose)
+    bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
     {
         Loader::unload(mask);
-        return Loader::load(mask, verbose);
+        return Loader::load(mask, bVerbose);
     }
 
@@ -142,5 +142,5 @@
     @param mask
         A ClassTreeMask, which defines which types of classes are loaded and which aren't.
-    @param verbose
+    @param bVerbose
         Whether the loader is verbose (prints its progress in a low output level) or not.
     @param bRemoveLuaTags
@@ -149,5 +149,5 @@
         Returns true if successful.
     */
-    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose, bool bRemoveLuaTags)
+    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose, bool bRemoveLuaTags)
     {
         if (!file)
@@ -170,5 +170,5 @@
             if (info == NULL)
             {
-                COUT(1) << "Error: Could not find XML file '" << file->getFilename() << "'." << std::endl;
+                orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl;
                 return false;
             }
@@ -187,13 +187,13 @@
         try
         {
-            if(verbose)
-            {
-                COUT(0) << "Start loading " << file->getFilename() << "..." << std::endl;
-                COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
-            }
-            else
-            {
-                COUT(4) << "Start loading " << file->getFilename() << "..." << std::endl;
-                COUT(4) << "Mask: " << Loader::currentMask_s << std::endl;
+            if(bVerbose)
+            {
+                orxout(user_info) << "Start loading " << file->getFilename() << "..." << endl;
+                orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s << endl;
+            }
+            else
+            {
+                orxout(verbose, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
+                orxout(verbose_more, context::loader) << "Mask: " << Loader::currentMask_s << endl;
             }
 
@@ -208,5 +208,5 @@
                 rootElement.InsertEndChild(*child);
 
-            COUT(4) << "  creating root-namespace..." << std::endl;
+            orxout(verbose, context::loader) << "  creating root-namespace..." << endl;
             Namespace* rootNamespace = new Namespace(0);
             rootNamespace->setLoaderIndentation("    ");
@@ -216,10 +216,10 @@
             rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
 
-            if(verbose)
-                COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
-            else
-                COUT(4) << "Finished loading " << file->getFilename() << '.' << std::endl;
-
-            COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString("  ") << std::endl;
+            if(bVerbose)
+                orxout(user_info) << "Finished loading " << file->getFilename() << '.' << endl;
+            else
+                orxout(verbose, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
+
+            orxout(verbose, context::loader) << "Namespace-tree:" << '\n' << rootNamespace->toString("  ") << endl;
 
             return true;
@@ -227,24 +227,24 @@
         catch (ticpp::Exception& ex)
         {
-            COUT(1) << std::endl;
-            COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
-            COUT(1) << ex.what() << std::endl;
-            COUT(1) << "Loading aborted." << std::endl;
+            orxout(user_error, context::loader) << endl;
+            orxout(user_error, context::loader) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+            orxout(user_error, context::loader) << ex.what() << endl;
+            orxout(user_error, context::loader) << "Loading aborted." << endl;
             return false;
         }
         catch (Exception& ex)
         {
-            COUT(1) << std::endl;
-            COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
-            COUT(1) << ex.what() << std::endl;
-            COUT(1) << "Loading aborted." << std::endl;
+            orxout(user_error, context::loader) << endl;
+            orxout(user_error, context::loader) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+            orxout(user_error, context::loader) << ex.what() << endl;
+            orxout(user_error, context::loader) << "Loading aborted." << endl;
             return false;
         }
         catch (...)
         {
-            COUT(1) << std::endl;
-            COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
-            COUT(1) << Exception::handleMessage() << std::endl;
-            COUT(1) << "Loading aborted." << std::endl;
+            orxout(user_error, context::loader) << endl;
+            orxout(user_error, context::loader) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+            orxout(user_error, context::loader) << Exception::handleMessage() << endl;
+            orxout(user_error, context::loader) << "Loading aborted." << endl;
             return false;
         }
@@ -271,13 +271,13 @@
     @param mask
         A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
-    @param verbose
+    @param bVerbose
         Whether the loader is verbose (prints its progress in a low output level) or not.
     @return
         Returns true if successful.
     */
-    bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool verbose)
+    bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
     {
         Loader::unload(file, mask);
-        return Loader::load(file, mask, verbose);
+        return Loader::load(file, mask, bVerbose);
     }
 
@@ -337,7 +337,7 @@
             if (!expectedValue)
             {
-                COUT(2) << "Warning: Error in level file" << std::endl;
+                orxout(internal_error, context::loader) << "Error in level file" << endl;
                 // TODO: error handling
-                return false; 
+                return false;
             }
         }
Index: code/trunk/src/libraries/core/Loader.h
===================================================================
--- code/trunk/src/libraries/core/Loader.h	(revision 8729)
+++ code/trunk/src/libraries/core/Loader.h	(revision 8858)
@@ -51,5 +51,5 @@
     {
         public:
-            static bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
+            static bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
             static void close();
             static void close(const XMLFile* file);
@@ -58,12 +58,12 @@
             static void remove(const XMLFile* file);
 
-            static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
+            static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
             static void unload(const ClassTreeMask& mask = ClassTreeMask());
-            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
+            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
 
             static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
-                             bool verbose = true, bool bRemoveLuaTags = false);
+                             bool bVerbose = true, bool bRemoveLuaTags = false);
             static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
-            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
+            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
 
             static std::string replaceLuaTags(const std::string& text);
Index: code/trunk/src/libraries/core/LuaState.cc
===================================================================
--- code/trunk/src/libraries/core/LuaState.cc	(revision 8729)
+++ code/trunk/src/libraries/core/LuaState.cc	(revision 8858)
@@ -37,5 +37,5 @@
 #include <loki/ScopeGuard.h>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "Resource.h"
@@ -96,5 +96,5 @@
         else
         {
-            COUT(2) << "LuaState: Cannot include file '" << filename << "' (not found)." << std::endl;
+            orxout(internal_warning, context::lua) << "LuaState: Cannot include file '" << filename << "' (not found)." << endl;
             return false;
         }
@@ -136,5 +136,5 @@
         else
         {
-            COUT(2) << "LuaState: Cannot do file '" << filename << "' (not found)." << std::endl;
+            orxout(internal_warning, context::lua) << "LuaState: Cannot do file '" << filename << "' (not found)." << endl;
             return false;
         }
@@ -176,8 +176,8 @@
         {
         case LUA_ERRSYNTAX: // Syntax error
-            COUT(1) << "Lua syntax error: " << lua_tostring(luaState_, -1) << std::endl;
+            orxout(internal_error, context::lua) << "Lua syntax error: " << lua_tostring(luaState_, -1) << endl;
             break;
         case LUA_ERRMEM:    // Memory allocation error
-            COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
+            orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
             break;
         }
@@ -200,12 +200,12 @@
                     std::string errorString = lua_tostring(this->luaState_, -1);
                     if (errorString.find("Error propagation") == std::string::npos)
-                        COUT(1) << "Lua runtime error: " << errorString << std::endl;
+                        orxout(internal_error, context::lua) << "Lua runtime error: " << errorString << endl;
                 }
                 break;
             case LUA_ERRERR: // Error in the error handler
-                COUT(1) << "Lua error in error handler. No message available." << std::endl;
+                orxout(internal_error, context::lua) << "Lua error in error handler. No message available." << endl;
                 break;
             case LUA_ERRMEM: // Memory allocation error
-                COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
+                orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
                 break;
             }
@@ -236,7 +236,17 @@
     }
 
-    void LuaState::luaLog(unsigned int level, const std::string& message)
-    {
-        OutputHandler::getOutStream(level) << message << std::endl;
+    void LuaState::luaOutput(OutputLevel level, const std::string& context, const std::string& message)
+    {
+        orxout(level, registerContext(context)) << message << endl;
+    }
+
+    void LuaState::luaOutput(OutputLevel level, const std::string& message)
+    {
+        orxout(level, context::lua) << message << endl;
+    }
+
+    void LuaState::luaOutput(const std::string& message)
+    {
+        orxout(debug_output, context::lua) << message << endl;
     }
 
@@ -288,5 +298,5 @@
             if (it->first == name || it->second == function)
             {
-                COUT(2) << "Warning: Trying to add a Tolua interface with the same name or function." << std::endl;
+                orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl;
                 return true;
             }
@@ -307,5 +317,5 @@
         if (it == getToluaInterfaces().end())
         {
-            COUT(2) << "Warning: Cannot remove Tolua interface '" << name << "': Not found" << std::endl;
+            orxout(internal_warning, context::lua) << "Cannot remove Tolua interface '" << name << "': Not found" << endl;
             return true;
         }
Index: code/trunk/src/libraries/core/LuaState.h
===================================================================
--- code/trunk/src/libraries/core/LuaState.h	(revision 8729)
+++ code/trunk/src/libraries/core/LuaState.h	(revision 8858)
@@ -49,4 +49,6 @@
 #include <boost/shared_ptr.hpp>
 
+#include "util/Output.h"
+
 namespace orxonox // tolua_export
 { // tolua_export
@@ -83,5 +85,7 @@
 
         void luaPrint(const std::string& str); // tolua_export
-        void luaLog(unsigned int level, const std::string& message); // tolua_export
+        void luaOutput(orxonox::level::OutputLevel level, const std::string& context, const std::string& message); // tolua_export
+        void luaOutput(orxonox::level::OutputLevel level, const std::string& message); // tolua_export
+        void luaOutput(const std::string& message); // tolua_export
         bool fileExists(const std::string& filename); // tolua_export
         std::string getSourceCode(const std::string& filename); // tolua_export
Index: code/trunk/src/libraries/core/MetaObjectList.cc
===================================================================
--- code/trunk/src/libraries/core/MetaObjectList.cc	(revision 8729)
+++ code/trunk/src/libraries/core/MetaObjectList.cc	(revision 8858)
@@ -34,5 +34,5 @@
 #include "MetaObjectList.h"
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "Identifier.h"
 #include "ObjectListBase.h"
@@ -48,5 +48,5 @@
     MetaObjectListElement::~MetaObjectListElement()
     {
-        COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl;
+        orxout(verbose, context::object_list) << "Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << endl;
         this->list_->notifyIterators(this->element_->objectBase_);
 
Index: code/trunk/src/libraries/core/NamespaceNode.cc
===================================================================
--- code/trunk/src/libraries/core/NamespaceNode.cc	(revision 8729)
+++ code/trunk/src/libraries/core/NamespaceNode.cc	(revision 8858)
@@ -28,5 +28,5 @@
 
 #include "NamespaceNode.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 
 namespace orxonox
@@ -70,10 +70,10 @@
                 if (this->bRoot_)
                 {
-                    COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << std::endl;
+                    orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << endl;
                     nodes = this->getNodeRelative(secondPart);
                 }
                 else if (!this->parent_)
                 {
-                    COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << std::endl;
+                    orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << endl;
                     nodes = this->getNodeRelative(secondPart);
                 }
@@ -91,5 +91,5 @@
                 if (it->second->isHidden())
                 {
-                    COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl;
+                    orxout(internal_warning) << "Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << endl;
                     nodes.insert(this);
                 }
@@ -115,5 +115,5 @@
                 if (!bFoundMatchingNamespace)
                 {
-                    COUT(2) << "Warning: No file included with name '" << firstPart.substr(1, std::string::npos) << "' at this part of the level file, using parent namespace instead." << std::endl;
+                    orxout(internal_warning) << "No file included with name '" << firstPart.substr(1, std::string::npos) << "' at this part of the level file, using parent namespace instead." << endl;
                     nodes = this->getNodeRelative(secondPart);
                 }
Index: code/trunk/src/libraries/core/OrxonoxClass.cc
===================================================================
--- code/trunk/src/libraries/core/OrxonoxClass.cc	(revision 8729)
+++ code/trunk/src/libraries/core/OrxonoxClass.cc	(revision 8858)
@@ -60,5 +60,5 @@
     {
 //        if (!this->requestedDestruction_)
-//            COUT(2) << "Warning: Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << std::endl;
+//            orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;
 
         assert(this->referenceCount_ <= 0);
Index: code/trunk/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/trunk/src/libraries/core/OrxonoxClass.h	(revision 8729)
+++ code/trunk/src/libraries/core/OrxonoxClass.h	(revision 8858)
@@ -49,11 +49,4 @@
 #include <vector>
 #include "Super.h"
-
-/**
-@def CCOUT
-    Acts almost exactly like COUT(x), but prepends "ClassName: "
-*/
-#define CCOUT(level) \
-    COUT(level) << this->getIdentifier()->getName() << ": "
 
 namespace orxonox
Index: code/trunk/src/libraries/core/PathConfig.cc
===================================================================
--- code/trunk/src/libraries/core/PathConfig.cc	(revision 8729)
+++ code/trunk/src/libraries/core/PathConfig.cc	(revision 8858)
@@ -51,5 +51,5 @@
 
 #include "SpecialConfig.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "CommandLineParser.h"
@@ -137,5 +137,5 @@
         if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
         {
-            COUT(1) << "Running from the build tree." << std::endl;
+            orxout(internal_info) << "Running from the build tree." << endl;
             PathConfig::bBuildDirectoryRun_ = true;
             modulePath_ = specialConfig::moduleDevDirectory;
@@ -247,5 +247,5 @@
             if (bf::create_directories(it->first)) // function may not return true at all (bug?)
             {
-                COUT(4) << "Created " << it->second << " directory" << std::endl;
+                orxout(internal_info) << "Created " << it->second << " directory" << endl;
             }
         }
Index: code/trunk/src/libraries/core/SubclassIdentifier.h
===================================================================
--- code/trunk/src/libraries/core/SubclassIdentifier.h	(revision 8729)
+++ code/trunk/src/libraries/core/SubclassIdentifier.h	(revision 8858)
@@ -69,5 +69,5 @@
 
 #include <cstdlib>
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "Identifier.h"
 
@@ -119,13 +119,13 @@
                 if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
                 {
-                    COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
+                    orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
                     if (identifier)
                     {
-                        COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
-                        COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
+                        orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+                        orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
                     }
                     else
                     {
-                        COUT(1) << "Error: Can't assign NULL identifier" << std::endl;
+                        orxout(internal_error) << "Can't assign NULL identifier" << endl;
                     }
                 }
@@ -177,15 +177,15 @@
                     if (this->identifier_)
                     {
-                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
-                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
-                        COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
+                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+                        orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+                        orxout(user_error) << "Couldn't fabricate a new Object." << endl;
                     }
                     else
                     {
-                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
-                        COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
-                    }
-
-                    COUT(1) << "Aborting..." << std::endl;
+                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+                        orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
+                    }
+
+                    orxout(user_error) << "Aborting..." << endl;
                     abort();
                     return 0;
Index: code/trunk/src/libraries/core/Super.h
===================================================================
--- code/trunk/src/libraries/core/Super.h	(revision 8729)
+++ code/trunk/src/libraries/core/Super.h	(revision 8858)
@@ -73,5 +73,5 @@
 
 #include "CorePrereqs.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 
 ///////////////////////
@@ -114,5 +114,5 @@
                     if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
                     { \
-                        COUT(5) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl; \
+                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
                     } \
@@ -184,5 +184,5 @@
                     {
                         // Add the SuperFunctionCaller
-                        COUT(5) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
+                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
                     }
Index: code/trunk/src/libraries/core/Template.cc
===================================================================
--- code/trunk/src/libraries/core/Template.cc	(revision 8729)
+++ code/trunk/src/libraries/core/Template.cc	(revision 8858)
@@ -32,5 +32,5 @@
 #include <tinyxml/ticpp.h>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "CoreIncludes.h"
 #include "XMLPort.h"
@@ -88,5 +88,5 @@
             it = Template::getTemplateMap().find(this->getName());
             if (it != Template::getTemplateMap().end())
-                COUT(2) << "Warning: Template with name \"" << this->getName() << "\" already exists." << std::endl;
+                orxout(internal_warning, context::templates) << "Template with name \"" << this->getName() << "\" already exists." << endl;
             else
                 Template::getTemplateMap()[this->getName()] = this;
@@ -117,10 +117,10 @@
                 else
                 {
-                    COUT(2) << "Warning: Linking from " << this->getName() << " to " << this->link_ << " leads to an infinite loop. Returning own element." << std::endl;
+                    orxout(internal_warning, context::templates) << "Linking from \"" << this->getName() << "\" to \"" << this->link_ << "\" leads to an infinite loop. Returning own element." << endl;
                 }
             }
             else
             {
-                COUT(2) << "Warning: " << this->link_ << " is not an existing Template name. Returning own element." << std::endl;
+                orxout(internal_warning, context::templates) << '"' << this->link_ << "\" is not an existing Template name. Returning own element." << endl;
             }
         }
@@ -142,10 +142,10 @@
             if (!object->isA(this->baseclassIdentifier_))
             {
-                COUT(1) << "Error: Can't apply template (name: " << this->getName() << "), object (name: " << object->getName() << ", class: " << object->getIdentifier()->getName() << ") is not a " << this->baseclassIdentifier_->getName() << std::endl;
+                orxout(internal_error, context::templates) << "Can't apply template (name: " << this->getName() << "), object (name: " << object->getName() << ", class: " << object->getIdentifier()->getName() << ") is not a " << this->baseclassIdentifier_->getName() << endl;
                 return;
             }
         }
 
-        COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl;
+        orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
 
         Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
@@ -170,5 +170,5 @@
         else
         {
-            COUT(2) << "Warning: Template with name " << name << " doesn't exist." << std::endl;
+            orxout(internal_warning, context::templates) << "Template with name " << name << " doesn't exist." << endl;
             return 0;
         }
Index: code/trunk/src/libraries/core/WeakPtr.h
===================================================================
--- code/trunk/src/libraries/core/WeakPtr.h	(revision 8729)
+++ code/trunk/src/libraries/core/WeakPtr.h	(revision 8858)
@@ -65,5 +65,5 @@
     void myCallback()                                   // definition of the callback function
     {
-        COUT(0) << "Object destroyed" << std::endl;
+        orxout() << "Object destroyed" << endl;
     }
 
Index: code/trunk/src/libraries/core/XMLPort.cc
===================================================================
--- code/trunk/src/libraries/core/XMLPort.cc	(revision 8729)
+++ code/trunk/src/libraries/core/XMLPort.cc	(revision 8858)
@@ -64,5 +64,5 @@
                         if (!this->sectionname_.empty())
                         {
-                            COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a valid classname." << std::endl;
+                            orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a valid classname." << endl;
                         }
                         else
@@ -74,10 +74,10 @@
                     if (!identifier->isA(objectIdentifier_))
                     {
-                        COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << std::endl;
+                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << endl;
                         continue;
                     }
                     if (!identifier->isLoadable())
                     {
-                        COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl;
+                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not loadable." << endl;
                         continue;
                     }
@@ -87,5 +87,5 @@
                     try
                     {
-                        COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
+                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
 
                         BaseObject* newObject = identifier->fabricate(object);
@@ -95,12 +95,10 @@
                         {
                             newObject->XMLPort(*child, XMLPort::LoadObject);
-                            COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
+                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
                         }
                         else
                         {
-                            COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
+                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
                         }
-
-                        COUT(5) << object->getLoaderIndentation();
 
                         this->callLoadExecutor(object, newObject);
@@ -109,15 +107,15 @@
                             newObject->XMLPort(*child, XMLPort::LoadObject);
 
-                        COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
+                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << endl;
                     }
                     catch (AbortLoadingException& ex)
                     {
-                        COUT(1) << "An error occurred while loading object, abort loading..." << std::endl;
+                        orxout(internal_error, context::xml) << "An error occurred while loading object, abort loading..." << endl;
                         throw ex;
                     }
                     catch (...)
                     {
-                        COUT(1) << "An error occurred while loading object:" << std::endl;
-                        COUT(1) << Exception::handleMessage() << std::endl;
+                        orxout(internal_error, context::xml) << "An error occurred while loading object:" << endl;
+                        orxout(internal_error, context::xml) << Exception::handleMessage() << endl;
                     }
                 }
@@ -125,7 +123,7 @@
             catch (ticpp::Exception& ex)
             {
-                COUT(1) << std::endl;
-                COUT(1) << "An error occurred in XMLPort.h while loading a '" << objectIdentifier_->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ':' << std::endl;
-                COUT(1) << ex.what() << std::endl;
+                orxout(internal_error, context::xml) << endl;
+                orxout(internal_error, context::xml) << "An error occurred in XMLPort.h while loading a '" << objectIdentifier_->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ':' << endl;
+                orxout(internal_error, context::xml) << ex.what() << endl;
             }
         }
Index: code/trunk/src/libraries/core/XMLPort.h
===================================================================
--- code/trunk/src/libraries/core/XMLPort.h	(revision 8729)
+++ code/trunk/src/libraries/core/XMLPort.h	(revision 8858)
@@ -53,5 +53,5 @@
 #include <tinyxml/ticpp.h>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/MultiType.h"
@@ -415,5 +415,5 @@
                         if ((!attributeValue.empty()) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
                         {
-                            COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
+                            orxout(verbose_more, context::xml) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << endl;
                             int error;
                             this->loadexecutor_->parse(object, attributeValue, &error, ",");
@@ -430,7 +430,7 @@
                     catch (ticpp::Exception& ex)
                     {
-                        COUT(1) << std::endl;
-                        COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << this->owner_->getName() << ") in " << this->owner_->getFilename() << ':' << std::endl;
-                        COUT(1) << ex.what() << std::endl;
+                        orxout(internal_error, context::xml) << endl;
+                        orxout(internal_error, context::xml) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << this->owner_->getName() << ") in " << this->owner_->getFilename() << ':' << endl;
+                        orxout(internal_error, context::xml) << ex.what() << endl;
                     }
                 }
Index: code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 8858)
@@ -90,5 +90,5 @@
             ArgumentCompletionList _groupsandcommands(const std::string& fragment, bool bOnlyShowHidden)
             {
-                // note: this function returns only arguments that begin with "fragment", which would't be necessary for the
+                // note: this function returns only arguments that begin with "fragment", which wouldn't be necessary for the
                 //       auto-completion, but it's necessary to place the line-break "\n" between groups and commands
                 //       only if both groups AND commands are in the list.
@@ -100,5 +100,5 @@
                 const std::map<std::string, std::map<std::string, ConsoleCommand*> >& commands = ConsoleCommand::getCommands();
                 for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group)
-                    if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find_first_of(fragmentLC) == 0))
+                    if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find(fragmentLC) == 0))
                         groupList.push_back(ArgumentCompletionListElement(it_group->first, getLowercase(it_group->first)));
 
@@ -113,5 +113,5 @@
                     // add the shortcuts
                     for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)
-                        if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find_first_of(fragmentLC) == 0))
+                        if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find(fragmentLC) == 0))
                             groupList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first)));
                 }
Index: code/trunk/src/libraries/core/command/CommandEvaluation.cc
===================================================================
--- code/trunk/src/libraries/core/command/CommandEvaluation.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/CommandEvaluation.cc	(revision 8858)
@@ -131,5 +131,5 @@
 
             if (!this->execCommand_)
-                *error = CommandExecutor::Error;
+                *error = CommandExecutor::Inexistent;
             else if (!this->execCommand_->isActive())
                 *error = CommandExecutor::Deactivated;
@@ -151,5 +151,5 @@
             if (this->bEvaluatedArguments_)
             {
-                COUT(6) << "CE_execute (evaluation): " << this->execCommand_->getName() << " with " << this->numberOfEvaluatedArguments_ << " arguments: " << this->arguments_[0] << ' ' << this->arguments_[1] << ' ' << this->arguments_[2] << ' ' << this->arguments_[3] << ' ' << this->arguments_[4] << std::endl;
+                orxout(verbose, context::commands) << "CE_execute (evaluation): " << this->execCommand_->getName() << " with " << this->numberOfEvaluatedArguments_ << " arguments: " << this->arguments_[0] << ' ' << this->arguments_[1] << ' ' << this->arguments_[2] << ' ' << this->arguments_[3] << ' ' << this->arguments_[4] << endl;
 
                 // pass as many arguments to the executor as were evaluated (thus the executor can still use additional default values)
@@ -186,6 +186,6 @@
         {
             if (bPrintError)
-                COUT(1) << "Error: Can't evaluate arguments, no console command assigned." << std::endl;
-            return CommandExecutor::Error;
+                orxout(internal_error, context::commands) << "Can't evaluate arguments, no console command assigned." << endl;
+            return CommandExecutor::Inexistent;
         }
 
@@ -200,5 +200,5 @@
             this->bEvaluatedArguments_ = true;
         else if (bPrintError)
-            COUT(1) << "Error: Can't evaluate arguments, not enough arguments given." << std::endl;
+            orxout(internal_error, context::commands) << "Can't evaluate arguments, not enough arguments given." << endl;
 
         return error;
Index: code/trunk/src/libraries/core/command/CommandExecutor.cc
===================================================================
--- code/trunk/src/libraries/core/command/CommandExecutor.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/CommandExecutor.cc	(revision 8858)
@@ -69,8 +69,10 @@
         @return Returns the error-code (see @ref CommandExecutorErrorCodes "error codes")
     */
-    /* static */ int CommandExecutor::execute(const std::string& command, bool useTcl)
+    /* static */ int CommandExecutor::execute(const std::string& command, bool useTcl, bool printErrors)
     {
         int error;
         CommandExecutor::queryMT(command, &error, useTcl);
+        if (error && printErrors)
+            orxout(user_error) << "Can't execute \"" << command << "\", " << CommandExecutor::getErrorDescription(error) << ". (execute)" << endl;
         return error;
     }
@@ -85,8 +87,11 @@
     /* static */ MultiType CommandExecutor::queryMT(const std::string& command, int* error, bool useTcl)
     {
+        MultiType result;
+        int error_internal;
+
         if (useTcl)
         {
             // pass the command to tcl
-            return TclBind::eval(command, error);
+            result = TclBind::eval(command, &error_internal);
         }
         else
@@ -108,6 +113,13 @@
 
             // query the command and return its return-value
-            return evaluation.query(error);
-        }
+            result = evaluation.query(&error_internal);
+        }
+
+        if (error)
+            *error = error_internal;
+        else if (error_internal)
+            orxout(user_error) << "Can't execute \"" << command << "\", " << CommandExecutor::getErrorDescription(error_internal) << ". (query)" << endl;
+
+        return result;
     }
 
@@ -172,4 +184,21 @@
 
     /**
+        @brief Returns a description of the error code.
+        @param error The error code
+    */
+    /* static */ std::string CommandExecutor::getErrorDescription(int error)
+    {
+        switch (error)
+        {
+            case CommandExecutor::Inexistent:  return "command doesn't exist";
+            case CommandExecutor::Incomplete:  return "not enough arguments given";
+            case CommandExecutor::Deactivated: return "command is not active";
+            case CommandExecutor::Denied:      return "access denied";
+            case CommandExecutor::Error:       return "an error occurred";
+            default: return "";
+        }
+    }
+
+    /**
         @brief Gets an evaluated command from the cache.
         @param command The command that should be looked up in the cache
@@ -261,5 +290,5 @@
             if ((tokens.size() == 1 && ConsoleCommand::getCommand(tokens[0])) || (tokens.size() == 2 && ConsoleCommand::getCommand(tokens[0], tokens[1])))
             {
-                COUT(1) << "Error: A command with name \"" << alias << "\" already exists." << std::endl;
+                orxout(user_error) << "A command with name \"" << alias << "\" already exists." << endl;
                 return;
             }
@@ -271,8 +300,8 @@
                 createConsoleCommand(tokens[0], tokens[1], executor);
             else
-                COUT(1) << "Error: \"" << alias << "\" is not a valid alias name (must have one or two words)." << std::endl;
+                orxout(user_error) << "\"" << alias << "\" is not a valid alias name (must have one or two words)." << endl;
         }
         else
-            COUT(1) << "Error: \"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << std::endl;
+            orxout(user_error) << "\"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << endl;
     }
 }
Index: code/trunk/src/libraries/core/command/CommandExecutor.h
===================================================================
--- code/trunk/src/libraries/core/command/CommandExecutor.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/CommandExecutor.h	(revision 8858)
@@ -111,5 +111,5 @@
 // tolua_end
         public:
-            static int execute(const std::string& command, bool useTcl = true); // tolua_export
+            static int execute(const std::string& command, bool useTcl = true, bool printErrors = true); // tolua_export
 
             static MultiType queryMT(const std::string& command, int* error = 0, bool useTcl = true);
@@ -119,8 +119,11 @@
 
             static const int Success = 0;       ///< Error code for "success" (or no error)
-            static const int Error = 1;         ///< Error code if the command doesn't exist
+            static const int Inexistent = 1;    ///< Error code if the command doesn't exist
             static const int Incomplete = 2;    ///< Error code if the command needs more arguments
             static const int Deactivated = 3;   ///< Error code if the command is not active
             static const int Denied = 4;        ///< Error code if the command needs a different access level
+            static const int Error = 5;         ///< Error code if the command returned an error
+
+            static std::string getErrorDescription(int error);
 
             static MultiType unhide(const std::string& command);
Index: code/trunk/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 8858)
@@ -172,5 +172,5 @@
                 if (!this->executor_->defaultValueSet(i))
                 {
-                    COUT(2) << "Default value " << i << " is missing" << std::endl;
+                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
                     return false;
                 }
@@ -202,5 +202,5 @@
                 if (!executor->defaultValueSet(i))
                 {
-                    COUT(2) << "Default value " << i << " is missing" << std::endl;
+                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
                     return false;
                 }
@@ -229,5 +229,5 @@
         else
         {
-            COUT(1) << "Error: Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
+            orxout(internal_error, context::commands) << "Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
             return false;
         }
@@ -256,5 +256,5 @@
         else
         {
-            COUT(1) << "Error: Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
+            orxout(internal_error, context::commands) << "Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
             return false;
         }
@@ -307,5 +307,5 @@
             this->pushFunction(new Executor(*this->executor_.get()));
         else
-            COUT(1) << "Error: Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << endl;
     }
 
@@ -367,8 +367,8 @@
             }
             else if (object)
-                COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << std::endl;
+                orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << endl;
         }
         else if (object)
-            COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return false;
@@ -418,5 +418,5 @@
             this->executor_->setDefaultValues(arg1);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -431,5 +431,5 @@
             this->executor_->setDefaultValues(arg1, arg2);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -444,5 +444,5 @@
             this->executor_->setDefaultValues(arg1, arg2, arg3);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -457,5 +457,5 @@
             this->executor_->setDefaultValues(arg1, arg2, arg3, arg4);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -470,5 +470,5 @@
             this->executor_->setDefaultValues(arg1, arg2, arg3, arg4, arg5);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -485,5 +485,5 @@
             this->executor_->setDefaultValue(index, arg);
         else
-            COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
 
         return *this;
@@ -500,5 +500,5 @@
             this->argumentCompleter_[index] = completer;
         else
-            COUT(2) << "Warning: Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << std::endl;
+            orxout(internal_warning, context::commands) << "Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << endl;
 
         return *this;
@@ -611,7 +611,7 @@
         {
             if (group == "")
-                COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
+                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
             else
-                COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
+                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
         }
         return 0;
@@ -644,7 +644,7 @@
         {
             if (group == "")
-                COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
+                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
             else
-                COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
+                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
         }
         return 0;
@@ -681,7 +681,7 @@
         {
             if (group == "")
-                COUT(2) << "Warning: A console command with shortcut \"" << name << "\" already exists." << std::endl;
+                orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
             else
-                COUT(2) << "Warning: A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << std::endl;
+                orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
         }
         else
Index: code/trunk/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 8858)
@@ -53,5 +53,5 @@
     void myCoutFunction(const std::string& text)        // Define a static function
     {
-        COUT(0) << "Text: " << text << std::endl;       // Print the text to the console
+        orxout() << "Text: " << text << endl;           // Print the text to the console
     }
 
@@ -125,5 +125,5 @@
     void myOtherCoutFunction(const std::string& text)                       // Define a new static function
     {
-        COUT(0) << "Uppercase: " << getUppercase(text) << std::endl;        // Print the text in uppercase to the console
+        orxout() << "Uppercase: " << getUppercase(text) << endl;            // Print the text in uppercase to the console
     }
 
Index: code/trunk/src/libraries/core/command/ConsoleCommandCompilation.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommandCompilation.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/ConsoleCommandCompilation.cc	(revision 8858)
@@ -38,5 +38,5 @@
 #include <string>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/ExprParser.h"
 #include "util/StringUtils.h"
@@ -46,8 +46,17 @@
 namespace orxonox
 {
+    SetConsoleCommand("echo", echo);
+
+    SetConsoleCommand("orxout", orxout_level);
+    SetConsoleCommand("orxout_context", orxout_level_context);
+
+    SetConsoleCommand("log"    , log    );
+    SetConsoleCommand("error"  , error  ).hide();
+    SetConsoleCommand("warning", warning).hide();
+    SetConsoleCommand("status" , status ).hide();
+    SetConsoleCommand("info"   , info   ).hide();
+    SetConsoleCommand("debug"  , debug  ).hide();
+
 //    SetConsoleCommand("source", source).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
-    SetConsoleCommand("echo", echo);
-//    SetConsoleCommand("puts", puts);                                                    // disabled because we use the implementation in Tcl
-
 //    SetConsoleCommand("read", read).argumentCompleter(0, autocompletion::files());      // disabled because we use the implementation in Tcl
 //    SetConsoleCommand("append", append).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
@@ -57,4 +66,99 @@
 
     /**
+        @brief Simply returns the arguments.
+    */
+    std::string echo(const std::string& text)
+    {
+        return text;
+    }
+
+    /**
+        @brief Builds a map that maps the levels of all output levels to their ID.
+    */
+    std::map<std::string, OutputLevel> getOutputLevelsMap()
+    {
+        std::map<std::string, OutputLevel> levels;
+
+        levels["message"]          = level::message;
+        levels["debug_output"]     = level::debug_output;
+        levels["user_error"]       = level::user_error;
+        levels["user_warning"]     = level::user_warning;
+        levels["user_status"]      = level::user_status;
+        levels["user_info"]        = level::user_info;
+        levels["internal_error"]   = level::internal_error;
+        levels["internal_warning"] = level::internal_warning;
+        levels["internal_status"]  = level::internal_status;
+        levels["internal_info"]    = level::internal_info;
+        levels["verbose"]          = level::verbose;
+        levels["verbose_more"]     = level::verbose_more;
+        levels["verbose_ultra"]    = level::verbose_ultra;
+
+        return levels;
+    }
+
+    /**
+        @brief Prints text to the console.
+        @param level_name The name of the output level
+    */
+    void orxout_level(const std::string& level_name, const std::string& text)
+    {
+        static std::map<std::string, OutputLevel> levels = getOutputLevelsMap();
+
+        OutputLevel level = level::debug_output;
+        std::map<std::string, OutputLevel>::iterator it = levels.find(level_name);
+        if (it != levels.end())
+            level = it->second;
+        else
+            orxout(internal_warning) << "'" << level_name << "' is not a valid output level" << endl;
+
+        orxout(level) << text << endl;
+    }
+
+    /**
+        @brief Prints text to the console.
+        @param level_name The name of the output level
+        @param context_name The name of the output context
+    */
+    void orxout_level_context(const std::string& level_name, const std::string& context_name, const std::string& text)
+    {
+        static std::map<std::string, OutputLevel> levels = getOutputLevelsMap();
+
+        OutputLevel level = level::debug_output;
+        std::map<std::string, OutputLevel>::iterator it = levels.find(level_name);
+        if (it != levels.end())
+            level = it->second;
+        else
+            orxout(internal_warning) << "'" << level_name << "' is not a valid output level" << endl;
+
+        OutputContextContainer context = registerContext(context_name);
+
+        orxout(level, context) << text << endl;
+    }
+
+    /// @brief Prints text to the console and the logfile.
+    void log(const std::string& text)
+    { orxout() << text << endl; }
+
+    /// @brief Prints output with error level.
+    void error(const std::string& text)
+    { orxout(user_error) << text << endl; }
+
+    /// @brief Prints output with warning level.
+    void warning(const std::string& text)
+    { orxout(user_warning) << text << endl; }
+
+    /// @brief Prints output with status level.
+    void status(const std::string& text)
+    { orxout(user_status) << text << endl; }
+
+    /// @brief Prints output with info level.
+    void info(const std::string& text)
+    { orxout(user_info) << text << endl; }
+
+    /// @brief Prints debug output with verbose level.
+    void debug(const std::string& text)
+    { orxout(verbose, context::tcl) << text << endl; }
+
+    /**
         @brief Reads the content of a file and executes the commands in it line by line.
     */
@@ -66,5 +170,5 @@
         if (it != executingFiles.end())
         {
-            COUT(1) << "Error: Recurring source command in \"" << filename << "\". Stopped execution." << std::endl;
+            orxout(user_error) << "Recurring source command in \"" << filename << "\". Stopped execution." << endl;
             return;
         }
@@ -76,5 +180,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "Error: Couldn't open file \"" << filename << "\"." << std::endl;
+            orxout(user_error) << "Couldn't open file \"" << filename << "\"." << endl;
             return;
         }
@@ -95,27 +199,4 @@
 
     /**
-        @brief Simply returns the arguments.
-    */
-    std::string echo(const std::string& text)
-    {
-        return text;
-    }
-
-    /**
-        @brief Writes text to the console, depending on the first argument with or without a line-break after it.
-    */
-    void puts(bool newline, const std::string& text)
-    {
-        if (newline)
-        {
-            COUT(0) << stripEnclosingBraces(text) << std::endl;
-        }
-        else
-        {
-            COUT(0) << stripEnclosingBraces(text);
-        }
-    }
-
-    /**
         @brief Writes text to a file.
     */
@@ -127,9 +208,9 @@
         if (!file.is_open())
         {
-            COUT(1) << "Error: Couldn't write to file \"" << filename << "\"." << std::endl;
-            return;
-        }
-
-        file << text << std::endl;
+            orxout(user_error) << "Couldn't write to file \"" << filename << "\"." << endl;
+            return;
+        }
+
+        file << text << endl;
         file.close();
     }
@@ -145,9 +226,9 @@
         if (!file.is_open())
         {
-            COUT(1) << "Error: Couldn't append to file \"" << filename << "\"." << std::endl;
-            return;
-        }
-
-        file << text << std::endl;
+            orxout(user_error) << "Couldn't append to file \"" << filename << "\"." << endl;
+            return;
+        }
+
+        file << text << endl;
         file.close();
     }
@@ -163,5 +244,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "Error: Couldn't read from file \"" << filename << "\"." << std::endl;
+            orxout(user_error) << "Couldn't read from file \"" << filename << "\"." << endl;
             return "";
         }
@@ -192,9 +273,9 @@
             if (expr.getResult() == 42.0)
             {
-                COUT(3) << "Greetings from the restaurant at the end of the universe." << std::endl;
+                orxout(user_info) << "Greetings from the restaurant at the end of the universe." << endl;
             }
             if (!expr.getRemains().empty())
             {
-                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
+                orxout(user_warning) << "Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << endl;
             }
             return static_cast<float>(expr.getResult());
@@ -202,5 +283,5 @@
         else
         {
-            COUT(1) << "Error: Cannot calculate expression: Parse error." << std::endl;
+            orxout(user_error) << "Cannot calculate expression: Parse error." << endl;
             return 0;
         }
Index: code/trunk/src/libraries/core/command/ConsoleCommandCompilation.h
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommandCompilation.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/ConsoleCommandCompilation.h	(revision 8858)
@@ -42,5 +42,14 @@
     _CoreExport void source(const std::string& filename);
     _CoreExport std::string echo(const std::string& text);
-    _CoreExport void puts(bool newline, const std::string& test);
+
+    _CoreExport void orxout_level(const std::string& level_name, const std::string& text);
+    _CoreExport void orxout_level_context(const std::string& level_name, const std::string& context_name, const std::string& text);
+
+    _CoreExport void log(const std::string& text);
+    _CoreExport void error(const std::string& text);
+    _CoreExport void warning(const std::string& text);
+    _CoreExport void status(const std::string& text);
+    _CoreExport void info(const std::string& text);
+    _CoreExport void debug(const std::string& text);
 
     _CoreExport void write(const std::string& filename, const std::string& text);
Index: code/trunk/src/libraries/core/command/Executor.cc
===================================================================
--- code/trunk/src/libraries/core/command/Executor.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/Executor.cc	(revision 8858)
@@ -38,5 +38,5 @@
 
 #include "util/Convert.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/StringUtils.h"
 #include "util/SubString.h"
@@ -104,9 +104,9 @@
         {
             if (bPrintError)
-                COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << std::endl;
+                orxout(internal_warning) << "Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << endl;
             return MT_Type::Null;
         }
 
-        COUT(5) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << std::endl;
+        orxout(verbose, context::misc::executor) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << endl;
 
         // execute the function with the evaluated arguments (the default values of the executor are also included in these arguments)
Index: code/trunk/src/libraries/core/command/Executor.h
===================================================================
--- code/trunk/src/libraries/core/command/Executor.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/Executor.h	(revision 8858)
@@ -57,5 +57,5 @@
     void myFunction(int a, int b)                           // declare a static function
     {
-        COUT(0) << "The sum is " << (a + b) << std::endl;   // print the sum of a and b to the console
+        orxout() << "The sum is " << (a + b) << endl;       // print the sum of a and b to the console
     }
 
Index: code/trunk/src/libraries/core/command/Functor.h
===================================================================
--- code/trunk/src/libraries/core/command/Functor.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/Functor.h	(revision 8858)
@@ -118,5 +118,5 @@
 #include <typeinfo>
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/MultiType.h"
 #include "core/OrxonoxClass.h"
@@ -256,5 +256,5 @@
                 else
                 {
-                    COUT(1) << "Error: Can't execute FunctorMember, no object set." << std::endl;
+                    orxout(internal_error) << "Can't execute FunctorMember, no object set." << endl;
                     return MT_Type::Null;
                 }
@@ -339,5 +339,5 @@
             // see Functor::setRawObjectPointer()
             inline void setRawObjectPointer(void*)
-                { COUT(2) << "Warning: Can't assign an object pointer to a static functor" << std::endl; }
+                { orxout(internal_warning) << "Can't assign an object pointer to a static functor" << endl; }
             // see Functor::getRawObjectPointer()
             inline void* getRawObjectPointer() const
Index: code/trunk/src/libraries/core/command/IOConsolePOSIX.cc
===================================================================
--- code/trunk/src/libraries/core/command/IOConsolePOSIX.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/IOConsolePOSIX.cc	(revision 8858)
@@ -37,4 +37,5 @@
 #include "util/Clock.h"
 #include "util/Math.h"
+#include "util/output/ConsoleWriter.h"
 #include "core/Game.h"
 #include "core/input/InputBuffer.h"
@@ -55,5 +56,5 @@
 
     IOConsole::IOConsole()
-        : shell_(new Shell("IOConsole", false))
+        : shell_(new Shell("Console", false))
         , buffer_(shell_->getInputBuffer())
         , cout_(std::cout.rdbuf())
@@ -74,5 +75,5 @@
 
         // Disable standard std::cout logging
-        OutputHandler::getInstance().disableCout();
+        ConsoleWriter::getInstance().disable();
         // Redirect std::cout to an ostringstream
         // (Other part is in the initialiser list)
@@ -88,5 +89,5 @@
         std::cout.flush();
         if (!this->origCout_.str().empty())
-            this->shell_->addOutput(this->origCout_.str(), Shell::None);
+            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
         // Erase input and status lines
         this->cout_ << "\033[1G\033[J";
@@ -102,5 +103,5 @@
         std::cout.rdbuf(this->cout_.rdbuf());
         // Enable standard std::cout logging again
-        OutputHandler::getInstance().enableCout();
+        ConsoleWriter::getInstance().enable();
     }
 
@@ -229,5 +230,5 @@
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutput(this->origCout_.str(), Shell::None);
+            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
             this->origCout_.str("");
         }
@@ -239,14 +240,25 @@
         switch (type)
         {
-        case Shell::Error:   this->cout_ << "\033[91m"; break;
-        case Shell::Warning: this->cout_ << "\033[93m"; break;
-        case Shell::Info:    this->cout_ << "\033[90m"; break;
-        case Shell::Debug:   this->cout_ << "\033[90m"; break;
-        case Shell::Verbose: this->cout_ << "\033[90m"; break;
-        case Shell::Ultra:   this->cout_ << "\033[90m"; break;
-        case Shell::Command: this->cout_ << "\033[36m"; break;
-        case Shell::Hint:    this->cout_ << "\033[33m"; break;
-        case Shell::TDebug:  this->cout_ << "\033[95m"; break;
-        default: break;
+            case Shell::Message:
+            case Shell::DebugOutput:     this->cout_ << "\033[0m"; break;
+
+            case Shell::UserError:       this->cout_ << "\033[91m"; break;
+            case Shell::UserWarning:     this->cout_ << "\033[93m"; break;
+            case Shell::UserStatus:      this->cout_ << "\033[92m"; break;
+            case Shell::UserInfo:        this->cout_ << "\033[96m"; break;
+
+            case Shell::InternalError:   this->cout_ << "\033[31m"; break;
+            case Shell::InternalWarning: this->cout_ << "\033[33m"; break;
+            case Shell::InternalStatus:  this->cout_ << "\033[32m"; break;
+            case Shell::InternalInfo:    this->cout_ << "\033[36m"; break;
+
+            case Shell::Verbose:         this->cout_ << "\033[94m"; break;
+            case Shell::VerboseMore:     this->cout_ << "\033[34m"; break;
+            case Shell::VerboseUltra:    this->cout_ << "\033[34m"; break;
+
+            case Shell::Command:         this->cout_ << "\033[95m"; break;
+            case Shell::Hint:            this->cout_ << "\033[35m"; break;
+
+            default:                     this->cout_ << "\033[37m"; break;
         }
 
@@ -371,5 +383,5 @@
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     }
 
@@ -378,18 +390,4 @@
     {
         // Exit is not an option, just do nothing (Shell doesn't really exit too)
-    }
-
-    //! Called if only the last output-line has changed
-    void IOConsole::onlyLastLineChanged()
-    {
-        // Save cursor position and move it to the beginning of the first output line
-        this->cout_ << "\033[s\033[1A\033[1G";
-        // Erase the line
-        this->cout_ << "\033[K";
-        // Reprint the last output line
-        this->printOutputLine(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second);
-        // Restore cursor
-        this->cout_ << "\033[u";
-        this->cout_.flush();
     }
 
Index: code/trunk/src/libraries/core/command/IOConsolePOSIX.h
===================================================================
--- code/trunk/src/libraries/core/command/IOConsolePOSIX.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/IOConsolePOSIX.h	(revision 8858)
@@ -66,5 +66,4 @@
         // Methods from ShellListener
         void linesChanged();
-        void onlyLastLineChanged();
         void lineAdded();
         void inputChanged();
Index: code/trunk/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/trunk/src/libraries/core/command/IOConsoleWindows.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/IOConsoleWindows.cc	(revision 8858)
@@ -34,4 +34,5 @@
 #include "util/Clock.h"
 #include "util/Math.h"
+#include "util/output/ConsoleWriter.h"
 #include "core/Game.h"
 #include "core/input/InputBuffer.h"
@@ -43,5 +44,5 @@
     //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode
     IOConsole::IOConsole()
-        : shell_(new Shell("IOConsole", false))
+        : shell_(new Shell("Console", false))
         , buffer_(shell_->getInputBuffer())
         , cout_(std::cout.rdbuf())
@@ -52,5 +53,5 @@
     {
         // Disable standard this->cout_ logging
-        OutputHandler::getInstance().disableCout();
+        ConsoleWriter::getInstance().disable();
         // Redirect std::cout to an ostringstream
         // (Other part is in the initialiser list)
@@ -95,5 +96,5 @@
         std::cout.flush();
         if (!this->origCout_.str().empty())
-            this->shell_->addOutput(this->origCout_.str(), Shell::None);
+            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
 
         this->shell_->unregisterListener(this);
@@ -108,5 +109,5 @@
         std::cout.rdbuf(this->cout_.rdbuf());
         // Enable standard this->cout_ logging again
-        OutputHandler::getInstance().enableCout();
+        ConsoleWriter::getInstance().enable();
 
         resetTerminalMode();
@@ -188,5 +189,5 @@
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutput(this->origCout_.str(), Shell::None);
+            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
             this->origCout_.str("");
         }
@@ -200,14 +201,25 @@
         switch (type)
         {
-        case Shell::Error:   colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED; break;
-        case Shell::Warning: colour = FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED; break;
-        case Shell::Info:
-        case Shell::Debug:
-        case Shell::Verbose:
-        case Shell::Ultra:   colour = FOREGROUND_INTENSITY                                     ; break;
-        case Shell::Command: colour =                        FOREGROUND_GREEN                  | FOREGROUND_BLUE; break;
-        case Shell::Hint:    colour =                        FOREGROUND_GREEN | FOREGROUND_RED                  ; break;
-        case Shell::TDebug:  colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED | FOREGROUND_BLUE; break;
-        default:             colour =                        FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break;
+            case Shell::Message:
+            case Shell::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+
+            case Shell::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
+            case Shell::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
+            case Shell::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
+            case Shell::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+
+            case Shell::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
+            case Shell::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
+            case Shell::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
+            case Shell::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+
+            case Shell::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+            case Shell::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+            case Shell::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+
+            case Shell::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
+            case Shell::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
+
+            default:                     colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
         }
 
@@ -238,5 +250,5 @@
             || !SetConsoleMode(this->stdInHandle_, 0))
         {
-            COUT(1) << "Error: Could not set Windows console settings" << std::endl;
+            orxout(user_error) << "Could not set Windows console settings" << endl;
             return;
         }
@@ -318,5 +330,5 @@
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     }
 
@@ -377,18 +389,4 @@
     }
 
-    //! Called if only the last output-line has changed
-    void IOConsole::onlyLastLineChanged()
-    {
-        int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;
-        // Compute the number of new lines needed
-        int newLines = newLineHeight - this->lastOutputLineHeight_;
-        this->lastOutputLineHeight_ = newLineHeight;
-        // Scroll console if necessary
-        if (newLines > 0) // newLines < 0 is assumed impossible
-            this->createNewOutputLines(newLines);
-        Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
-        this->printOutputLine(it->first, it->second, makeCOORD(0, this->inputLineRow_ - newLineHeight));
-    }
-
     //! Called if a new output line was added
     void IOConsole::lineAdded()
Index: code/trunk/src/libraries/core/command/IOConsoleWindows.h
===================================================================
--- code/trunk/src/libraries/core/command/IOConsoleWindows.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/IOConsoleWindows.h	(revision 8858)
@@ -68,5 +68,4 @@
         // Methods from ShellListener
         void linesChanged();
-        void onlyLastLineChanged();
         void lineAdded();
         void inputChanged();
Index: code/trunk/src/libraries/core/command/IRC.cc
===================================================================
--- code/trunk/src/libraries/core/command/IRC.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/IRC.cc	(revision 8858)
@@ -85,5 +85,5 @@
         }
         catch (Tcl::tcl_error const &e)
-        {   COUT(1) << "Tcl (IRC) error: " << e.what();   }
+        {   orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl;   }
 
         this->nickname_ = "orx" + multi_cast<std::string>(static_cast<unsigned int>(rand()));
@@ -100,5 +100,5 @@
         {
             IRC::getInstance().initialize();
-            COUT(1) << "Error: IRC client wasn't yet initialized, please try again." << std::endl;
+            orxout(user_error) << "IRC client wasn't yet initialized, please try again." << endl;
             return false;
         }
@@ -110,5 +110,5 @@
         }
         catch (Tcl::tcl_error const &e)
-        {   COUT(1) << "Tcl (IRC) error: " << e.what();   }
+        {   orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl;   }
 
         return false;
@@ -139,5 +139,5 @@
     void IRC::tcl_say(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
     {
-        COUT(0) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
+        orxout(message) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
     }
 
@@ -145,5 +145,5 @@
     void IRC::tcl_privmsg(Tcl::object const &query, Tcl::object const &nick, Tcl::object const &args)
     {
-        COUT(0) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
+        orxout(message) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
     }
 
@@ -151,5 +151,5 @@
     void IRC::tcl_action(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
     {
-        COUT(0) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << std::endl;
+        orxout(message) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << endl;
     }
 
@@ -157,5 +157,5 @@
     void IRC::tcl_info(Tcl::object const &channel, Tcl::object const &args)
     {
-        COUT(0) << "IRC> --> " << stripEnclosingBraces(args.get()) << std::endl;
+        orxout(message) << "IRC> --> " << stripEnclosingBraces(args.get()) << endl;
     }
 }
Index: code/trunk/src/libraries/core/command/Shell.cc
===================================================================
--- code/trunk/src/libraries/core/command/Shell.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/Shell.cc	(revision 8858)
@@ -35,7 +35,8 @@
 
 #include "util/Math.h"
-#include "util/OutputHandler.h"
 #include "util/StringUtils.h"
 #include "util/SubString.h"
+#include "util/output/OutputManager.h"
+#include "util/output/MemoryWriter.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigFileManager.h"
@@ -44,28 +45,28 @@
 #include "core/input/InputBuffer.h"
 #include "CommandExecutor.h"
-#include "ConsoleCommand.h"
 
 namespace orxonox
 {
-    SetConsoleCommand("log",     OutputHandler::log    );
-    SetConsoleCommand("error",   OutputHandler::error  ).hide();
-    SetConsoleCommand("warning", OutputHandler::warning).hide();
-    SetConsoleCommand("info",    OutputHandler::info   ).hide();
-    SetConsoleCommand("debug",   OutputHandler::debug  ).hide();
-
     unsigned int Shell::cacheSize_s;
 
-    /**
-        @brief Constructor: Initializes the values and registers itself at OutputHandler.
+    namespace DefaultLogLevel
+    {
+        const OutputLevel Dev  = level::internal_warning;
+        const OutputLevel User = level::user_info;
+    }
+
+    /**
+        @brief Constructor: Initializes the values.
         @param consoleName The name of the shell - used to define the name of the soft-debug-level config-value
         @param bScrollable If true, the user is allowed to scroll through the output-lines
     */
     Shell::Shell(const std::string& consoleName, bool bScrollable)
-        : OutputListener(consoleName)
+        : BaseWriter(consoleName, false)
         , inputBuffer_(new InputBuffer())
-        , consoleName_(consoleName)
         , bScrollable_(bScrollable)
     {
         RegisterRootObject(Shell);
+
+        OutputManager::getInstance().registerListener(this);
 
         this->scrollPosition_ = 0;
@@ -73,5 +74,4 @@
         this->historyPosition_ = 0;
         this->historyOffset_ = 0;
-        this->bFinishedLastLine_ = true;
 
         this->clearOutput();
@@ -81,38 +81,22 @@
         ConfigFileManager::getInstance().setFilename(ConfigFileType::CommandHistory, "commandHistory.ini");
 
-        // Use a stringstream object to buffer the output
-        this->outputStream_ = &this->outputBuffer_;
+        // Choose the default level according to the path Orxonox was started (build directory or not)
+        OutputLevel defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User);
+        this->setLevelMax(defaultDebugLevel);
 
         this->setConfigValues();
 
         // Get the previous output and add it to the Shell
-        OutputHandler::OutputVector::const_iterator it = OutputHandler::getInstance().getOutput().begin();
-        for (;it != OutputHandler::getInstance().getOutput().end(); ++it)
-        {
-            if (it->first <= debugLevel_)
-            {
-                this->outputBuffer_ << it->second;
-                this->outputChanged(it->first);
-            }
-        }
-
-        // Register the shell as output listener
-        OutputHandler::getInstance().registerOutputListener(this);
-        OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_);
-    }
-
-    /**
-        @brief Destructor: Unregisters the shell from OutputHandler.
+        MemoryWriter::getInstance().resendOutput(this);
+    }
+
+    /**
+        @brief Destructor
     */
     Shell::~Shell()
     {
-        OutputHandler::getInstance().unregisterOutputListener(this);
         this->inputBuffer_->destroy();
-    }
-
-    namespace DefaultLogLevel
-    {
-        const OutputLevel::Value Dev  = OutputLevel::Info;
-        const OutputLevel::Value User = OutputLevel::Error;
+
+        OutputManager::getInstance().unregisterListener(this);
     }
 
@@ -129,9 +113,22 @@
         SetConfigValue(cacheSize_s, 32);
 
-        // Choose the default level according to the path Orxonox was started (build directory or not)
-        OutputLevel::Value defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User);
-        SetConfigValueExternal(debugLevel_, "OutputHandler", "debugLevel" + consoleName_, defaultDebugLevel)
-            .description("The maximum level of debug output shown in the " + consoleName_);
-        OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_);
+        SetConfigValueExternal(this->configurableMaxLevel_,
+                               this->getConfigurableSectionName(),
+                               this->getConfigurableMaxLevelName(),
+                               this->configurableMaxLevel_)
+            .description("The maximum level of output shown in the " + this->getName())
+            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevel);
+        SetConfigValueExternal(this->configurableAdditionalContextsMaxLevel_,
+                               this->getConfigurableSectionName(),
+                               this->getConfigurableAdditionalContextsMaxLevelName(),
+                               this->configurableAdditionalContextsMaxLevel_)
+            .description("The maximum level of output shown in the " + this->getName() + " for additional contexts")
+            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContextsLevel);
+        SetConfigValueExternal(this->configurableAdditionalContexts_,
+                               this->getConfigurableSectionName(),
+                               this->getConfigurableAdditionalContextsName(),
+                               this->configurableAdditionalContexts_)
+            .description("Additional output contexts shown in the " + this->getName())
+            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContexts);
     }
 
@@ -168,10 +165,10 @@
         if (isNormal)
         {
-            ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, update);
+            ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), update);
         }
         else
         {
-            OutputLevel::Value level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User);
-            ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, tset, level);
+            OutputLevel level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User);
+            ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), tset, level);
         }
     }
@@ -252,10 +249,31 @@
 
     /**
-        @brief Sends output to the internal output buffer.
+        @brief Adds multiple lines to the internal output buffer.
     */
     void Shell::addOutput(const std::string& text, LineType type)
     {
-        this->outputBuffer_ << text;
-        this->outputChanged(type);
+        std::vector<std::string> lines;
+        vectorize(text, '\n', &lines);
+
+        for (size_t i = 0; i < lines.size(); ++i)
+            this->addLine(lines[i], type);
+    }
+
+    /**
+        @brief Adds a line to the internal output buffer.
+    */
+    void Shell::addLine(const std::string& line, LineType type)
+    {
+        // yes it was - push the new line to the list
+        this->outputLines_.push_front(std::make_pair(line, static_cast<LineType>(type)));
+
+        // adjust the scroll position if needed
+        if (this->scrollPosition_)
+            this->scrollPosition_++;
+        else
+            this->scrollIterator_ = this->outputLines_.begin();
+
+        if (!this->scrollPosition_)
+            this->updateListeners<&ShellListener::lineAdded>();
     }
 
@@ -269,7 +287,14 @@
 
         this->scrollPosition_ = 0;
-        this->bFinishedLastLine_ = true;
 
         this->updateListeners<&ShellListener::linesChanged>();
+    }
+
+    /**
+        @brief Inherited from BaseWriter (LogListener), called if a new line of output was sent.
+    */
+    void Shell::printLine(const std::string& line, OutputLevel level)
+    {
+        this->addLine(line, static_cast<LineType>(level));
     }
 
@@ -323,59 +348,4 @@
 
     /**
-        @brief Called by OutputHandler or internally whenever output was sent to the output buffer. Reads from the buffer and writes the new output-lines to the list.
-    */
-    void Shell::outputChanged(int lineType)
-    {
-        bool newline = false;
-        do
-        {
-            // get the first line from the buffer
-            std::string output;
-            std::getline(this->outputBuffer_, output);
-
-            // check the state of the buffer
-            bool eof = this->outputBuffer_.eof();
-            bool fail = this->outputBuffer_.fail();
-            if (eof)
-                this->outputBuffer_.flush(); // check if more output was received in the meantime
-            if (eof || fail)
-                this->outputBuffer_.clear(); // clear the error flags
-
-            // the line is terminated with a line-break if neither an error occurred nor the end of the file was reached
-            newline = (!eof && !fail);
-
-            // no output retrieved - break the loop
-            if (!newline && output.empty())
-                break;
-
-            // check if the last line was terminated with a line-break
-            if (this->bFinishedLastLine_)
-            {
-                // yes it was - push the new line to the list
-                this->outputLines_.push_front(std::make_pair(output, static_cast<LineType>(lineType)));
-
-                // adjust the scroll position if needed
-                if (this->scrollPosition_)
-                    this->scrollPosition_++;
-                else
-                    this->scrollIterator_ = this->outputLines_.begin();
-
-                if (!this->scrollPosition_)
-                    this->updateListeners<&ShellListener::lineAdded>();
-            }
-            else
-            {
-                // no it wasn't - add the new output to the last line
-                this->outputLines_.front().first += output;
-                this->updateListeners<&ShellListener::onlyLastLineChanged>();
-            }
-
-            // remember if the last line was terminated with a line-break
-            this->bFinishedLastLine_ = newline;
-
-        } while (newline); // loop as long as more lines are in the buffer
-    }
-
-    /**
         @brief Clears the text in the input buffer.
     */
@@ -409,19 +379,7 @@
         const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &error);
         if (error)
-        {
-            switch (error)
-            {
-                case CommandExecutor::Error:       this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command doesn't exist. (S)" << std::endl; break;
-                case CommandExecutor::Incomplete:  this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", not enough arguments given. (S)" << std::endl; break;
-                case CommandExecutor::Deactivated: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command is not active. (S)" << std::endl; break;
-                case CommandExecutor::Denied:      this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", access denied. (S)" << std::endl; break;
-            }
-            this->outputChanged(Error);
-        }
+            this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", UserError);
         else if (result != "")
-        {
-            this->outputBuffer_ << result << std::endl;
-            this->outputChanged(Command);
-        }
+            this->addOutput(result, Result);
 
         this->clearInput();
@@ -432,6 +390,5 @@
     {
         this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete());
-        this->outputBuffer_ << CommandExecutor::evaluate(this->inputBuffer_->get()).hint() << std::endl;
-        this->outputChanged(Hint);
+        this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), Hint);
 
         this->inputChanged();
Index: code/trunk/src/libraries/core/command/Shell.h
===================================================================
--- code/trunk/src/libraries/core/command/Shell.h	(revision 8729)
+++ code/trunk/src/libraries/core/command/Shell.h	(revision 8858)
@@ -48,5 +48,5 @@
 #include <vector>
 
-#include "util/OutputHandler.h"
+#include "util/output/BaseWriter.h"
 #include "core/Core.h"
 #include "core/OrxonoxClass.h"
@@ -66,5 +66,4 @@
         private:
             virtual void linesChanged() {}          ///< Called if all output-lines have changed
-            virtual void onlyLastLineChanged() {}   ///< Called if only the last output-line has changed
             virtual void lineAdded() {}             ///< Called if a new line was added to the output
             virtual void inputChanged() {}          ///< Called if the input has changed
@@ -78,5 +77,5 @@
         @brief The Shell is the logical component of the console that displays output to the user and allows him to enter commands.
 
-        The Shell gathers output sent from OutputHandler by inheriting from OutputListener.
+        The Shell gathers output sent from OutputManager by inheriting from BaseWriter.
         The output-lines are stored in the shell, so they can be displayed in a graphical
         console. Additionally the Shell has an InputBuffer which is needed by the user to
@@ -85,5 +84,5 @@
         Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole.
     */
-    class _CoreExport Shell : public OutputListener, public DevModeListener
+    class _CoreExport Shell : public BaseWriter, public DevModeListener
     {
         public:
@@ -91,14 +90,21 @@
             enum LineType
             {
-                TDebug  = OutputLevel::TDebug,
-                None    = OutputLevel::None,
-                Warning = OutputLevel::Warning,
-                Error   = OutputLevel::Error,
-                Info    = OutputLevel::Info,
-                Debug   = OutputLevel::Debug,
-                Verbose = OutputLevel::Verbose,
-                Ultra   = OutputLevel::Ultra,
+                DebugOutput     = debug_output,
+                Message         = message,
+                UserError       = user_error,
+                UserWarning     = user_warning,
+                UserStatus      = user_status,
+                UserInfo        = user_info,
+                InternalError   = internal_error,
+                InternalWarning = internal_warning,
+                InternalStatus  = internal_status,
+                InternalInfo    = internal_info,
+                Verbose         = verbose,
+                VerboseMore     = verbose_more,
+                VerboseUltra    = verbose_ultra,
+                Cout,
                 Input,
                 Command,
+                Result,
                 Hint
             };
@@ -127,5 +133,6 @@
             LineList::const_iterator getEndIterator() const;
 
-            void addOutput(const std::string& text, LineType type = None);
+            void addOutput(const std::string& text, LineType type = DebugOutput);
+            void addLine(const std::string& line, LineType type = DebugOutput);
             void clearOutput();
 
@@ -150,6 +157,6 @@
             const std::string& getFromHistory() const;
             void clearInput();
-            // OutputListener
-            void outputChanged(int level);
+            // BaseWriter
+            virtual void printLine(const std::string& line, OutputLevel level);
 
             void configureInputBuffer();
@@ -183,12 +190,8 @@
             std::list<ShellListener*> listeners_;           ///< The registered shell listeners
             InputBuffer*              inputBuffer_;         ///< The input buffer that is needed by the user to enter text
-            std::stringstream         outputBuffer_;        ///< The output buffer that is used to retrieve lines of output from OutputListener
-            bool                      bFinishedLastLine_;   ///< Stores if the most recent output-line was terminated with a line-break or if more output is expected for this line
             LineList                  outputLines_;         ///< A list of all output-lines that were displayed in the shell so far
             LineList::const_iterator  scrollIterator_;      ///< An iterator to an entry of the list of output-lines, changes if the user scrolls through the output in the shell
             unsigned int              scrollPosition_;      ///< The number of the line that is currently being referenced by scrollIterator_
             unsigned int              historyPosition_;     ///< If the user scrolls through the history of entered commands (stored in commandHistory_), this contains the currently viewed history entry
-
-            const std::string         consoleName_;         ///< The name of this shell - used to define the name of the soft-debug-level config-value
             const bool                bScrollable_;         ///< If true, the user can scroll through the output-lines
 
@@ -197,5 +200,4 @@
             unsigned int              historyOffset_;       ///< The command history is a circular buffer, this variable defines the current write-offset
             std::vector<std::string>  commandHistory_;      ///< The history of commands that were entered by the user
-            int                       debugLevel_;          //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)
             static unsigned int       cacheSize_s;          ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass
     };
Index: code/trunk/src/libraries/core/command/TclBind.cc
===================================================================
--- code/trunk/src/libraries/core/command/TclBind.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/TclBind.cc	(revision 8858)
@@ -34,5 +34,5 @@
 
 #include "SpecialConfig.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/StringUtils.h"
@@ -106,5 +106,5 @@
             }
             catch (Tcl::tcl_error const &e)
-            {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl;   }
+            {   orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;   }
         }
     }
@@ -129,5 +129,8 @@
         }
         catch (Tcl::tcl_error const &e)
-        {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
+        {
+            orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;
+            orxout(user_error, context::tcl) << "Tcl isn't properly initialized. Orxonox might possibly not work like that." << endl;
+        }
 
         return interpreter;
@@ -154,5 +157,5 @@
     std::string TclBind::tcl_query(Tcl::object const &args)
     {
-        COUT(4) << "Tcl_query: " << args.get() << std::endl;
+        orxout(verbose, context::commands) << "Tcl_query: " << args.get() << endl;
         return TclBind::tcl_helper(args, true);
     }
@@ -163,5 +166,5 @@
     void TclBind::tcl_execute(Tcl::object const &args)
     {
-        COUT(4) << "Tcl_execute: " << args.get() << std::endl;
+        orxout(verbose, context::commands) << "Tcl_execute: " << args.get() << endl;
         TclBind::tcl_helper(args, false);
     }
@@ -184,14 +187,10 @@
             error = evaluation.execute();
 
-        switch (error)
-        {
-            case CommandExecutor::Error:       COUT(1) << "Error: Can't execute command \"" << command << "\", command doesn't exist. (B)" << std::endl; break;
-            case CommandExecutor::Incomplete:  COUT(1) << "Error: Can't execute command \"" << command << "\", not enough arguments given. (B)" << std::endl; break;
-            case CommandExecutor::Deactivated: COUT(1) << "Error: Can't execute command \"" << command << "\", command is not active. (B)" << std::endl; break;
-            case CommandExecutor::Denied:      COUT(1) << "Error: Can't execute command \"" << command << "\", access denied. (B)" << std::endl; break;
-        }
-
-        if (error == CommandExecutor::Error)
-            COUT(3) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << std::endl;
+        if (error)
+        {
+            orxout(user_error) << "Can't execute command \"" << command << "\", " + CommandExecutor::getErrorDescription(error) + ". (TclBind)" << endl;
+            if (error == CommandExecutor::Inexistent)
+                orxout(user_info) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << endl;
+        }
 
         return result;
@@ -211,5 +210,5 @@
             }
             catch (Tcl::tcl_error const &e)
-            {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
+            {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
         }
 
@@ -223,5 +222,5 @@
     void TclBind::bgerror(const std::string& error)
     {
-        COUT(1) << "Tcl background error: " << stripEnclosingBraces(error) << std::endl;
+        orxout(user_error, context::tcl) << "Tcl background error: " << stripEnclosingBraces(error) << endl;
     }
 
@@ -243,5 +242,5 @@
         }
         catch (Tcl::tcl_error const &e)
-        {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
+        {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
 
         if (error)
Index: code/trunk/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/trunk/src/libraries/core/command/TclThreadManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/command/TclThreadManager.cc	(revision 8858)
@@ -225,5 +225,5 @@
         TclThreadManager::getInstance().numInterpreterBundles_++;
         TclThreadManager::createWithId(TclThreadManager::getInstance().numInterpreterBundles_);
-        COUT(0) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << std::endl;
+        orxout(user_info) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << endl;
         return TclThreadManager::getInstance().numInterpreterBundles_;
     }
@@ -288,5 +288,8 @@
         }
         catch (const Tcl::tcl_error& e)
-        {   bundle->interpreter_ = 0; COUT(1) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << std::endl;   }
+        {
+            bundle->interpreter_ = 0;
+            orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl;
+        }
     }
 
@@ -407,5 +410,5 @@
             {
                 // This query would lead to a deadlock - return with an error
-                TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
+                TclThreadManager::error("Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
                             + " -> " + multi_cast<std::string>(target_bundle->id_) \
                             + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \
@@ -446,11 +449,6 @@
                         int error;
                         output = CommandExecutor::query(command, &error, false);
-                        switch (error)
-                        {
-                            case CommandExecutor::Error:       TclThreadManager::error("Error: Can't execute command \"" + command + "\", command doesn't exist. (T)"); break;
-                            case CommandExecutor::Incomplete:  TclThreadManager::error("Error: Can't execute command \"" + command + "\", not enough arguments given. (T)"); break;
-                            case CommandExecutor::Deactivated: TclThreadManager::error("Error: Can't execute command \"" + command + "\", command is not active. (T)"); break;
-                            case CommandExecutor::Denied:      TclThreadManager::error("Error: Can't execute command \"" + command + "\", access denied. (T)"); break;
-                        }
+                        if (error)
+                            TclThreadManager::error("Can't execute command \"" + command + "\", " + CommandExecutor::getErrorDescription(error) + ". (TclThreadManager)");
                     }
                     else
@@ -476,5 +474,5 @@
                     // This happens if the main thread tries to query a busy interpreter
                     // To avoid a lock of the main thread, we simply don't proceed with the query in this case
-                    TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
+                    TclThreadManager::error("Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
                 }
             }
@@ -522,5 +520,5 @@
         else
         {
-            TclThreadManager::error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
+            TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
             return 0;
         }
Index: code/trunk/src/libraries/core/input/Button.cc
===================================================================
--- code/trunk/src/libraries/core/input/Button.cc	(revision 8729)
+++ code/trunk/src/libraries/core/input/Button.cc	(revision 8858)
@@ -38,5 +38,5 @@
 #include "util/SubString.h"
 #include "util/StringUtils.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "core/command/ConsoleCommand.h"
 #include "core/command/CommandEvaluation.h"
@@ -255,11 +255,11 @@
         if (serious)
         {
-            COUT(2) << "Error while parsing binding for button/axis " << this->name_ << ". "
-                << message << std::endl;
+            orxout(internal_error, context::input) << "Error while parsing binding for button/axis " << this->name_ << ". "
+                << message << endl;
         }
         else
         {
-            COUT(3) << "Warning while parsing binding for button/axis " << this->name_ << ". "
-                << message << std::endl;
+            orxout(internal_warning, context::input) << "Warning while parsing binding for button/axis " << this->name_ << ". "
+                << message << endl;
         }
     }
Index: code/trunk/src/libraries/core/input/InputDevice.h
===================================================================
--- code/trunk/src/libraries/core/input/InputDevice.h	(revision 8729)
+++ code/trunk/src/libraries/core/input/InputDevice.h	(revision 8858)
@@ -43,5 +43,5 @@
 
 #include "util/Clock.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "InputState.h"
@@ -135,5 +135,5 @@
             //       invalid right until the subclass has been constructed!
             oisDevice_->setEventCallback(static_cast<DeviceClass*>(this));
-            COUT(4) << "Instantiated a " << this->getClassName() << std::endl;
+            orxout(verbose, context::input) << "Instantiated a " << this->getClassName() << endl;
         }
 
@@ -147,6 +147,6 @@
             catch (const OIS::Exception& ex)
             {
-                COUT(1) << this->getClassName() << " destruction failed: " << ex.eText << std::endl
-                        << "    Potential resource leak!" << std::endl;
+                orxout(internal_error, context::input) << this->getClassName() << " destruction failed: " << ex.eText << '\n'
+                                                       << "Potential resource leak!" << endl;
             }
         }
Index: code/trunk/src/libraries/core/input/InputManager.cc
===================================================================
--- code/trunk/src/libraries/core/input/InputManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/input/InputManager.cc	(revision 8858)
@@ -100,5 +100,5 @@
         RegisterRootObject(InputManager);
 
-        CCOUT(4) << "Constructing..." << std::endl;
+        orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
 
         // Allocate space for the function call buffer
@@ -128,5 +128,5 @@
         ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
 
-        CCOUT(4) << "Construction complete." << std::endl;
+        orxout(internal_status, context::input) << "InputManager: Construction complete." << endl;
         internalState_ = Nothing;
     }
@@ -143,5 +143,5 @@
     void InputManager::loadDevices()
     {
-        CCOUT(4) << "Loading input devices..." << std::endl;
+        orxout(verbose, context::input) << "InputManager: Loading input devices..." << endl;
 
         // When loading the devices they should not already be loaded
@@ -196,5 +196,5 @@
             // Exception-safety
             Loki::ScopeGuard guard = Loki::MakeGuard(OIS::InputManager::destroyInputSystem, oisInputManager_);
-            CCOUT(4) << "Created OIS input manager." << std::endl;
+            orxout(verbose, context::input) << "Created OIS input manager." << endl;
 
             if (oisInputManager_->getNumberOfDevices(OIS::OISKeyboard) > 0)
@@ -219,5 +219,5 @@
         this->updateActiveStates();
 
-        CCOUT(4) << "Input devices loaded." << std::endl;
+        orxout(verbose, context::input) << "Input devices loaded." << endl;
     }
 
@@ -233,10 +233,10 @@
             catch (const std::exception& ex)
             {
-                CCOUT(2) << "Warning: Failed to create Mouse:" << ex.what() << std::endl
-                         << "Proceeding without mouse support." << std::endl;
-            }
-        }
-        else
-            CCOUT(2) << "Warning: No mouse found! Proceeding without mouse support." << std::endl;
+                orxout(user_warning, context::input) << "Failed to create Mouse:" << ex.what() << '\n'
+                                                     << "Proceeding without mouse support." << endl;
+            }
+        }
+        else
+            orxout(user_warning, context::input) << "No mouse found! Proceeding without mouse support." << endl;
     }
 
@@ -252,5 +252,5 @@
             catch (const std::exception& ex)
             {
-                CCOUT(2) << "Warning: Failed to create joy stick: " << ex.what() << std::endl;
+                orxout(user_warning, context::input) << "Failed to create joy stick: " << ex.what() << endl;
             }
         }
@@ -270,5 +270,5 @@
     InputManager::~InputManager()
     {
-        CCOUT(3) << "Destroying..." << std::endl;
+        orxout(internal_status, context::input) << "InputManager: Destroying..." << endl;
 
         // Leave all active InputStates (except "empty")
@@ -295,5 +295,5 @@
         ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
 
-        CCOUT(3) << "Destruction complete." << std::endl;
+        orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl;
     }
 
@@ -306,5 +306,5 @@
     void InputManager::destroyDevices()
     {
-        CCOUT(4) << "Destroying devices..." << std::endl;
+        orxout(verbose, context::input) << "InputManager: Destroying devices..." << endl;
 
         BOOST_FOREACH(InputDevice*& device, devices_)
@@ -315,5 +315,5 @@
             delete device;
             device = 0;
-            CCOUT(4) << className << " destroyed." << std::endl;
+            orxout(verbose, context::input) << className << " destroyed." << endl;
         }
         devices_.resize(InputDeviceEnumerator::FirstJoyStick);
@@ -326,11 +326,11 @@
         catch (const OIS::Exception& ex)
         {
-            COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl
-                    << "    Potential resource leak!" << std::endl;
+            orxout(internal_error, context::input) << "OIS::InputManager destruction failed" << ex.eText << '\n'
+                                                   << "Potential resource leak!" << endl;
         }
         oisInputManager_ = NULL;
 
         internalState_ |= Bad;
-        CCOUT(4) << "Destroyed devices." << std::endl;
+        orxout(verbose, context::input) << "Destroyed devices." << endl;
     }
 
@@ -343,5 +343,5 @@
     {
         if (internalState_ & Calibrating)
-            CCOUT(2) << "Warning: Cannot reload input system. Joy sticks are currently being calibrated." << std::endl;
+            orxout(internal_warning, context::input) << "Cannot reload input system. Joy sticks are currently being calibrated." << endl;
         else
             reloadInternal();
@@ -351,5 +351,5 @@
     void InputManager::reloadInternal()
     {
-        CCOUT(4) << "Reloading ..." << std::endl;
+        orxout(verbose, context::input) << "InputManager: Reloading ..." << endl;
 
         this->destroyDevices();
@@ -357,5 +357,5 @@
 
         internalState_ &= ~Bad;
-        CCOUT(4) << "Reloading complete." << std::endl;
+        orxout(verbose, context::input) << "InputManager: Reloading complete." << endl;
     }
 
@@ -471,6 +471,6 @@
     void InputManager::calibrate()
     {
-        COUT(0) << "Move all joy stick axes fully in all directions." << std::endl
-                << "When done, put the axex in the middle position and press enter." << std::endl;
+        orxout(message) << "Move all joy stick axes fully in all directions." << '\n'
+                        << "When done, put the axex in the middle position and press enter." << endl;
 
         BOOST_FOREACH(InputDevice* device, devices_)
@@ -495,5 +495,5 @@
         this->clearBuffers();
 
-        COUT(0) << "Calibration has been stored." << std::endl;
+        orxout(message) << "Calibration has been stored." << endl;
     }
 
@@ -535,6 +535,6 @@
                     if (it->second->getPriority() == priority)
                     {
-                        COUT(2) << "Warning: Could not add an InputState with the same priority '"
-                            << static_cast<int>(priority) << "' != 0." << std::endl;
+                        orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '"
+                            << static_cast<int>(priority) << "' != 0." << endl;
                         return 0;
                     }
@@ -548,5 +548,5 @@
         else
         {
-            COUT(2) << "Warning: Could not add an InputState with the same name '" << name << "'." << std::endl;
+            orxout(internal_warning, context::input) << "Could not add an InputState with the same name '" << name << "'." << endl;
             return 0;
         }
@@ -598,5 +598,5 @@
         if (name == "empty")
         {
-            COUT(2) << "InputManager: Leaving the empty state is not allowed!" << std::endl;
+            orxout(internal_warning, context::input) << "InputManager: Leaving the empty state is not allowed!" << endl;
             return false;
         }
@@ -623,5 +623,5 @@
         if (name == "empty")
         {
-            COUT(2) << "InputManager: Removing the empty state is not allowed!" << std::endl;
+            orxout(internal_warning, context::input) << "InputManager: Removing the empty state is not allowed!" << endl;
             return false;
         }
@@ -649,5 +649,5 @@
         if (name == "empty")
         {
-            COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl;
+            orxout(internal_warning, context::input) << "InputManager: Changing the empty state is not allowed!" << endl;
             return false;
         }
Index: code/trunk/src/libraries/core/input/JoyStick.cc
===================================================================
--- code/trunk/src/libraries/core/input/JoyStick.cc	(revision 8729)
+++ code/trunk/src/libraries/core/input/JoyStick.cc	(revision 8858)
@@ -80,5 +80,5 @@
         }
 
-        COUT(4) << "Created OIS joy stick with ID " << deviceName_ << std::endl;
+        orxout(verbose, context::input) << "Created OIS joy stick with ID " << deviceName_ << endl;
 
         // Load calibration
Index: code/trunk/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.cc	(revision 8729)
+++ code/trunk/src/libraries/core/input/KeyBinder.cc	(revision 8858)
@@ -32,5 +32,5 @@
 #include <sstream>
 #include "util/Convert.h"
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "core/ConfigValueIncludes.h"
@@ -251,5 +251,5 @@
     void KeyBinder::loadBindings()
     {
-        COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
+        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings..." << endl;
 
         this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun());
@@ -277,5 +277,5 @@
         }
 
-        COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
+        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl;
     }
 
@@ -294,5 +294,5 @@
         else
         {
-            COUT(2) << "Could not find key/button/axis with name '" << name << "'." << std::endl;
+            orxout(internal_warning, context::input) << "Could not find key/button/axis with name '" << name << "'." << endl;
             return false;
         }
Index: code/trunk/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinderManager.cc	(revision 8729)
+++ code/trunk/src/libraries/core/input/KeyBinderManager.cc	(revision 8858)
@@ -29,5 +29,5 @@
 #include "KeyBinderManager.h"
 
-#include "util/Debug.h"
+#include "util/Output.h"
 #include "util/Exception.h"
 #include "util/ScopedSingletonManager.h"
@@ -168,5 +168,5 @@
         if (!this->bBinding_)
         {
-            COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
+            orxout(message) << "Press any button/key or move a mouse/joystick axis" << endl;
             KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this));
             InputManager::getInstance().enterState("detector");
@@ -185,9 +185,9 @@
             if (keyName == "Keys.KeyEscape")
             {
-                COUT(0) << "Keybinding aborted." << std::endl;
+                orxout(message) << "Keybinding aborted." << endl;
             }
             else
             {
-                COUT(0) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << std::endl;
+                orxout(message) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << endl;
                 this->currentBinder_->setBinding(command_, keyName, bTemporary_);
             }
