Index: code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h	(revision 453)
@@ -10,4 +10,5 @@
 
 #include "Identifier.h"
+#include "Debug.h"
 
 namespace orxonox
@@ -44,7 +45,5 @@
         // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
         ClassIdentifier<T>::getIdentifier()->startCreatingHierarchy();
-#if HIERARCHY_VERBOSE
-        std::cout << "*** Create Factory -> Create Class\n";
-#endif
+        COUT(4) << "*** Create Factory -> Create Class\n";
         BaseObject* temp = ClassIdentifier<T>::getIdentifier()->fabricate();
         delete temp;
Index: code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h	(revision 453)
@@ -17,4 +17,5 @@
 #include "OrxonoxClass.h"
 #include "ConfigValueContainer.h"
+#include "Debug.h"
 
 #include "OgreVector2.h"
@@ -56,12 +57,7 @@
     @param ClassName The name of the class
 */
-#if HIERARCHY_VERBOSE
 #define RegisterObject(ClassName) \
-    std::cout << "*** Register Object: " << #ClassName << "\n"; \
+    COUT(4) << "*** Register Object: " << #ClassName << "\n"; \
     InternRegisterObject(ClassName, false)
-#else
-#define RegisterObject(ClassName) \
-    InternRegisterObject(ClassName, false)
-#endif
 
 /**
@@ -69,12 +65,7 @@
     @param ClassName The name of the class
 */
-#if HIERARCHY_VERBOSE
 #define RegisterRootObject(ClassName) \
-    std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+    COUT(4) << "*** Register Root-Object: " << #ClassName << "\n"; \
     InternRegisterRootObject(ClassName)
