Index: code/branches/presentation2/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/IOConsole.cc	(revision 6179)
+++ code/branches/presentation2/src/libraries/core/IOConsole.cc	(revision 6180)
@@ -45,22 +45,4 @@
     IOConsole* IOConsole::singletonPtr_s = NULL;
 
-    //! Extracts the log level associated to a string (first character)
-    int IOConsole::extractLogLevel(std::string* text)
-    {
-        // Handle line colouring by inspecting the first letter
-        char level = 0;
-        if (!text->empty())
-        {
-            level = (*text)[0];
-            if (level == -1 || (level >= 1 && level <= 6))
-            {
-                *text = text->substr(1);
-                if (level != -1)
-                    return level;
-            }
-        }
-        return 0;
-    }
-
     // ###############################
     // ###  ShellListener methods  ###
@@ -78,5 +60,5 @@
     void IOConsole::executed()
     {
-        this->shell_->addOutputLine(this->promptString_ + this->shell_->getInput());
+        this->shell_->addOutputLine(this->promptString_ + this->shell_->getInput(), Shell::Command);
     }
 
@@ -109,5 +91,5 @@
 
     IOConsole::IOConsole()
-        : shell_(new Shell("IOConsole", false, true))
+        : shell_(new Shell("IOConsole", false))
         , buffer_(shell_->getInputBuffer())
         , cout_(std::cout.rdbuf())
@@ -280,25 +262,22 @@
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutputLine(this->origCout_.str());
+            this->shell_->addOutputLine(this->origCout_.str(), Shell::None);
             this->origCout_.str("");
         }
     }
 
