Index: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	(revision 8108)
+++ 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;
             }
         }