-#else
-#define RegisterRootObject(ClassName) \
-    InternRegisterRootObject(ClassName)
-#endif
 
 /**
Index: code/branches/objecthierarchy/src/orxonox/core/Debug.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/Debug.h	(revision 453)
+++ code/branches/objecthierarchy/src/orxonox/core/Debug.h	(revision 453)
@@ -0,0 +1,242 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+/*!
+ * @file Debug.h
+ * @brief Handles the output for different verbose-modes.
+ *
+ * There are two modes: HARD and SOFT. HARD is precessed during compiletime, while SOFT is for runtime.
+ */
+
+#ifndef _Debug_H__
+#define _Debug_H__
+
+#include <stdio.h>
+
+// DEFINE ERROR MODES
+#define ORX_NONE            0
+#define ORX_ERROR           1
+#define ORX_WARNING         2
+#define ORX_INFO            3
+#define ORX_DEBUG           4
+#define ORX_vDEBUG          5
+
+//definitions
+#define ORX_PRINT_DEBUG_OUTPUT 1 // <-- fix that! should be a configurable setting
+
+#define ORX_HARD_DEBUG_LEVEL ORX_DEBUG
+#define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting
+
+///////////////////////////////////////////////////
+/// PRINTF: prints with filename and linenumber ///
+///////////////////////////////////////////////////
+#define PRINTFORX_NONE    PRINTF0
+#define PRINTFORX_ERROR   PRINTF1
+#define PRINTFORX_WARNING PRINTF2
+#define PRINTFORX_INFO    PRINTF3
+#define PRINTFORX_DEBUG   PRINTF4
+#define PRINTFORX_vDEBUG  PRINTF5
+
+#define PRINT_EXEC  printf
+#define COUT_EXEC   std::cout
+
+#ifndef PRINTF
+ #if ORX_PRINT_DEBUG_OUTPUT
+
+  #define PRINTF(x) \
+   PRINTF ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define PRINTF1 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR) \
+     printf("Error (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
+  #else
+   #define PRINTF1 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define PRINTF2 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
+     printf("Warning (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
+  #else
+   #define PRINTF2 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define PRINTF3 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
+     printf("Info (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
+  #else
+   #define PRINTF3 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define PRINTF4 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
+     printf("Debug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
+  #else
+   #define PRINTF4 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
+   #define PRINTF5 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
+     printf("vDebug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC
+  #else
+   #define PRINTF5 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define PRINTF(x) if (ORX_NONE) PRINT_EXEC
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+ #define PRINTF0 \
+  PRINT_EXEC
+#endif /* ifndef PRINTF */
+
+///////////////////////////////////////////////////
+///  PRINT: just prints output as is            ///
+///////////////////////////////////////////////////
+#define PRINTORX_NONE    PRINT0
+#define PRINTORX_ERROR   PRINT1
+#define PRINTORX_WARNING PRINT2
+#define PRINTORX_INFO    PRINT3
+#define PRINTORX_DEBUG   PRINT4
+#define PRINTORX_vDEBUG  PRINT5
+
+#ifndef PRINT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define PRINT(x) \
+   PRINT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define PRINT1  \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR)  \
+     PRINT_EXEC
+  #else
+   #define PRINT1 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define PRINT2 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
+     PRINT_EXEC
+  #else
+   #define PRINT2 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define PRINT3 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
+     PRINT_EXEC
+  #else
+   #define PRINT3 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define PRINT4 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
+     PRINT_EXEC
+  #else
+   #define PRINT4 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
+   #define PRINT5 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
+     PRINT_EXEC
+  #else
+   #define PRINT5 if (ORX_NONE) PRINT_EXEC
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define PRINT(x) if (ORX_NONE) PRINT_EXEC
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+ #define PRINT0 \
+  PRINT_EXEC
+#endif /* ifndef PRINT */
+
+
+////////////////////////////////////////////////////////
+///  COUT: just prints output as is with std::cout   ///
+////////////////////////////////////////////////////////
+#define COUTORX_NONE    COUT0
+#define COUTORX_ERROR   COUT1
+#define COUTORX_WARNING COUT2
+#define COUTORX_INFO    COUT3
+#define COUTORX_DEBUG   COUT4
+#define COUTORX_vDEBUG  COUT5
+
+#ifndef COUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define COUT(x) \
+   COUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define COUT1  \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_ERROR)  \
+     COUT_EXEC
+  #else
+   #define COUT1 if (ORX_NONE)\
+    COUT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define COUT2 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_WARNING) \
+     COUT_EXEC
+  #else
+   #define COUT2 if (ORX_NONE) \
+    COUT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define COUT3 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_INFO) \
+     COUT_EXEC
+  #else
+   #define COUT3 if (ORX_NONE) \
+    COUT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define COUT4 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
+     COUT_EXEC
+  #else
+   #define COUT4 if (ORX_NONE) \
+    COUT_EXEC
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
+   #define COUT5 \
+    if (ORX_SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
+     COUT_EXEC
+  #else
+   #define COUT5 if (ORX_NONE) \
+    COUT_EXEC
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define COUT(x) if (ORX_NONE) \
+   COUT_EXEC
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+ #define COUT0 \
+  COUT_EXEC
+#endif /* ifndef COUT */
+
+#endif /* _Debug_H__ */
Index: code/branches/objecthierarchy/src/orxonox/core/Identifier.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/Identifier.cc	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/Identifier.cc	(revision 453)
@@ -41,7 +41,5 @@
     void Identifier::initialize(const IdentifierList* parents)
     {
-#if HIERARCHY_VERBOSE
-        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
-#endif
+        COUT(4) << "*** Initialize " << this->name_ << "-Singleton.\n";
         this->bCreatedOneObject_ = true;
 
@@ -72,6 +70,6 @@
         {
             // Abstract classes don't have a factory and therefore can't create new objects
-            std::cout << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract.\n";
-            std::cout << "Aborting...";
+            COUT(1) << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract.\n";
+            COUT(1) << "Aborting...";
             abort();
         }
Index: code/branches/objecthierarchy/src/orxonox/core/Identifier.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/Identifier.h	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/Identifier.h	(revision 453)
@@ -32,7 +32,5 @@
 #include "Factory.h"
 #include "ConfigValueContainer.h"
-
-#define HIERARCHY_VERBOSE 0
-
+#include "Debug.h"
 
 namespace orxonox
@@ -118,7 +116,5 @@
             {
                 hierarchyCreatingCounter_s++;
-#if HIERARCHY_VERBOSE
-                std::cout << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
-#endif
+                COUT(4) << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
             }
 
@@ -129,7 +125,5 @@
             {
                 hierarchyCreatingCounter_s--;
-#if HIERARCHY_VERBOSE
-                std::cout << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
-#endif
+                COUT(4) << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
             }
 
@@ -206,14 +200,10 @@
     ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass)
     {
-#if HIERARCHY_VERBOSE
-        std::cout << "*** Register Class in " << name << "-Singleton.\n";
-#endif
+        COUT(4) << "*** Register Class in " << name << "-Singleton.\n";
 
         // It's a singleton, so maybe we have to create it first
         if (!pointer_s)
         {
-#if HIERARCHY_VERBOSE
-            std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
-#endif
+            COUT(4) << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
             pointer_s = new ClassIdentifier();
         }
@@ -224,7 +214,5 @@
             // If no: We have to store the informations and initialize the Identifier
 
-#if HIERARCHY_VERBOSE
-            std::cout << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n";
-#endif
+            COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n";
             pointer_s->name_ = name;
             Factory::add(name, pointer_s); // Add the Identifier to the Factory
@@ -247,7 +235,5 @@
         if (!pointer_s)
         {
-#if HIERARCHY_VERBOSE
-            std::cout << "*** Create Singleton.\n";
-#endif
+            COUT(4) << "*** Create Singleton.\n";
             pointer_s = new ClassIdentifier();
         }
@@ -263,7 +249,5 @@
     void ClassIdentifier<T>::addObject(T* object)
     {
-#if HIERARCHY_VERBOSE
-        std::cout << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
-#endif
+        COUT(4) << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
         object->getMetaList().add(ClassIdentifier<T>::getIdentifier()->objects_, ClassIdentifier<T>::getIdentifier()->objects_->add(object));
     }
@@ -300,7 +284,7 @@
                 if (!identifier->isA(ClassIdentifier<T>::getIdentifier()))
                 {
-                    std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";
-                    std::cout << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
-                    std::cout << "Aborting...\n";
+                    COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";
+                    COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
+                    COUT(1) << "Aborting...\n";
                     abort();
                 }
@@ -346,12 +330,12 @@
                     if (this->identifier_)
                     {
-                        std::cout << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";
-                        std::cout << "Error: Couldn't fabricate a new Object.\n";
-                        std::cout << "Aborting...\n";
+                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";
+                        COUT(1) << "Error: Couldn't fabricate a new Object.\n";
+                        COUT(1) << "Aborting...\n";
                     }
                     else
                     {
-                        std::cout << "Error: Couldn't fabricate a new Object - Identifier is undefined.\n";
-                        std::cout << "Aborting...\n";
+                        COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined.\n";
+                        COUT(1) << "Aborting...\n";
                     }
 
Index: code/branches/objecthierarchy/src/orxonox/core/Iterator.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/Iterator.h	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/Iterator.h	(revision 453)
@@ -18,4 +18,6 @@
 #ifndef _Iterator_H__
 #define _Iterator_H__
+
+#include "Debug.h"
 
 namespace orxonox
@@ -100,5 +102,5 @@
                 // Comparing with anything except zero makes no sense
                 if (compare != 0)
-                    std::cout << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works.\n";
+                    COUT(2) << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works.\n";
 
                 return (this->element_ != 0);
Index: code/branches/objecthierarchy/src/orxonox/core/MetaObjectList.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/core/MetaObjectList.h	(revision 452)
+++ code/branches/objecthierarchy/src/orxonox/core/MetaObjectList.h	(revision 453)
@@ -13,4 +13,5 @@
 #include "ObjectList.h"
 #include "Identifier.h"
+#include "Debug.h"
 
 namespace orxonox
@@ -69,7 +70,5 @@
 
 
-#if HIERARCHY_VERBOSE
-        std::cout << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
-#endif
+        COUT(4) << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
         delete this->element_;
     }