-    void IOConsole::printOutputLine(const std::string& text)
-    {
-        std::string output = text;
-        /*int level =*/ this->extractLogLevel(&output);
-
+    void IOConsole::printOutputLine(const std::string& text, Shell::LineType type)
+    {
 /*
         // Colour line
-        switch (level)
-        {
-        case -1: this->cout_ << "\033[37m"; break;
-        case  1: this->cout_ << "\033[91m"; break;
-        case  2: this->cout_ << "\033[31m"; break;
-        case  3: this->cout_ << "\033[34m"; break;
-        case  4: this->cout_ << "\033[36m"; break;
-        case  5: this->cout_ << "\033[35m"; break;
-        case  6: this->cout_ << "\033[37m"; break;
+        switch (type)
+        {
+        case Shell::None:    this->cout_ << "\033[37m"; break;
+        case Shell::Error:   this->cout_ << "\033[91m"; break;
+        case Shell::Warning: this->cout_ << "\033[31m"; break;
+        case Shell::Info:    this->cout_ << "\033[34m"; break;
+        case Shell::Debug:   this->cout_ << "\033[36m"; break;
+        case Shell::Verbose: this->cout_ << "\033[35m"; break;
+        case Shell::Ultra:   this->cout_ << "\033[37m"; break;
         default: break;
         }
@@ -306,5 +285,5 @@
 
         // Print output line
-        this->cout_ << output;
+        this->cout_ << text;
 
         // Reset colour to white
@@ -419,5 +398,5 @@
         this->cout_ << "\033[K";
         // Reprint the last output line
-        this->printOutputLine(*(this->shell_->getNewestLineIterator()));
+        this->printOutputLine(this->shell_->getNewestLineIterator()->first);
         // Restore cursor
         this->cout_ << "\033[u";
@@ -428,5 +407,5 @@
     void IOConsole::lineAdded()
     {
-        int newLines = this->shell_->getNewestLineIterator()->size() / this->terminalWidth_ + 1;
+        int newLines = this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_ + 1;
         // Create new lines by scrolling the screen
         this->cout_ << "\033[" << newLines << 'S';
@@ -437,5 +416,5 @@
         // Print the new output lines
         for (int i = 0; i < newLines; ++i)
-            this->printOutputLine(this->shell_->getNewestLineIterator()->substr(i*this->terminalWidth_, this->terminalWidth_));
+            this->printOutputLine(this->shell_->getNewestLineIterator()->first.substr(i*this->terminalWidth_, this->terminalWidth_));
         // Move cursor down
         this->cout_ << "\033[1B\033[1G";
@@ -472,5 +451,5 @@
     //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode
     IOConsole::IOConsole()
-        : shell_(new Shell("IOConsole", false, true))
+        : shell_(new Shell("IOConsole", false))
         , buffer_(shell_->getInputBuffer())
         , cout_(std::cout.rdbuf())
@@ -613,5 +592,5 @@
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutputLine(this->origCout_.str());
+            this->shell_->addOutputLine(this->origCout_.str(), Shell::None);
             this->origCout_.str("");
         }
@@ -619,22 +598,23 @@
 
     //! Prints output text. Similar to writeText, but sets the colour according to the output level
-    void IOConsole::printOutputLine(const std::string& text, const COORD& pos)
-    {
-        std::string output = text;
-        int level = this->extractLogLevel(&output);
-
+    void IOConsole::printOutputLine(const std::string& text, Shell::LineType type, const COORD& pos)
+    {
         // Colour line
         WORD colour = 0;
-        switch (level)
-        {
-        case  1: colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED ; break;
-        case  2: colour = FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED ; break;
-        case  3: colour = FOREGROUND_INTENSITY                                     ; break;
-        case  4: colour = FOREGROUND_INTENSITY                                     ; break;
-        default: colour =                        FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ; break;
+        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;
+        default:             colour =                        FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break;
         }
 
         // Print output line
-        this->writeText(output, pos, colour);
+        this->writeText(text, pos, colour);
     }
 
@@ -783,5 +763,5 @@
     void IOConsole::onlyLastLineChanged()
     {
-        int newLineHeight = 1 + this->shell_->getNewestLineIterator()->size() / this->terminalWidth_;
+        int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;
         // Compute the number of new lines needed
         int newLines = newLineHeight - this->lastOutputLineHeight_;
@@ -790,5 +770,6 @@
         if (newLines > 0) // newLines < 0 is assumed impossible
             this->createNewOutputLines(newLines);
-        this->printOutputLine(*(this->shell_->getNewestLineIterator()), makeCOORD(0, this->inputLineRow_ - newLineHeight));
+        Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
+        this->printOutputLine(it->first, it->second, makeCOORD(0, this->inputLineRow_ - newLineHeight));
     }
 
@@ -796,10 +777,11 @@
     void IOConsole::lineAdded()
     {
+        Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
         // Scroll console
-        this->lastOutputLineHeight_ = 1 + this->shell_->getNewestLineIterator()->size() / this->terminalWidth_;
+        this->lastOutputLineHeight_ = 1 + it->first.size() / this->terminalWidth_;
         this->createNewOutputLines(this->lastOutputLineHeight_);
         // Write the text
         COORD pos = {0, this->inputLineRow_ - this->lastOutputLineHeight_};
-        this->printOutputLine(*(this->shell_->getNewestLineIterator()), pos);
+        this->printOutputLine(it->first, it->second, pos);
     }
 }
Index: code/branches/presentation2/src/libraries/core/IOConsole.h
===================================================================
--- code/branches/presentation2/src/libraries/core/IOConsole.h	(revision 6179)
+++ code/branches/presentation2/src/libraries/core/IOConsole.h	(revision 6180)
@@ -87,5 +87,5 @@
         bool willPrintStatusLines();
         void printInputLine();
-        void printOutputLine(const std::string& line);
+        void printOutputLine(const std::string& line, Shell::LineType type);
         static void resetTerminalMode();
 
@@ -102,5 +102,5 @@
         void writeText(const std::string& text, const COORD& pos, WORD attributes = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
         void createNewOutputLines(int lines);
-        void printOutputLine(const std::string& line, const COORD& pos);
+        void printOutputLine(const std::string& line, Shell::LineType type, const COORD& pos);
 
         static inline COORD makeCOORD(int x, int y)
Index: code/branches/presentation2/src/libraries/core/Shell.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/Shell.cc	(revision 6179)
+++ code/branches/presentation2/src/libraries/core/Shell.cc	(revision 6180)
@@ -45,9 +45,8 @@
     SetConsoleCommandShortcut(OutputHandler, debug);
 
-    Shell::Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel)
+    Shell::Shell(const std::string& consoleName, bool bScrollable)
         : OutputListener(consoleName)
         , inputBuffer_(new InputBuffer())
         , consoleName_(consoleName)
-        , bPrependOutputLevel_(bPrependOutputLevel)
         , bScrollable_(bScrollable)
     {
@@ -191,5 +190,5 @@
     }
 
-    void Shell::addOutputLine(const std::string& line, int level)
+    void Shell::addOutputLine(const std::string& line, LineType type)
     {
         // Make sure we really only have one line per line (no new lines!)
@@ -197,6 +196,5 @@
         for (unsigned i = 0; i < lines.size(); ++i)
         {
-            if (level <= this->softDebugLevel_)
-                this->outputLines_.push_front(lines[i]);
+            this->outputLines_.push_front(std::make_pair(lines[i], type));
             this->updateListeners<&ShellListener::lineAdded>();
         }
@@ -214,5 +212,5 @@
     }
 
-    std::list<std::string>::const_iterator Shell::getNewestLineIterator() const
+    Shell::LineList::const_iterator Shell::getNewestLineIterator() const
     {
         if (this->scrollPosition_)
@@ -222,5 +220,5 @@
     }
 
-    std::list<std::string>::const_iterator Shell::getEndIterator() const
+    Shell::LineList::const_iterator Shell::getEndIterator() const
     {
         return this->outputLines_.end();
@@ -264,13 +262,5 @@
             if (this->bFinishedLastLine_)
             {
-                if (this->bPrependOutputLevel_)
-                {
-                    if (level == 0)
-                        output.insert(0, 1, static_cast<char>(-1));
-                    else
-                        output.insert(0, 1, static_cast<char>(level));
-                }
-
-                this->outputLines_.push_front(output);
+                this->outputLines_.push_front(std::make_pair(output, static_cast<LineType>(level)));
 
                 if (this->scrollPosition_)
@@ -288,5 +278,5 @@
             else
             {
-                (*this->outputLines_.begin()) += output;
+                this->outputLines_.front().first += output;
                 this->bFinishedLastLine_ = newline;
                 this->updateListeners<&ShellListener::onlyLastLineChanged>();
@@ -325,5 +315,5 @@
 
         if (!CommandExecutor::execute(this->inputBuffer_->get()))
-            this->addOutputLine("Error: Can't execute \"" + this->inputBuffer_->get() + "\".", 1);
+            this->addOutputLine("Error: Can't execute \"" + this->inputBuffer_->get() + "\".", Error);
 
         this->clearInput();
@@ -333,5 +323,5 @@
     {
         this->inputBuffer_->set(CommandExecutor::complete(this->inputBuffer_->get()));
-        this->addOutputLine(CommandExecutor::hint(this->inputBuffer_->get()), -1);
+        this->addOutputLine(CommandExecutor::hint(this->inputBuffer_->get()), Hint);
 
         this->inputChanged();
Index: code/branches/presentation2/src/libraries/core/Shell.h
===================================================================
--- code/branches/presentation2/src/libraries/core/Shell.h	(revision 6179)
+++ code/branches/presentation2/src/libraries/core/Shell.h	(revision 6180)
@@ -65,5 +65,19 @@
     {
         public:
-            Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel = false);
+            enum LineType
+            {
+                None    = OutputLevel::None,
+                Warning = OutputLevel::Warning,
+                Error   = OutputLevel::Error,
+                Info    = OutputLevel::Info,
+                Debug   = OutputLevel::Debug,
+                Verbose = OutputLevel::Verbose,
+                Ultra   = OutputLevel::Ultra,
+                Input,
+                Command,
+                Hint
+            };
+
+            Shell(const std::string& consoleName, bool bScrollable);
             ~Shell();
 
@@ -85,8 +99,9 @@
                 { return this->inputBuffer_->get(); }
 
-            std::list<std::string>::const_iterator getNewestLineIterator() const;
-            std::list<std::string>::const_iterator getEndIterator() const;
+            typedef std::list<std::pair<std::string, LineType> > LineList;
+            LineList::const_iterator getNewestLineIterator() const;
+            LineList::const_iterator getEndIterator() const;
 
-            void addOutputLine(const std::string& line, int level = 0);
+            void addOutputLine(const std::string& line, LineType type = None);
             void clearOutput();
 
@@ -139,6 +154,6 @@
             std::stringstream         outputBuffer_;
             bool                      bFinishedLastLine_;
-            std::list<std::string>    outputLines_;
-            std::list<std::string>::const_iterator scrollIterator_;
+            LineList                  outputLines_;
+            LineList::const_iterator  scrollIterator_;
             unsigned int              scrollPosition_;
             unsigned int              historyPosition_;
@@ -147,5 +162,4 @@
             std::string               promptPrefix_;
             const std::string         consoleName_;
-            const bool                bPrependOutputLevel_;
             const bool                bScrollable_;
 
