Index: /code/branches/output/src/libraries/core/Core.cc
===================================================================
--- /code/branches/output/src/libraries/core/Core.cc	(revision 8795)
+++ /code/branches/output/src/libraries/core/Core.cc	(revision 8796)
@@ -51,7 +51,10 @@
 #endif
 
+#include <boost/preprocessor/stringize.hpp>
+
 #include "util/Clock.h"
 #include "util/Output.h"
 #include "util/Exception.h"
+#include "util/output/LogWriter.h"
 #include "util/Scope.h"
 #include "util/ScopedSingletonManager.h"
@@ -142,7 +145,4 @@
         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
         // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump
@@ -166,6 +166,7 @@
         RegisterRootObject(Core);
         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)
@@ -232,6 +233,7 @@
     namespace DefaultLevelLogFile
     {
-        const OutputLevel::Value Dev  = OutputLevel::Debug;
-        const OutputLevel::Value User = OutputLevel::Info;
+#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: inspect this (and remove boost include)")
+        const OutputLevel Dev  = level::internal_info;
+        const OutputLevel User = level::internal_info;
     }
 
@@ -240,9 +242,9 @@
     {
         // Choose the default level according to the path Orxonox was started (build directory or not)
-        OutputLevel::Value defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
+        OutputLevel 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_);
+        LogWriter::getInstance().setLevelMax(this->debugLevelLogFile_);
 
         SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
@@ -286,5 +288,5 @@
         else
         {
-            OutputLevel::Value level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
+            OutputLevel level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
             ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level);
         }
Index: /code/branches/output/src/libraries/core/Core.h
===================================================================
--- /code/branches/output/src/libraries/core/Core.h	(revision 8795)
+++ /code/branches/output/src/libraries/core/Core.h	(revision 8796)
@@ -136,5 +136,5 @@
 
             bool                      bGraphicsLoaded_;
-            int                       debugLevelLogFile_;          //!< The debug level for the log file (belongs to OutputHandler)
+            OutputLevel               debugLevelLogFile_;          //!< The debug level for the log file (belongs to LogWriter)
             std::string               language_;                   //!< The language
             bool                      bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
Index: /code/branches/output/src/libraries/core/GUIManager.cc
===================================================================
--- /code/branches/output/src/libraries/core/GUIManager.cc	(revision 8795)
+++ /code/branches/output/src/libraries/core/GUIManager.cc	(revision 8796)
@@ -33,4 +33,5 @@
 #include <memory>
 #include <boost/bind.hpp>
+#include <boost/preprocessor/stringize.hpp>
 #include <OgreRenderQueue.h>
 #include <OgreRenderWindow.h>
@@ -101,16 +102,17 @@
         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::internal_status; break;
+                case CEGUI::Informative: orxonoxLevel = level::internal_info; break;
+                case CEGUI::Insane:      orxonoxLevel = level::verbose; break;
                 default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
             }
-            OutputHandler::getOutStream(orxonoxLevel)
-                << "CEGUI: " << message << std::endl;
+
+#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level (and remove boost include)")
+            orxout(debug_output, context::cegui) << "CEGUI (level: " << level << "): " << message << endl;
 
             CEGUI::DefaultLogger::logEvent(message, level);
@@ -263,5 +265,5 @@
 
         this->oldCEGUI_ = false;
-        
+
         // Note: No SceneManager specified yet
 #ifdef ORXONOX_OLD_CEGUI
@@ -300,7 +302,8 @@
         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));
+#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: inspect this (and remove boost include)")
+//        // Set the log level according to ours (translate by subtracting 1)
+//        ceguiLogger->setLoggingLevel(
+//            static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
         this->ceguiLogger_ = ceguiLogger.release();
 
Index: /code/branches/output/src/libraries/core/GraphicsManager.cc
===================================================================
--- /code/branches/output/src/libraries/core/GraphicsManager.cc	(revision 8795)
+++ /code/branches/output/src/libraries/core/GraphicsManager.cc	(revision 8796)
@@ -35,4 +35,5 @@
 #include <boost/filesystem.hpp>
 #include <boost/shared_array.hpp>
+#include <boost/preprocessor/stringize.hpp>
 
 #include <OgreFrameListener.h>
@@ -396,10 +397,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: ";
         }
@@ -418,10 +419,10 @@
                 break;
             default:
-                orxonoxLevel = 0;
+                orxonoxLevel = level::debug_output;
             }
             introduction = "Ogre: ";
         }
-        OutputHandler::getOutStream(orxonoxLevel)
-            << introduction << message << std::endl;
+#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level, also for config values (and remove boost include)")
+        orxout(debug_output, context::ogre) << "ogre (level: " << lml << "): " << introduction << message << endl;
     }
 
Index: /code/branches/output/src/libraries/core/LuaState.cc
===================================================================
--- /code/branches/output/src/libraries/core/LuaState.cc	(revision 8795)
+++ /code/branches/output/src/libraries/core/LuaState.cc	(revision 8796)
@@ -36,4 +36,5 @@
 }
 #include <loki/ScopeGuard.h>
+#include <boost/preprocessor/stringize.hpp>
 
 #include "util/Output.h"
@@ -238,5 +239,6 @@
     void LuaState::luaLog(unsigned int level, const std::string& message)
     {
-        OutputHandler::getOutStream(level) << message << std::endl;
+#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level (and remove boost include)")
+        orxout(debug_output, context::lua) << "luaLog (level: " << level << "): " << message << endl;
     }
 
Index: /code/branches/output/src/libraries/util/output/OutputDefinitions.h
===================================================================
--- /code/branches/output/src/libraries/util/output/OutputDefinitions.h	(revision 8795)
+++ /code/branches/output/src/libraries/util/output/OutputDefinitions.h	(revision 8796)
@@ -75,4 +75,8 @@
             REGISTER_OUTPUT_CONTEXT(test2);
             REGISTER_OUTPUT_CONTEXT(output);
+            REGISTER_OUTPUT_CONTEXT(cegui);
+            REGISTER_OUTPUT_CONTEXT(ogre);
+            REGISTER_OUTPUT_CONTEXT(lua);
+            REGISTER_OUTPUT_CONTEXT(tcl);
         }
     }
