Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8858 for code/trunk/src


Ignore:
Timestamp:
Aug 23, 2011, 12:45:53 AM (13 years ago)
Author:
landauf
Message:

merged output branch back to trunk.

Changes:

  • you have to include util/Output.h instead of util/Debug.h
  • COUT(x) is now called orxout(level)
  • output levels are now defined by an enum instead of numbers. see util/Output.h for the definition
  • it's possible to use output contexts with orxout(level, context). see util/Output.h for some common contexts. you can define more contexts
  • you must use 'endl' at the end of an output message, '\n' does not flush the message

Output levels:

  • instead of COUT(0) use orxout()
  • instead of COUT(1) use orxout(user_error) or orxout(internal_error)
  • instead of COUT(2) use orxout(user_warning) or orxout(internal_warning)
  • instead of COUT(3) use orxout(user_status/user_info) or orxout(internal_status/internal_info)
  • instead of COUT(4) use orxout(verbose)
  • instead of COUT(5) use orxout(verbose_more)
  • instead of COUT(6) use orxout(verbose_ultra)

Guidelines:

  • user_* levels are for the user, visible in the console and the log-file
  • internal_* levels are for developers, visible in the log-file
  • verbose_* levels are for debugging, only visible if the context of the output is activated

Usage in C++:

  • orxout() << "message" << endl;
  • orxout(level) << "message" << endl;
  • orxout(level, context) << "message" << endl;

Usage in Lua:

  • orxout("message")
  • orxout(orxonox.level.levelname, "message")
  • orxout(orxonox.level.levelname, "context", "message")

Usage in Tcl (and in the in-game-console):

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
Location:
code/trunk
Files:
11 deleted
255 edited
30 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/Orxonox.cc

    r8351 r8858  
    4343#endif
    4444
    45 #include "util/Debug.h"
     45#include "util/Output.h"
    4646#include "util/Exception.h"
    4747#include "orxonox/Main.h"
     
    5959#endif
    6060{
     61    using namespace orxonox;
     62
     63    orxout(user_status) << "Welcome to Orxonox (v" << ORXONOX_VERSION_MAJOR << '.' << ORXONOX_VERSION_MINOR << '.' << ORXONOX_VERSION_PATCH << ' ' << ORXONOX_VERSION_NAME << ')' << endl;
     64    orxout(internal_status) << "Congratulations, you survived the static initialization. Entering main()" << endl;
     65    if (argc > 0)
     66        orxout(internal_info) << "argv[0]: " << argv[0] << endl;
     67
    6168    try
    6269    {
     
    7077        const int firstArgument = 1;
    7178#endif
    72    
     79
    7380        std::string strCmdLine;
    7481        for (int i = firstArgument; i < argc; ++i)
     
    7683#endif
    7784
    78         return orxonox::main(strCmdLine);
     85        int value = main(strCmdLine);
     86        orxout(internal_status) << "Terminating main() normally with value " << value << endl;
     87        return value;
    7988    }
    8089    catch (...)
    8190    {
    82         COUT(0) << "Orxonox failed to initialise: " << orxonox::Exception::handleMessage() << std::endl;
    83         COUT(0) << "Terminating program." << std::endl;
     91        orxout(user_error) << "Exception caught in main(): " << orxonox::Exception::handleMessage() << endl;
     92        orxout(user_error) << "Terminating program." << endl;
    8493        return 1;
    8594    }
  • code/trunk/src/OrxonoxConfig.h.in

    r8418 r8858  
    106106#  else
    107107#    define __FUNCTIONNAME__
     108#  endif
     109#endif
     110
     111// Declare a function deprecated
     112#ifndef __DEPRECATED__
     113#  if defined(ORXONOX_COMPILER_GCC)
     114#    define __DEPRECATED__(function) function __attribute__ ((deprecated))
     115#  elif defined(ORXONOX_COMPILER_MSVC)
     116#    define __DEPRECATED__(function) __declspec(deprecated) function
     117#  else
     118#    define __DEPRECATED__(function) function
    108119#  endif
    109120#endif
  • code/trunk/src/libraries/core/BaseObject.cc

    r8706 r8858  
    109109    void BaseObject::registerEventListener(BaseObject* object)
    110110    {
    111         COUT(4) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << std::endl;
     111        orxout(verbose, context::events) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << endl;
    112112        this->eventListeners_.insert(object);
    113113    }
     
    186186            this->addTemplate(temp);
    187187        else
    188             COUT(1) << "Error: \"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << std::endl;
     188            orxout(internal_error) << "\"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << endl;
    189189    }
    190190
     
    312312        if (it != this->eventStates_.end())
    313313        {
    314             COUT(2) << "Warning: Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << std::endl;
     314            orxout(internal_warning, context::events) << "Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << endl;
    315315            delete (it->second);
    316316        }
     
    379379        this->registerEventStates();
    380380
    381         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;
     381        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;
    382382
    383383        std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(event.statename_);
     
    385385            it->second->process(event, this);
    386386        else if (!event.statename_.empty())
    387             COUT(2) << "Warning: \"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
    388         else
    389             COUT(2) << "Warning: Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
     387            orxout(internal_warning, context::events) << "\"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
     388        else
     389            orxout(internal_warning, context::events) << "Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
    390390    }
    391391
     
    412412        }
    413413        else
    414             COUT(2) << "Warning: No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << std::endl;
     414            orxout(internal_warning, context::events) << "No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << endl;
    415415    }
    416416
     
    432432                    this->mainStateFunctor_ = it->second->getFunctor();
    433433                else
    434                     COUT(2) << "Warning: Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << std::endl;
     434                    orxout(internal_warning, context::events) << "Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << endl;
    435435            }
    436436            else
    437                 COUT(2) << "Warning: \"" << this->mainStateName_ << "\" is not a valid MainState." << std::endl;
     437                orxout(internal_warning, context::events) << "\"" << this->mainStateName_ << "\" is not a valid MainState." << endl;
    438438        }
    439439    }
  • code/trunk/src/libraries/core/CMakeLists.txt

    r8729 r8858  
    8686    input/KeyBinder.h
    8787    input/KeyBinderManager.h
     88    ../util/output/OutputDefinitions.h
    8889  PCH_FILE
    8990    CorePrecompiledHeaders.h
  • code/trunk/src/libraries/core/ClassFactory.h

    r7401 r8858  
    4242#include <string>
    4343
    44 #include "util/Debug.h"
     44#include "util/Output.h"
    4545#include "Identifier.h"
    4646
     
    7373            ClassFactory(const std::string& name, bool bLoadable = true)
    7474            {
    75                 COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
     75                orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
    7676                ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
    7777                ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);
  • code/trunk/src/libraries/core/CommandLineParser.cc

    r8729 r8858  
    3333
    3434#include "util/Convert.h"
    35 #include "util/Debug.h"
     35#include "util/Output.h"
    3636#include "util/Exception.h"
    3737#include "util/StringUtils.h"
     
    229229        catch (const ArgumentException& ex)
    230230        {
    231             COUT(0) << "Could not parse command line: " << ex.what() << std::endl;
    232             COUT(0) << CommandLineParser::getUsageInformation() << std::endl;
     231            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
     232            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
    233233            throw GeneralException("");
    234234        }
     
    286286        }
    287287
    288         infoStr << std::endl;
    289         infoStr << "Usage: orxonox [options]" << std::endl;
    290         infoStr << "Available options:" << std::endl;
     288        infoStr << endl;
     289        infoStr << "Usage: orxonox [options]" << endl;
     290        infoStr << "Available options:" << endl;
    291291
    292292        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
     
    305305            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
    306306            infoStr << ": " << it->second->getInformation();
    307             infoStr << std::endl;
     307            infoStr << endl;
    308308        }
    309309        return infoStr.str();
  • code/trunk/src/libraries/core/CommandLineParser.h

    r8729 r8858  
    218218            "Cannot add a command line argument with name '" + name + "' twice.");
    219219        OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
    220                "Boolean command line arguments with positive default values are not supported." << std::endl
     220               "Boolean command line arguments with positive default values are not supported." << endl
    221221            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
    222222
  • code/trunk/src/libraries/core/ConfigFileManager.cc

    r7401 r8858  
    123123        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
    124124            if ((*it)->getName() == name)
    125                 if ((*it)->getIndex() > size)
    126                     size = (*it)->getIndex();
    127         if (size == 0)
    128             return 0;
    129         else
    130             return (size + 1);
     125                if ((*it)->getIndex() >= size)
     126                    size = (*it)->getIndex() + 1;
     127        return size;
    131128    }
    132129
     
    274271                        {
    275272                            boost::filesystem::copy_file(defaultFilepath, filepath);
    276                             COUT(3) << "Copied " << this->filename_ << " from the default config folder." << std::endl;
     273                            orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl;
    277274                        }
    278275                        catch (const boost::filesystem::filesystem_error& ex)
    279                         { COUT(1) << "Error in ConfigFile: " << ex.what() << std::endl; }
     276                        { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; }
    280277                    }
    281278                }
     
    375372            file.close();
    376373
    377             COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
     374            orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl;
    378375
    379376            // DO NOT save the file --> we can open supposedly read only config files
     
    404401        if (!file.is_open())
    405402        {
    406             COUT(1) << "Error: Couldn't open config-file \"" << filename << "\"." << std::endl;
     403            orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl;
    407404            return;
    408405        }
     
    410407        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
    411408        {
    412             file << (*it)->getFileEntry() << std::endl;
     409            file << (*it)->getFileEntry() << endl;
    413410
    414411            for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
    415                 file << (*it_entries)->getFileEntry() << std::endl;
    416 
    417             file << std::endl;
     412                file << (*it_entries)->getFileEntry() << endl;
     413
     414            file << endl;
    418415        }
    419416
    420417        file.close();
    421418
    422         COUT(4) << "Saved config file \"" << filename << "\"." << std::endl;
     419        orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl;
    423420    }
    424421
     
    669666    {
    670667        if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
    671             COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
     668            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
    672669    }
    673670
     
    682679    {
    683680        if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
    684             COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
     681            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
    685682    }
    686683
  • code/trunk/src/libraries/core/ConfigValueContainer.cc

    r8351 r8858  
    143143        else
    144144        {
    145             COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
     145            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
    146146        }
    147147        return false;
     
    182182            if (index > MAX_VECTOR_INDEX)
    183183            {
    184                 COUT(1) << "Error: Index " << index << " is too large." << std::endl;
     184                orxout(user_error, context::config) << "Index " << index << " is too large." << endl;
    185185                return false;
    186186            }
     
    203203        else
    204204        {
    205             COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
     205            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
    206206            return false;
    207207        }
     
    218218            return this->set(this->valueVector_.size(), input);
    219219
    220         COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
     220        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
    221221        return false;
    222222    }
     
    241241                return true;
    242242            }
    243             COUT(1) << "Error: Invalid vector-index." << std::endl;
    244         }
    245 
    246         COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
     243            orxout(user_error, context::config) << "Invalid vector-index." << endl;
     244        }
     245
     246        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
    247247        return false;
    248248    }
     
    312312            if (!success)
    313313            {
    314                 COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << std::endl;
     314                orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << endl;
    315315            }
    316316            else
    317317            {
    318                 COUT(1) << "Error: Invalid vector-index." << std::endl;
     318                orxout(user_error, context::config) << "Invalid vector-index." << endl;
    319319            }
    320320            return false;
  • code/trunk/src/libraries/core/ConfigValueIncludes.h

    r8729 r8858  
    8787    @code
    8888    MyObject orxonoxobject;
    89     std::cout << "Name:    " << orxonoxobject.getName() << std::endl;
    90     std::cout << "Version: " << orxonoxobject.getVersion() << std::endl;
     89    orxout() << "Name:    " << orxonoxobject.getName() << endl;
     90    orxout() << "Version: " << orxonoxobject.getVersion() << endl;
    9191    @endcode
    9292
     
    200200        else
    201201        {
    202             COUT(2) << "Warning: Couldn't reset config-value '" << entryName << "' in class '"
    203                     << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << std::endl;
     202            orxout(user_warning, context::config) << "Couldn't reset config-value '" << entryName << "' in class '"
     203                                                  << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << endl;
    204204        }
    205205    }
     
    238238    else \
    239239    { \
    240         COUT(2) << "Warning: Couln't modify config-value '" << entryName << "' in class '" \
    241                 << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << std::endl; \
     240        orxout(user_warning, context::config) << "Couldn't modify config-value '" << entryName << "' in class '" \
     241                                              << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << endl; \
    242242    }
    243243
  • code/trunk/src/libraries/core/Core.cc

    r8729 r8858  
    5252
    5353#include "util/Clock.h"
    54 #include "util/Debug.h"
     54#include "util/Output.h"
    5555#include "util/Exception.h"
     56#include "util/output/LogWriter.h"
    5657#include "util/Scope.h"
    5758#include "util/ScopedSingletonManager.h"
     
    111112        , destructionHelper_(this)
    112113    {
     114        orxout(internal_status) << "initializing Core object..." << endl;
     115
    113116        // Set the hard coded fixed paths
    114117        this->pathConfig_ = new PathConfig();
     
    118121
    119122        // Load modules
     123        orxout(internal_info) << "Loading modules:" << endl;
    120124        const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();
    121125        for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)
     
    127131            catch (...)
    128132            {
    129                 COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;
     133                orxout(user_error) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << endl;
    130134            }
    131135        }
     
    136140        // Set configurable paths like log, config and media
    137141        this->pathConfig_->setConfigurablePaths();
     142
     143        orxout(internal_info) << "Root path:       " << PathConfig::getRootPathString() << endl;
     144        orxout(internal_info) << "Executable path: " << PathConfig::getExecutablePathString() << endl;
     145        orxout(internal_info) << "Data path:       " << PathConfig::getDataPathString() << endl;
     146        orxout(internal_info) << "Ext. data path:  " << PathConfig::getExternalDataPathString() << endl;
     147        orxout(internal_info) << "Config path:     " << PathConfig::getConfigPathString() << endl;
     148        orxout(internal_info) << "Log path:        " << PathConfig::getLogPathString() << endl;
     149        orxout(internal_info) << "Modules path:    " << PathConfig::getModulePathString() << endl;
    138150
    139151        // create a signal handler (only active for Linux)
     
    141153        this->signalHandler_ = new SignalHandler();
    142154        this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log");
    143 
    144         // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% (Windows) was used
    145         OutputHandler::getInstance().setLogPath(PathConfig::getLogPathString());
    146155
    147156#ifdef ORXONOX_PLATFORM_WINDOWS
     
    155164
    156165        // Manage ini files and set the default settings file (usually orxonox.ini)
     166        orxout(internal_info) << "Loading config:" << endl;
    157167        this->configFileManager_ = new ConfigFileManager();
    158168        this->configFileManager_->setFilename(ConfigFileType::Settings,
     
    160170
    161171        // Required as well for the config values
     172        orxout(internal_info) << "Loading language:" << endl;
    162173        this->languageInstance_ = new Language();
    163174
     
    165176        // possibility to configure everything below here
    166177        RegisterRootObject(Core);
     178        orxout(internal_info) << "configuring Core" << endl;
    167179        this->setConfigValues();
    168         // Rewrite the log file with the correct log levels
    169         OutputHandler::getInstance().rewriteLogFile();
     180
     181        // Set the correct log path and rewrite the log file with the correct log levels
     182        LogWriter::getInstance().setLogPath(PathConfig::getLogPathString());
    170183
    171184#if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
     
    176189        }
    177190        if (this->bStartIOConsole_)
     191        {
     192            orxout(internal_info) << "creating IO console" << endl;
    178193            this->ioConsole_ = new IOConsole();
     194        }
    179195#endif
    180196
    181197        // creates the class hierarchy for all classes with factories
     198        orxout(internal_info) << "creating class hierarchy" << endl;
    182199        Identifier::createClassHierarchy();
    183200
    184201        // Load OGRE excluding the renderer and the render window
     202        orxout(internal_info) << "creating GraphicsManager:" << endl;
    185203        this->graphicsManager_ = new GraphicsManager(false);
    186204
     
    190208
    191209        // Create singletons that always exist (in other libraries)
     210        orxout(internal_info) << "creating root scope:" << endl;
    192211        this->rootScope_ = new Scope<ScopeID::Root>();
    193212
     
    204223            }
    205224            else
    206                 COUT(0) << "Error: Could not open file for documentation writing" << endl;
    207         }
     225                orxout(internal_error) << "Could not open file for documentation writing" << endl;
     226        }
     227
     228        orxout(internal_status) << "finished initializing Core object" << endl;
    208229    }
    209230
    210231    void Core::destroy()
    211232    {
     233        orxout(internal_status) << "destroying Core object..." << endl;
     234
    212235        // Remove us from the object lists again to avoid problems when destroying them
    213236        this->unregisterObject();
     
    228251        safeObjectDelete(&dynLibManager_);
    229252        safeObjectDelete(&pathConfig_);
    230     }
    231 
    232     namespace DefaultLevelLogFile
    233     {
    234         const OutputLevel::Value Dev  = OutputLevel::Debug;
    235         const OutputLevel::Value User = OutputLevel::Info;
     253
     254        orxout(internal_status) << "finished destroying Core object" << endl;
    236255    }
    237256
     
    239258    void Core::setConfigValues()
    240259    {
    241         // Choose the default level according to the path Orxonox was started (build directory or not)
    242         OutputLevel::Value defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
    243 
    244         SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile", defaultLogLevel)
    245             .description("The maximum level of debug output written to the log file");
    246         OutputHandler::getInstance().setSoftDebugLevel("LogFile", debugLevelLogFile_);
     260        SetConfigValueExternal(LogWriter::getInstance().configurableMaxLevel_,
     261                               LogWriter::getInstance().getConfigurableSectionName(),
     262                               LogWriter::getInstance().getConfigurableMaxLevelName(),
     263                               LogWriter::getInstance().configurableMaxLevel_)
     264            .description("The maximum level of output shown in the log file")
     265            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevel);
     266        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContextsMaxLevel_,
     267                               LogWriter::getInstance().getConfigurableSectionName(),
     268                               LogWriter::getInstance().getConfigurableAdditionalContextsMaxLevelName(),
     269                               LogWriter::getInstance().configurableAdditionalContextsMaxLevel_)
     270            .description("The maximum level of output shown in the log file for additional contexts")
     271            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
     272        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContexts_,
     273                               LogWriter::getInstance().getConfigurableSectionName(),
     274                               LogWriter::getInstance().getConfigurableAdditionalContextsName(),
     275                               LogWriter::getInstance().configurableAdditionalContexts_)
     276            .description("Additional output contexts shown in the log file")
     277            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContexts);
    247278
    248279        SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
     
    279310    void Core::devModeChanged()
    280311    {
    281         bool isNormal = (bDevMode_ == PathConfig::buildDirectoryRun());
    282         if (isNormal)
    283         {
    284             ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", update);
    285         }
    286         else
    287         {
    288             OutputLevel::Value level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);
    289             ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level);
    290         }
    291 
    292312        // Inform listeners
    293313        ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
     
    316336    void Core::loadGraphics()
    317337    {
     338        orxout(internal_info) << "loading graphics in Core" << endl;
     339       
    318340        // Any exception should trigger this, even in upgradeToGraphics (see its remarks)
    319341        Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);
     
    327349        {
    328350            // Exit the application if the Ogre config dialog was canceled
    329             COUT(1) << Exception::handleMessage() << std::endl;
     351            orxout(user_error) << Exception::handleMessage() << endl;
    330352            exit(EXIT_FAILURE);
    331353        }
     
    338360            // and reloaded between throw and catch (access violation in MSVC).
    339361            // That's why we abort completely and only display the exception.
    340             COUT(1) << "An exception occurred during upgrade to graphics. "
    341                     << "That is unrecoverable. The message was:" << endl
    342                     << Exception::handleMessage() << endl;
     362            orxout(user_error) << "An exception occurred during upgrade to graphics. "
     363                               << "That is unrecoverable. The message was:" << endl
     364                               << Exception::handleMessage() << endl;
    343365            abort();
    344366        }
     
    357379
    358380        // Create singletons associated with graphics (in other libraries)
     381        orxout(internal_info) << "creating graphics scope:" << endl;
    359382        graphicsScope_ = new Scope<ScopeID::Graphics>();
    360383
    361384        unloader.Dismiss();
     385
     386        orxout(internal_info) << "finished loading graphics in Core" << endl;
    362387    }
    363388
    364389    void Core::unloadGraphics()
    365390    {
     391        orxout(internal_info) << "unloading graphics in Core" << endl;
     392
    366393        safeObjectDelete(&graphicsScope_);
    367394        safeObjectDelete(&guiManager_);
     
    374401        catch (...)
    375402        {
    376             COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl
    377                     << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl
    378                     << "Terminating the program." << std::endl;
     403            orxout(user_error) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << endl
     404                               << "Another exception might be being handled which may lead to undefined behaviour!" << endl
     405                               << "Terminating the program." << endl;
    379406            abort();
    380407        }
  • code/trunk/src/libraries/core/Core.h

    r8729 r8858  
    136136
    137137            bool                      bGraphicsLoaded_;
    138             int                       debugLevelLogFile_;          //!< The debug level for the log file (belongs to OutputHandler)
    139138            std::string               language_;                   //!< The language
    140139            bool                      bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
  • code/trunk/src/libraries/core/CoreIncludes.h

    r8729 r8858  
    3434/**
    3535    @file
    36     @ingroup Object Factory
     36    @ingroup Object Factory Class Identifier
    3737    @brief Defines several very important macros used to register objects, create factories, and to work with identifiers.
    3838
     
    7878#include "CorePrereqs.h"
    7979
    80 #include "util/Debug.h"
     80#include "util/Output.h"
    8181#include "Identifier.h"
    8282#include "ClassFactory.h"
  • code/trunk/src/libraries/core/CorePrecompiledHeaders.h

    r7266 r8858  
    5151#include <set>      // 50
    5252
    53 #include "util/Debug.h" // 48
     53#include "util/Output.h" // 48
    5454
    5555#include <deque>    // 43
  • code/trunk/src/libraries/core/DynLib.cc

    r8351 r8858  
    6868    {
    6969        // Log library load
    70         COUT(2) << "Loading module " << mName << std::endl;
     70        orxout(internal_info) << "Loading module " << mName << endl;
    7171
    7272        std::string name = mName;
     
    9999    {
    100100        // Log library unload
    101         COUT(4) << "Unloading module " << mName << std::endl;
     101        orxout(internal_info) << "Unloading module " << mName << endl;
    102102
    103103        if (DYNLIB_UNLOAD( m_hInst ))
  • code/trunk/src/libraries/core/Event.cc

    r7401 r8858  
    4949        if (this->bProcessingEvent_)
    5050        {
    51             COUT(2) << "Warning: Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << std::endl;
     51            orxout(internal_warning, context::events) << "Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << endl;
    5252            return;
    5353        }
     
    5555        this->bProcessingEvent_ = true;
    5656
    57         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;
     57        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;
    5858
    5959        // check if the originator is an instance of the requested class
  • code/trunk/src/libraries/core/GUIManager.cc

    r8729 r8858  
    7373#include "util/Clock.h"
    7474#include "util/Convert.h"
    75 #include "util/Debug.h"
     75#include "util/Output.h"
    7676#include "util/Exception.h"
    7777#include "util/Math.h"
    7878#include "util/OrxAssert.h"
     79#include "util/output/BaseWriter.h"
    7980#include "ConfigValueIncludes.h"
    8081#include "Core.h"
     
    101102        void logEvent(const CEGUI::String& message, CEGUI::LoggingLevel level = CEGUI::Standard)
    102103        {
    103             int orxonoxLevel = CEGUI::Standard;
     104            OutputLevel orxonoxLevel = level::debug_output;
    104105            switch (level)
    105106            {
    106                 case CEGUI::Errors:      orxonoxLevel = 1; break;
    107                 case CEGUI::Warnings:    orxonoxLevel = 2; break;
    108                 case CEGUI::Standard:    orxonoxLevel = 4; break;
    109                 case CEGUI::Informative: orxonoxLevel = 5; break;
    110                 case CEGUI::Insane:      orxonoxLevel = 6; break;
     107                case CEGUI::Errors:      orxonoxLevel = level::internal_error; break;
     108                case CEGUI::Warnings:    orxonoxLevel = level::internal_warning; break;
     109                case CEGUI::Standard:    orxonoxLevel = level::verbose; break;
     110                case CEGUI::Informative: orxonoxLevel = level::verbose_more; break;
     111                case CEGUI::Insane:      orxonoxLevel = level::verbose_ultra; break;
    111112                default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
    112113            }
    113             OutputHandler::getOutStream(orxonoxLevel)
    114                 << "CEGUI: " << message << std::endl;
     114
     115            orxout(orxonoxLevel, context::cegui) << message << endl;
    115116
    116117            CEGUI::DefaultLogger::logEvent(message, level);
     
    256257    {
    257258        RegisterRootObject(GUIManager);
     259
     260        orxout(internal_status) << "initializing GUIManager..." << endl;
     261
    258262        this->setConfigValues();
    259263
    260264        using namespace CEGUI;
    261265
    262         COUT(3) << "Initialising CEGUI." << std::endl;
     266        orxout(internal_info) << "Initialising CEGUI." << endl;
    263267
    264268        this->oldCEGUI_ = false;
    265        
     269
    266270        // Note: No SceneManager specified yet
    267271#ifdef ORXONOX_OLD_CEGUI
     
    300304        std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
    301305        ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log");
    302         // Set the log level according to ours (translate by subtracting 1)
    303         ceguiLogger->setLoggingLevel(
    304             static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
     306        ceguiLogger->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
    305307        this->ceguiLogger_ = ceguiLogger.release();
    306308
     
    336338        // Set up the sheet manager in the Lua framework
    337339        this->luaState_->doFile("SheetManager.lua");
     340
     341        orxout(internal_status) << "finished initializing GUIManager" << endl;
    338342    }
    339343
    340344    void GUIManager::destroy()
    341345    {
     346        orxout(internal_status) << "destroying GUIManager..." << endl;
     347
    342348        using namespace CEGUI;
    343349
     
    356362#endif
    357363        safeObjectDelete(&luaState_);
     364
     365        orxout(internal_status) << "finished destroying GUIManager" << endl;
    358366    }
    359367
    360368    void GUIManager::setConfigValues(void)
    361369    {
    362         SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.") .callback(this, &GUIManager::changedGUIScheme);
     370        SetConfigValue(guiScheme_, GUIManager::defaultScheme_).description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme);
    363371        SetConfigValue(numScrollLines_, 1).description("How many lines to scroll in a list if the scroll wheel is used");
     372        SetConfigValueExternal(outputLevelCeguiLog_, BaseWriter::getConfigurableSectionName(), "outputLevelCeguiLog", CEGUI::Standard).description("The log level of the CEGUI log file").callback(this, &GUIManager::changedCeguiOutputLevel);
    364373    }
    365374
    366375    void GUIManager::changedGUIScheme(void)
    367376    {
     377    }
     378
     379    void GUIManager::changedCeguiOutputLevel()
     380    {
     381        if (this->ceguiLogger_)
     382            this->ceguiLogger_->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
    368383    }
    369384
     
    670685        {
    671686            // Display the error and proceed. See @remarks why this can be dangerous.
    672             COUT(1) << ex.getMessage() << std::endl;
     687            orxout(internal_error) << ex.getMessage() << endl;
    673688            return true;
    674689        }
  • code/trunk/src/libraries/core/GUIManager.h

    r8729 r8858  
    152152        bool protectedCall(FunctionType function);
    153153
     154        void changedCeguiOutputLevel();
     155
    154156        // keyHandler functions
    155157        void buttonPressed (const KeyEvent& evt);
     
    168170
    169171#ifdef ORXONOX_OLD_CEGUI
    170         CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    171         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
     172        CEGUI::OgreCEGUIRenderer*            guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
     173        CEGUI::ResourceProvider*             resourceProvider_;     //!< CEGUI's resource provider
    172174#else
    173         CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    174         CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
    175         Ogre::RenderQueueListener*           rqListener_;       //!< RQ listener so we can draw UNDER Ogre overlays
     175        CEGUI::OgreRenderer*                 guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
     176        CEGUI::OgreResourceProvider*         resourceProvider_;     //!< CEGUI's resource provider
     177        Ogre::RenderQueueListener*           rqListener_;           //!< RQ listener so we can draw UNDER Ogre overlays
    176178        CEGUI::OgreImageCodec*               imageCodec_;
    177179#endif
    178         LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
    179         CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
    180         CEGUI::System*                       guiSystem_;        //!< CEGUI's main system
    181         shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    182         CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    183         CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
    184         CEGUI::Window*                       hudRootWindow_;    //!< Root node for the HUD sheets
    185         CEGUI::Window*                       menuRootWindow_;   //!< Root node for the menu sheets (used by Lua)
    186         std::map<std::string, PlayerInfo*>   players_;          //!< Stores the player (owner) for each GUI
    187         Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
     180        LuaState*                            luaState_;             //!< LuaState, access point to the Lua engine
     181        CEGUI::LuaScriptModule*              scriptModule_;         //!< CEGUI's script module to use Lua
     182        CEGUI::System*                       guiSystem_;            //!< CEGUI's main system
     183        shared_ptr<ResourceInfo>             rootFileInfo_;         //!< Resource information about the root script
     184        CEGUI::Logger*                       ceguiLogger_;          //!< CEGUI's logger to be able to log CEGUI errors in our log
     185        int                                  outputLevelCeguiLog_;  //!< CEGUI's log level
     186        CEGUI::Window*                       rootWindow_;           //!< Root node for all windows
     187        CEGUI::Window*                       hudRootWindow_;        //!< Root node for the HUD sheets
     188        CEGUI::Window*                       menuRootWindow_;       //!< Root node for the menu sheets (used by Lua)
     189        std::map<std::string, PlayerInfo*>   players_;              //!< Stores the player (owner) for each GUI
     190        Ogre::Camera*                        camera_;               //!< Camera used to render the scene with the GUI
    188191
    189192        /// Helper object that executes the surrogate destructor destroy()
    190193        DestructionHelper<GUIManager>        destructionHelper_;
    191194
    192         static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
     195        static GUIManager*                   singletonPtr_s;        //!< Singleton reference to GUIManager
    193196
    194197        // The used CEGUI scheme.
     
    196199        std::string guiScheme_;
    197200        bool oldCEGUI_;
    198        
     201
    199202        int numScrollLines_; ///< How many lines to scroll in a list if the scroll wheel is used
    200203
  • code/trunk/src/libraries/core/Game.cc

    r8729 r8858  
    4040
    4141#include "util/Clock.h"
    42 #include "util/Debug.h"
     42#include "util/Output.h"
    4343#include "util/Exception.h"
    4444#include "util/Sleep.h"
     
    6060    SetConsoleCommand("exit", &stop_game);
    6161    static void printFPS()
    62         { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
     62        { orxout(message) << Game::getInstance().getAvgFPS() << endl; }
    6363    SetConsoleCommand("Stats", "printFPS", &printFPS);
    6464    static void printTickTime()
    65         { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }
     65        { orxout(message) << Game::getInstance().getAvgTickTime() << endl; }
    6666    SetConsoleCommand("Stats", "printTickTime", &printTickTime);
    6767
     
    8484        , destructionHelper_(this)
    8585    {
     86        orxout(internal_status) << "initializing Game object..." << endl;
     87
    8688#ifdef ORXONOX_PLATFORM_WINDOWS
    8789        minimumSleepTime_ = 1000/*us*/;
     
    106108
    107109        // Create the Core
     110        orxout(internal_info) << "creating Core object:" << endl;
    108111        this->core_ = new Core(cmdLine);
    109112
     
    125128        this->loadedTopStateNode_ = this->rootStateNode_;
    126129        this->loadedStates_.push_back(this->getState(rootStateNode_->name_));
     130
     131        orxout(internal_status) << "finished initializing Game object" << endl;
    127132    }
    128133
    129134    void Game::destroy()
    130135    {
     136        orxout(internal_status) << "destroying Game object..." << endl;
     137
    131138        // Remove us from the object lists again to avoid problems when destroying them
    132139        this->unregisterObject();
     
    139146        safeObjectDelete(&core_);
    140147        safeObjectDelete(&gameClock_);
     148
     149        orxout(internal_status) << "finished destroying Game object..." << endl;
    141150    }
    142151
     
    163172    {
    164173        if (this->requestedStateNodes_.empty())
    165             COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl;
     174            orxout(user_error) << "Starting game without requesting GameState. This automatically terminates the program." << endl;
     175
     176        // Update the GameState stack if required. We do this already here to have a properly initialized game before entering the main loop
     177        this->updateGameStateStack();
     178
     179        orxout(user_status) << "Game loaded" << endl;
     180        orxout(internal_status) << "--------------------------------------------------" << endl;
     181        orxout(internal_status) << "starting main loop..." << endl;
    166182
    167183        // START GAME
     
    189205            catch (...)
    190206            {
    191                 COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl;
    192                 COUT(0) << "This should really never happen! Closing the program." << std::endl;
     207                orxout(user_error) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << endl;
     208                orxout(user_error) << "This should really never happen! Closing the program." << endl;
    193209                this->stop();
    194210                break;
     
    203219            catch (...)
    204220            {
    205                 COUT(0) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << std::endl;
    206                 COUT(0) << "This should really never happen! Closing the program." << std::endl;
     221                orxout(user_error) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << endl;
     222                orxout(user_error) << "This should really never happen! Closing the program." << endl;
    207223                this->stop();
    208224                break;
     
    217233                this->updateFPSLimiter();
    218234        }
     235
     236        orxout(internal_status) << "finished main loop" << endl;
     237        orxout(internal_status) << "--------------------------------------------------" << endl;
    219238
    220239        // UNLOAD all remaining states
     
    241260                catch (...)
    242261                {
    243                     COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl;
     262                    orxout(user_error) << "Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << endl;
    244263                    // All scheduled operations have now been rendered inert --> flush them and issue a warning
    245264                    if (this->requestedStateNodes_.size() > 1)
    246                         COUT(4) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << std::endl;
     265                        orxout(internal_info) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << endl;
    247266                    this->requestedStateNodes_.clear();
    248267                    break;
     
    272291            catch (...)
    273292            {
    274                 COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl;
    275                 COUT(1) << "This should really never happen!" << std::endl;
    276                 COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl;
     293                orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl;
     294                orxout(user_error) << "This should really never happen!" << endl;
     295                orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
    277296                shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
    278297                while (current->name_ != (*it)->getName() && current)
     
    338357    void Game::stop()
    339358    {
     359        orxout(user_status) << "Exit" << endl;
    340360        this->bAbort_ = true;
    341361    }
     
    355375        if (!this->checkState(name))
    356376        {
    357             COUT(2) << "Warning: GameState named '" << name << "' doesn't exist!" << std::endl;
     377            orxout(user_warning) << "GameState named '" << name << "' doesn't exist!" << endl;
    358378            return;
    359379        }
     
    361381        if (this->bChangingState_)
    362382        {
    363             COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;
     383            orxout(user_warning) << "Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << endl;
    364384            return;
    365385        }
     
    372392        if (name == lastRequestedNode->name_)
    373393        {
    374             COUT(2) << "Warning: Requesting the currently active state! Ignoring." << std::endl;
     394            orxout(user_warning) << "Requesting the currently active state! Ignoring." << endl;
    375395            return;
    376396        }
     
    403423
    404424        if (requestedNodes.empty())
    405             COUT(1) << "Error: Requested GameState transition is not allowed. Ignoring." << std::endl;
     425            orxout(user_error) << "Requested GameState transition is not allowed. Ignoring." << endl;
    406426        else
    407427            this->requestedStateNodes_.insert(requestedStateNodes_.end(), requestedNodes.begin(), requestedNodes.end());
     
    425445            this->requestState(lastRequestedNode->parent_.lock()->name_);
    426446        else
    427             COUT(2) << "Warning: Can't pop the internal dummy root GameState" << std::endl;
     447            orxout(internal_warning) << "Can't pop the internal dummy root GameState" << endl;
    428448    }
    429449
     
    437457            std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name);
    438458            if (it != gameStateDeclarations_s.end())
    439                 COUT(1) << "Error: GameState '" << name << "' has not yet been loaded." << std::endl;
     459                orxout(internal_error) << "GameState '" << name << "' has not yet been loaded." << endl;
    440460            else
    441                 COUT(1) << "Error: Could not find GameState '" << name << "'." << std::endl;
     461                orxout(internal_error) << "Could not find GameState '" << name << "'." << endl;
    442462            return shared_ptr<GameState>();
    443463        }
     
    507527        if (!GameMode::showsGraphics())
    508528        {
     529            orxout(user_status) << "Loading graphics" << endl;
     530            orxout(internal_info) << "loading graphics in Game" << endl;
     531
    509532            core_->loadGraphics();
    510533            Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
     
    524547            }
    525548            graphicsUnloader.Dismiss();
     549
     550            orxout(internal_info) << "finished loading graphics in Game" << endl;
    526551        }
    527552    }
     
    531556        if (GameMode::showsGraphics())
    532557        {
     558            orxout(user_status) << "Unloading graphics" << endl;
     559            orxout(internal_info) << "unloading graphics in Game" << endl;
     560
    533561            // Destroy all the GameStates that require graphics
    534562            for (GameStateMap::iterator it = constructedStates_.begin(); it != constructedStates_.end();)
     
    555583    void Game::loadState(const std::string& name)
    556584    {
     585        orxout(internal_status) << "loading state '" << name << "'" << endl;
     586
    557587        this->bChangingState_ = true;
    558588        LOKI_ON_BLOCK_EXIT_OBJ(*this, &Game::resetChangingState); (void)LOKI_ANONYMOUS_VARIABLE(scopeGuard);
     
    577607    void Game::unloadState(const std::string& name)
    578608    {
     609        orxout(internal_status) << "unloading state '" << name << "'" << endl;
     610
    579611        this->bChangingState_ = true;
    580612        try
     
    589621        catch (...)
    590622        {
    591             COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl;
    592             COUT(2) << "         There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl;
     623            orxout(internal_warning) << "Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << endl;
     624            orxout(internal_warning) << "There might be potential resource leaks involved! To avoid this, improve exception-safety." << endl;
    593625        }
    594626        // Check if graphics is still required
  • code/trunk/src/libraries/core/Game.h

    r8423 r8858  
    4747#include <boost/preprocessor/cat.hpp>
    4848
    49 #include "util/Debug.h"
     49#include "util/Output.h"
    5050#include "util/DestructionHelper.h"
    5151#include "util/Singleton.h"
     
    215215        else
    216216        {
    217             COUT(0) << "Error: Cannot declare two GameStates with the same name." << std::endl;
    218             COUT(0) << "       Ignoring second one ('" << stateName << "')." << std::endl;
     217            orxout(internal_warning) << "Cannot declare two GameStates with the same name." << endl;
     218            orxout(internal_warning) << "Ignoring second one ('" << stateName << "')." << endl;
    219219        }
    220220
  • code/trunk/src/libraries/core/GameState.cc

    r6417 r8858  
    3535#include "GameState.h"
    3636
    37 #include "util/Debug.h"
    3837#include "util/Exception.h"
    3938#include "util/OrxAssert.h"
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r8423 r8858  
    104104        RegisterObject(GraphicsManager);
    105105
     106        orxout(internal_status) << "initializing GraphicsManager..." << endl;
    106107        this->setConfigValues();
    107108
     
    114115        resources_.reset(new XMLFile("DefaultResources.oxr"));
    115116        resources_->setLuaSupport(false);
    116         Loader::open(resources_.get());
     117        Loader::open(resources_.get(), ClassTreeMask(), false);
    117118
    118119        // Only for runs in the build directory (not installed)
     
    122123        extResources_.reset(new XMLFile("resources.oxr"));
    123124        extResources_->setLuaSupport(false);
    124         Loader::open(extResources_.get());
     125        Loader::open(extResources_.get(), ClassTreeMask(), false);
    125126
    126127        if (bLoadRenderer)
     
    129130            this->upgradeToGraphics();
    130131        }
     132
     133        orxout(internal_status) << "finished initializing GraphicsManager" << endl;
    131134    }
    132135
    133136    void GraphicsManager::destroy()
    134137    {
     138        orxout(internal_status) << "destroying GraphicsManager..." << endl;
     139
    135140        Loader::unload(debugOverlay_.get());
    136141
     
    148153        safeObjectDelete(&ogreLogger_);
    149154        safeObjectDelete(&ogreWindowEventListener_);
     155
     156        orxout(internal_status) << "finished destroying GraphicsManager" << endl;
    150157    }
    151158
     
    158165        SetConfigValue(ogreLogFile_,     "ogre.log")
    159166            .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
    160         SetConfigValue(ogreLogLevelTrivial_ , 5)
    161             .description("Corresponding orxonox debug level for ogre Trivial");
    162         SetConfigValue(ogreLogLevelNormal_  , 4)
    163             .description("Corresponding orxonox debug level for ogre Normal");
    164         SetConfigValue(ogreLogLevelCritical_, 2)
    165             .description("Corresponding orxonox debug level for ogre Critical");
    166167    }
    167168
     
    179180            return;
    180181
     182        orxout(internal_info) << "GraphicsManager upgrade to graphics" << endl;
     183
    181184        // load all the required plugins for Ogre
    182185        this->loadOgrePlugins();
     
    189192        // choose another resource group.
    190193        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     194
     195        orxout(internal_info) << "GraphicsManager finished upgrade to graphics" << endl;
    191196    }
    192197
     
    197202    void GraphicsManager::loadOgreRoot()
    198203    {
    199         COUT(3) << "Setting up Ogre..." << std::endl;
     204        orxout(internal_info) << "Setting up Ogre..." << endl;
    200205
    201206        if (ogreConfigFile_.empty())
    202207        {
    203             COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
     208            orxout(internal_warning) << "Ogre config file set to \"\". Defaulting to config.cfg" << endl;
    204209            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
    205210        }
    206211        if (ogreLogFile_.empty())
    207212        {
    208             COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
     213            orxout(internal_warning) << "Ogre log file set to \"\". Defaulting to ogre.log" << endl;
    209214            ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
    210215        }
     
    216221        // Ogre::Root will detect that we've already created a Log
    217222        ogreLogger_ = new Ogre::LogManager();
    218         COUT(4) << "Ogre LogManager created" << std::endl;
     223        orxout(internal_info) << "Ogre LogManager created" << endl;
    219224
    220225        // create our own log that we can listen to
    221226        Ogre::Log *myLog;
    222227        myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
    223         COUT(4) << "Ogre Log created" << std::endl;
     228        orxout(internal_info) << "Ogre Log created" << endl;
    224229
    225230        myLog->setLogDetail(Ogre::LL_BOREME);
    226231        myLog->addListener(this);
    227232
    228         COUT(4) << "Creating Ogre Root..." << std::endl;
     233        orxout(internal_info) << "Creating Ogre Root..." << endl;
    229234
    230235        // check for config file existence because Ogre displays (caught) exceptions if not
     
    240245        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
    241246
    242         COUT(3) << "Ogre set up done." << std::endl;
     247        orxout(internal_info) << "Ogre set up done." << endl;
    243248    }
    244249
    245250    void GraphicsManager::loadOgrePlugins()
    246251    {
     252        orxout(internal_info) << "loading ogre plugins" << endl;
     253
    247254        // Plugin path can have many different locations...
    248255        std::string pluginPath = specialConfig::ogrePluginsDirectory;
     
    277284    void GraphicsManager::loadRenderer()
    278285    {
    279         CCOUT(4) << "Configuring Renderer" << std::endl;
     286        orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl;
    280287
    281288        bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp();
    282289        if (updatedConfig)
    283             COUT(2) << "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << std::endl;
     290            orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl;
    284291
    285292        if (!ogreRoot_->restoreConfig() || updatedConfig)
     
    291298        }
    292299
    293         CCOUT(4) << "Creating render window" << std::endl;
     300        orxout(internal_info) << "Creating render window" << endl;
    294301
    295302        this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox");
     
    317324    {
    318325        // Load debug overlay to show info about fps and tick time
    319         COUT(4) << "Loading Debug Overlay..." << std::endl;
     326        orxout(internal_info) << "Loading Debug Overlay..." << endl;
    320327        debugOverlay_.reset(new XMLFile("debug.oxo"));
    321         Loader::open(debugOverlay_.get());
     328        Loader::open(debugOverlay_.get(), ClassTreeMask(), false);
    322329    }
    323330
     
    396403        Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName)
    397404    {
    398         int orxonoxLevel;
     405        OutputLevel orxonoxLevel;
    399406        std::string introduction;
    400407        // Do not show caught OGRE exceptions in front
    401408        if (message.find("EXCEPTION") != std::string::npos)
    402409        {
    403             orxonoxLevel = OutputLevel::Debug;
     410            orxonoxLevel = level::internal_error;
    404411            introduction = "Ogre, caught exception: ";
    405412        }
     
    409416            {
    410417            case Ogre::LML_TRIVIAL:
    411                 orxonoxLevel = this->ogreLogLevelTrivial_;
     418                orxonoxLevel = level::verbose_more;
    412419                break;
    413420            case Ogre::LML_NORMAL:
    414                 orxonoxLevel = this->ogreLogLevelNormal_;
     421                orxonoxLevel = level::verbose;
    415422                break;
    416423            case Ogre::LML_CRITICAL:
    417                 orxonoxLevel = this->ogreLogLevelCritical_;
     424                orxonoxLevel = level::internal_warning;
    418425                break;
    419426            default:
    420                 orxonoxLevel = 0;
     427                orxonoxLevel = level::debug_output;
    421428            }
    422429            introduction = "Ogre: ";
    423430        }
    424         OutputHandler::getOutStream(orxonoxLevel)
    425             << introduction << message << std::endl;
     431
     432        orxout(orxonoxLevel, context::ogre) << introduction << message << endl;
    426433    }
    427434
  • code/trunk/src/libraries/core/GraphicsManager.h

    r8706 r8858  
    134134        std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
    135135        std::string         ogreLogFile_;              //!< log filename for Ogre log messages
    136         int                 ogreLogLevelTrivial_;      //!< Corresponding Orxonox debug level for LL_TRIVIAL
    137         int                 ogreLogLevelNormal_;       //!< Corresponding Orxonox debug level for LL_NORMAL
    138         int                 ogreLogLevelCritical_;     //!< Corresponding Orxonox debug level for LL_CRITICAL
    139136
    140137        /// Helper object that executes the surrogate destructor destroy()
  • code/trunk/src/libraries/core/Identifier.cc

    r8267 r8858  
    130130        {
    131131            // If no: We have to store the information and initialize the Identifier
    132             COUT(4) << "*** ClassIdentifier: Register Class in " << this->getName() << "-Singleton -> Initialize Singleton." << std::endl;
     132            orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;
    133133            if (bRootClass)
    134134                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.
     
    144144    void Identifier::initialize(std::set<const Identifier*>* parents)
    145145    {
    146         COUT(4) << "*** Identifier: Initialize " << this->name_ << "-Singleton." << std::endl;
     146        orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;
    147147        this->bCreatedOneObject_ = true;
    148148
     
    191191    void Identifier::createClassHierarchy()
    192192    {
    193         COUT(3) << "*** Identifier: Create class-hierarchy" << std::endl;
     193        orxout(internal_status) << "Create class-hierarchy" << endl;
    194194        Identifier::startCreatingHierarchy();
    195195        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMap().begin(); it != Identifier::getStringIdentifierMap().end(); ++it)
     
    203203        }
    204204        Identifier::stopCreatingHierarchy();
    205         COUT(3) << "*** Identifier: Finished class-hierarchy creation" << std::endl;
     205        orxout(internal_status) << "Finished class-hierarchy creation" << endl;
    206206    }
    207207
     
    242242        else
    243243        {
    244             COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
    245             COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
    246             COUT(1) << "Aborting..." << std::endl;
     244            orxout(user_error) << "An error occurred in Identifier.cc:" << endl;
     245            orxout(user_error) << "Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << endl;
     246            orxout(user_error) << "Aborting..." << endl;
    247247            abort();
    248248            return 0;
     
    404404        if (it != this->configValues_.end())
    405405        {
    406             COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << std::endl;
     406            orxout(internal_warning) << "Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << endl;
    407407            delete (it->second);
    408408        }
     
    450450        if (it != this->xmlportParamContainers_.end())
    451451        {
    452             COUT(2) << "Warning: Overwriting XMLPortParamContainer in class " << this->getName() << '.' << std::endl;
     452            orxout(internal_warning) << "Overwriting XMLPortParamContainer in class " << this->getName() << '.' << endl;
    453453            delete (it->second);
    454454        }
     
    481481        if (it != this->xmlportObjectContainers_.end())
    482482        {
    483             COUT(2) << "Warning: Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << std::endl;
     483            orxout(internal_warning) << "Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << endl;
    484484            delete (it->second);
    485485        }
  • code/trunk/src/libraries/core/Identifier.h

    r8706 r8858  
    6464    for (Iterator<BaseObject> it = objects.begin(); it != objects.end(); ++it)  // iterate through the objects
    6565        ++count;
    66     COUT(0) << count << std::endl;                                              // prints "2" because we created 2 instances of MyClass so far
     66    orxout() << count << endl;                                                  // prints "2" because we created 2 instances of MyClass so far
    6767
    6868
     
    8989#include <loki/TypeTraits.h>
    9090
    91 #include "util/Debug.h"
     91#include "util/Output.h"
    9292#include "MetaObjectList.h"
    9393#include "ObjectList.h"
     
    405405        if (ClassIdentifier<T>::classIdentifier_s == proposal)
    406406        {
    407             COUT(4) << "*** Identifier: Requested Identifier for " << name << " was not yet existing and got created." << std::endl;
     407            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was not yet existing and got created." << endl;
    408408        }
    409409        else
    410410        {
    411             COUT(4) << "*** Identifier: Requested Identifier for " << name << " was already existing and got assigned." << std::endl;
     411            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was already existing and got assigned." << endl;
    412412        }
    413413    }
     
    423423    {
    424424        if (bRootClass)
    425             COUT(5) << "*** Register Root-Object: " << className << std::endl;
     425            orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl;
    426426        else
    427             COUT(5) << "*** Register Object: " << className << std::endl;
     427            orxout(verbose, context::object_list) << "Register Object: " << className << endl;
    428428
    429429        object->identifier_ = this;
     
    444444        else
    445445        {
    446             COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
     446            orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
    447447            object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
    448448
  • code/trunk/src/libraries/core/Language.cc

    r7401 r8858  
    3535
    3636#include <fstream>
    37 #include "util/Debug.h"
     37#include "util/Output.h"
    3838#include "util/StringUtils.h"
    3939#include "Core.h"
     
    131131        }
    132132
    133         COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << std::endl;
     133        orxout(internal_warning, context::language) << "Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << endl;
    134134        return it->second;
    135135    }
     
    142142    void Language::addEntry(const LanguageEntryLabel& label, const std::string& entry)
    143143    {
    144         COUT(5) << "Language: Called addEntry with\n  label: " << label << "\n  entry: " <<  entry << std::endl;
     144        orxout(verbose, context::language) << "Called addEntry with" << '\n' << "label: " << label << '\n' << "entry: " <<  entry << endl;
    145145        std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(label);
    146146        if (it == this->languageEntries_.end())
     
    179179        {
    180180            // Uh, oh, an undefined entry was requested: return the default string
    181             COUT(2) << "Warning: Language entry \"" << label << "\" not found!" << std::endl;
     181            orxout(internal_warning, context::language) << "Language entry \"" << label << "\" not found!" << endl;
    182182            return this->defaultLocalisation_;
    183183        }
     
    201201    void Language::readDefaultLanguageFile()
    202202    {
    203         COUT(4) << "Read default language file." << std::endl;
     203        orxout(internal_info, context::language) << "Read default language file." << endl;
    204204
    205205        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
     
    216216        if (!file.is_open())
    217217        {
    218             COUT(1) << "An error occurred in Language.cc:" << std::endl;
    219             COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
     218            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
     219            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << endl;
    220220            return;
    221221        }
     
    237237                else
    238238                {
    239                     COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << std::endl;
     239                    orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << endl;
    240240                }
    241241            }
     
    250250    void Language::readTranslatedLanguageFile()
    251251    {
    252         COUT(4) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << std::endl;
     252        orxout(internal_info, context::language) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << endl;
    253253
    254254        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getLanguage());
     
    260260        if (!file.is_open())
    261261        {
    262             COUT(1) << "An error occurred in Language.cc:" << std::endl;
    263             COUT(1) << "Error: Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << std::endl;
     262            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
     263            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << endl;
    264264            Core::getInstance().resetLanguage();
    265             COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << '.' << std::endl;
     265            orxout(internal_info, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl;
    266266            return;
    267267        }
     
    291291                else
    292292                {
    293                     COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << std::endl;
     293                    orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << endl;
    294294                }
    295295            }
     
    304304    void Language::writeDefaultLanguageFile() const
    305305    {
    306         COUT(4) << "Language: Write default language file." << std::endl;
     306        orxout(verbose, context::language) << "Write default language file." << endl;
    307307
    308308        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
     
    314314        if (!file.is_open())
    315315        {
    316             COUT(1) << "An error occurred in Language.cc:" << std::endl;
    317             COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
     316            orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
     317            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << endl;
    318318            return;
    319319        }
     
    322322        for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
    323323        {
    324             file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl;
     324            file << it->second->getLabel() << '=' << it->second->getDefault() << endl;
    325325        }
    326326
  • code/trunk/src/libraries/core/Language.h

    r7401 r8858  
    5151     - Get the localisation of the entry in the configured language:
    5252       @code
    53        std::cout << Language::getInstance()->getLocalisation("name of the entry") << std::endl;
     53       orxout() << Language::getInstance()->getLocalisation("name of the entry") << endl;
    5454       @endcode
    5555
     
    5858    int age = 20;
    5959    AddLanguageEntry("user_age", "Age");
    60     std::cout << GetLocalisation("user_age") << ": " << age << std::endl;
     60    orxout() << GetLocalisation("user_age") << ": " << age << endl;
    6161    @endcode
    6262
  • code/trunk/src/libraries/core/Loader.cc

    r8108 r8858  
    3333#include <boost/scoped_ptr.hpp>
    3434
    35 #include "util/Debug.h"
     35#include "util/Output.h"
    3636#include "util/Exception.h"
    3737#include "util/StringUtils.h"
     
    4949    ClassTreeMask Loader::currentMask_s;
    5050
    51     bool Loader::open(const XMLFile* file, const ClassTreeMask& mask)
     51    bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
    5252    {
    5353        Loader::add(file, mask);
    54         return Loader::load(file, mask);
     54        return Loader::load(file, mask, bVerbose);
    5555    }
    5656
     
    9393    @param mask
    9494        A ClassTreeMask, which defines which types of classes are loaded and which aren't.
    95     @param verbose
     95    @param bVerbose
    9696        Whether the loader is verbose (prints its progress in a low output level) or not.
    9797    @return
    9898        Returns true if successful.
    9999    */
    100     bool Loader::load(const ClassTreeMask& mask, bool verbose)
     100    bool Loader::load(const ClassTreeMask& mask, bool bVerbose)
    101101    {
    102102        bool success = true;
    103103        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    104             if (!Loader::load(it->first, it->second * mask, verbose))
     104            if (!Loader::load(it->first, it->second * mask, bVerbose))
    105105                success = false;
    106106
     
    124124    @param mask
    125125        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
    126     @param verbose
     126    @param bVerbose
    127127        Whether the loader is verbose (prints its progress in a low output level) or not.
    128128    @return
    129129        Returns true if successful.
    130130    */
    131     bool Loader::reload(const ClassTreeMask& mask, bool verbose)
     131    bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
    132132    {
    133133        Loader::unload(mask);
    134         return Loader::load(mask, verbose);
     134        return Loader::load(mask, bVerbose);
    135135    }
    136136
     
    142142    @param mask
    143143        A ClassTreeMask, which defines which types of classes are loaded and which aren't.
    144     @param verbose
     144    @param bVerbose
    145145        Whether the loader is verbose (prints its progress in a low output level) or not.
    146146    @param bRemoveLuaTags
     
    149149        Returns true if successful.
    150150    */
    151     bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose, bool bRemoveLuaTags)
     151    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose, bool bRemoveLuaTags)
    152152    {
    153153        if (!file)
     
    170170            if (info == NULL)
    171171            {
    172                 COUT(1) << "Error: Could not find XML file '" << file->getFilename() << "'." << std::endl;
     172                orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl;
    173173                return false;
    174174            }
     
    187187        try
    188188        {
    189             if(verbose)
    190             {
    191                 COUT(0) << "Start loading " << file->getFilename() << "..." << std::endl;
    192                 COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
    193             }
    194             else
    195             {
    196                 COUT(4) << "Start loading " << file->getFilename() << "..." << std::endl;
    197                 COUT(4) << "Mask: " << Loader::currentMask_s << std::endl;
     189            if(bVerbose)
     190            {
     191                orxout(user_info) << "Start loading " << file->getFilename() << "..." << endl;
     192                orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s << endl;
     193            }
     194            else
     195            {
     196                orxout(verbose, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
     197                orxout(verbose_more, context::loader) << "Mask: " << Loader::currentMask_s << endl;
    198198            }
    199199
     
    208208                rootElement.InsertEndChild(*child);
    209209
    210             COUT(4) << "  creating root-namespace..." << std::endl;
     210            orxout(verbose, context::loader) << "  creating root-namespace..." << endl;
    211211            Namespace* rootNamespace = new Namespace(0);
    212212            rootNamespace->setLoaderIndentation("    ");
     
    216216            rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
    217217
    218             if(verbose)
    219                 COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
    220             else
    221                 COUT(4) << "Finished loading " << file->getFilename() << '.' << std::endl;
    222 
    223             COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString("  ") << std::endl;
     218            if(bVerbose)
     219                orxout(user_info) << "Finished loading " << file->getFilename() << '.' << endl;
     220            else
     221                orxout(verbose, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
     222
     223            orxout(verbose, context::loader) << "Namespace-tree:" << '\n' << rootNamespace->toString("  ") << endl;
    224224
    225225            return true;
     
    227227        catch (ticpp::Exception& ex)
    228228        {
    229             COUT(1) << std::endl;
    230             COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    231             COUT(1) << ex.what() << std::endl;
    232             COUT(1) << "Loading aborted." << std::endl;
     229            orxout(user_error, context::loader) << endl;
     230            orxout(user_error, context::loader) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
     231            orxout(user_error, context::loader) << ex.what() << endl;
     232            orxout(user_error, context::loader) << "Loading aborted." << endl;
    233233            return false;
    234234        }
    235235        catch (Exception& ex)
    236236        {
    237             COUT(1) << std::endl;
    238             COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    239             COUT(1) << ex.what() << std::endl;
    240             COUT(1) << "Loading aborted." << std::endl;
     237            orxout(user_error, context::loader) << endl;
     238            orxout(user_error, context::loader) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
     239            orxout(user_error, context::loader) << ex.what() << endl;
     240            orxout(user_error, context::loader) << "Loading aborted." << endl;
    241241            return false;
    242242        }
    243243        catch (...)
    244244        {
    245             COUT(1) << std::endl;
    246             COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    247             COUT(1) << Exception::handleMessage() << std::endl;
    248             COUT(1) << "Loading aborted." << std::endl;
     245            orxout(user_error, context::loader) << endl;
     246            orxout(user_error, context::loader) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
     247            orxout(user_error, context::loader) << Exception::handleMessage() << endl;
     248            orxout(user_error, context::loader) << "Loading aborted." << endl;
    249249            return false;
    250250        }
     
    271271    @param mask
    272272        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
    273     @param verbose
     273    @param bVerbose
    274274        Whether the loader is verbose (prints its progress in a low output level) or not.
    275275    @return
    276276        Returns true if successful.
    277277    */
    278     bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool verbose)
     278    bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
    279279    {
    280280        Loader::unload(file, mask);
    281         return Loader::load(file, mask, verbose);
     281        return Loader::load(file, mask, bVerbose);
    282282    }
    283283
     
    337337            if (!expectedValue)
    338338            {
    339                 COUT(2) << "Warning: Error in level file" << std::endl;
     339                orxout(internal_error, context::loader) << "Error in level file" << endl;
    340340                // TODO: error handling
    341                 return false; 
     341                return false;
    342342            }
    343343        }
  • code/trunk/src/libraries/core/Loader.h

    r8079 r8858  
    5151    {
    5252        public:
    53             static bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
     53            static bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    5454            static void close();
    5555            static void close(const XMLFile* file);
     
    5858            static void remove(const XMLFile* file);
    5959
    60             static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
     60            static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    6161            static void unload(const ClassTreeMask& mask = ClassTreeMask());
    62             static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
     62            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    6363
    6464            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
    65                              bool verbose = true, bool bRemoveLuaTags = false);
     65                             bool bVerbose = true, bool bRemoveLuaTags = false);
    6666            static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
    67             static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
     67            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    6868
    6969            static std::string replaceLuaTags(const std::string& text);
  • code/trunk/src/libraries/core/LuaState.cc

    r8729 r8858  
    3737#include <loki/ScopeGuard.h>
    3838
    39 #include "util/Debug.h"
     39#include "util/Output.h"
    4040#include "util/Exception.h"
    4141#include "Resource.h"
     
    9696        else
    9797        {
    98             COUT(2) << "LuaState: Cannot include file '" << filename << "' (not found)." << std::endl;
     98            orxout(internal_warning, context::lua) << "LuaState: Cannot include file '" << filename << "' (not found)." << endl;
    9999            return false;
    100100        }
     
    136136        else
    137137        {
    138             COUT(2) << "LuaState: Cannot do file '" << filename << "' (not found)." << std::endl;
     138            orxout(internal_warning, context::lua) << "LuaState: Cannot do file '" << filename << "' (not found)." << endl;
    139139            return false;
    140140        }
     
    176176        {
    177177        case LUA_ERRSYNTAX: // Syntax error
    178             COUT(1) << "Lua syntax error: " << lua_tostring(luaState_, -1) << std::endl;
     178            orxout(internal_error, context::lua) << "Lua syntax error: " << lua_tostring(luaState_, -1) << endl;
    179179            break;
    180180        case LUA_ERRMEM:    // Memory allocation error
    181             COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
     181            orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
    182182            break;
    183183        }
     
    200200                    std::string errorString = lua_tostring(this->luaState_, -1);
    201201                    if (errorString.find("Error propagation") == std::string::npos)
    202                         COUT(1) << "Lua runtime error: " << errorString << std::endl;
     202                        orxout(internal_error, context::lua) << "Lua runtime error: " << errorString << endl;
    203203                }
    204204                break;
    205205            case LUA_ERRERR: // Error in the error handler
    206                 COUT(1) << "Lua error in error handler. No message available." << std::endl;
     206                orxout(internal_error, context::lua) << "Lua error in error handler. No message available." << endl;
    207207                break;
    208208            case LUA_ERRMEM: // Memory allocation error
    209                 COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
     209                orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
    210210                break;
    211211            }
     
    236236    }
    237237
    238     void LuaState::luaLog(unsigned int level, const std::string& message)
    239     {
    240         OutputHandler::getOutStream(level) << message << std::endl;
     238    void LuaState::luaOutput(OutputLevel level, const std::string& context, const std::string& message)
     239    {
     240        orxout(level, registerContext(context)) << message << endl;
     241    }
     242
     243    void LuaState::luaOutput(OutputLevel level, const std::string& message)
     244    {
     245        orxout(level, context::lua) << message << endl;
     246    }
     247
     248    void LuaState::luaOutput(const std::string& message)
     249    {
     250        orxout(debug_output, context::lua) << message << endl;
    241251    }
    242252
     
    288298            if (it->first == name || it->second == function)
    289299            {
    290                 COUT(2) << "Warning: Trying to add a Tolua interface with the same name or function." << std::endl;
     300                orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl;
    291301                return true;
    292302            }
     
    307317        if (it == getToluaInterfaces().end())
    308318        {
    309             COUT(2) << "Warning: Cannot remove Tolua interface '" << name << "': Not found" << std::endl;
     319            orxout(internal_warning, context::lua) << "Cannot remove Tolua interface '" << name << "': Not found" << endl;
    310320            return true;
    311321        }
  • code/trunk/src/libraries/core/LuaState.h

    r8729 r8858  
    4949#include <boost/shared_ptr.hpp>
    5050
     51#include "util/Output.h"
     52
    5153namespace orxonox // tolua_export
    5254{ // tolua_export
     
    8385
    8486        void luaPrint(const std::string& str); // tolua_export
    85         void luaLog(unsigned int level, const std::string& message); // tolua_export
     87        void luaOutput(orxonox::level::OutputLevel level, const std::string& context, const std::string& message); // tolua_export
     88        void luaOutput(orxonox::level::OutputLevel level, const std::string& message); // tolua_export
     89        void luaOutput(const std::string& message); // tolua_export
    8690        bool fileExists(const std::string& filename); // tolua_export
    8791        std::string getSourceCode(const std::string& filename); // tolua_export
  • code/trunk/src/libraries/core/MetaObjectList.cc

    r5738 r8858  
    3434#include "MetaObjectList.h"
    3535
    36 #include "util/Debug.h"
     36#include "util/Output.h"
    3737#include "Identifier.h"
    3838#include "ObjectListBase.h"
     
    4848    MetaObjectListElement::~MetaObjectListElement()
    4949    {
    50         COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl;
     50        orxout(verbose, context::object_list) << "Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << endl;
    5151        this->list_->notifyIterators(this->element_->objectBase_);
    5252
  • code/trunk/src/libraries/core/NamespaceNode.cc

    r6417 r8858  
    2828
    2929#include "NamespaceNode.h"
    30 #include "util/Debug.h"
     30#include "util/Output.h"
    3131
    3232namespace orxonox
     
    7070                if (this->bRoot_)
    7171                {
    72                     COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << std::endl;
     72                    orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << endl;
    7373                    nodes = this->getNodeRelative(secondPart);
    7474                }
    7575                else if (!this->parent_)
    7676                {
    77                     COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << std::endl;
     77                    orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << endl;
    7878                    nodes = this->getNodeRelative(secondPart);
    7979                }
     
    9191                if (it->second->isHidden())
    9292                {
    93                     COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl;
     93                    orxout(internal_warning) << "Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << endl;
    9494                    nodes.insert(this);
    9595                }
     
    115115                if (!bFoundMatchingNamespace)
    116116                {
    117                     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;
     117                    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;
    118118                    nodes = this->getNodeRelative(secondPart);
    119119                }
  • code/trunk/src/libraries/core/OrxonoxClass.cc

    r7849 r8858  
    6060    {
    6161//        if (!this->requestedDestruction_)
    62 //            COUT(2) << "Warning: Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << std::endl;
     62//            orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;
    6363
    6464        assert(this->referenceCount_ <= 0);
  • code/trunk/src/libraries/core/OrxonoxClass.h

    r8729 r8858  
    4949#include <vector>
    5050#include "Super.h"
    51 
    52 /**
    53 @def CCOUT
    54     Acts almost exactly like COUT(x), but prepends "ClassName: "
    55 */
    56 #define CCOUT(level) \
    57     COUT(level) << this->getIdentifier()->getName() << ": "
    5851
    5952namespace orxonox
  • code/trunk/src/libraries/core/PathConfig.cc

    r8729 r8858  
    5151
    5252#include "SpecialConfig.h"
    53 #include "util/Debug.h"
     53#include "util/Output.h"
    5454#include "util/Exception.h"
    5555#include "CommandLineParser.h"
     
    137137        if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
    138138        {
    139             COUT(1) << "Running from the build tree." << std::endl;
     139            orxout(internal_info) << "Running from the build tree." << endl;
    140140            PathConfig::bBuildDirectoryRun_ = true;
    141141            modulePath_ = specialConfig::moduleDevDirectory;
     
    247247            if (bf::create_directories(it->first)) // function may not return true at all (bug?)
    248248            {
    249                 COUT(4) << "Created " << it->second << " directory" << std::endl;
     249                orxout(internal_info) << "Created " << it->second << " directory" << endl;
    250250            }
    251251        }
  • code/trunk/src/libraries/core/SubclassIdentifier.h

    r7401 r8858  
    6969
    7070#include <cstdlib>
    71 #include "util/Debug.h"
     71#include "util/Output.h"
    7272#include "Identifier.h"
    7373
     
    119119                if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
    120120                {
    121                     COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
     121                    orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
    122122                    if (identifier)
    123123                    {
    124                         COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
    125                         COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
     124                        orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
     125                        orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
    126126                    }
    127127                    else
    128128                    {
    129                         COUT(1) << "Error: Can't assign NULL identifier" << std::endl;
     129                        orxout(internal_error) << "Can't assign NULL identifier" << endl;
    130130                    }
    131131                }
     
    177177                    if (this->identifier_)
    178178                    {
    179                         COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    180                         COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
    181                         COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
     179                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
     180                        orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
     181                        orxout(user_error) << "Couldn't fabricate a new Object." << endl;
    182182                    }
    183183                    else
    184184                    {
    185                         COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    186                         COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
    187                     }
    188 
    189                     COUT(1) << "Aborting..." << std::endl;
     185                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
     186                        orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
     187                    }
     188
     189                    orxout(user_error) << "Aborting..." << endl;
    190190                    abort();
    191191                    return 0;
  • code/trunk/src/libraries/core/Super.h

    r8729 r8858  
    7373
    7474#include "CorePrereqs.h"
    75 #include "util/Debug.h"
     75#include "util/Output.h"
    7676
    7777///////////////////////
     
    114114                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
    115115                    { \
    116                         COUT(5) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl; \
     116                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
    117117                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
    118118                    } \
     
    184184                    {
    185185                        // Add the SuperFunctionCaller
    186                         COUT(5) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
     186                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
    187187                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
    188188                    }
  • code/trunk/src/libraries/core/Template.cc

    r7163 r8858  
    3232#include <tinyxml/ticpp.h>
    3333
    34 #include "util/Debug.h"
     34#include "util/Output.h"
    3535#include "CoreIncludes.h"
    3636#include "XMLPort.h"
     
    8888            it = Template::getTemplateMap().find(this->getName());
    8989            if (it != Template::getTemplateMap().end())
    90                 COUT(2) << "Warning: Template with name \"" << this->getName() << "\" already exists." << std::endl;
     90                orxout(internal_warning, context::templates) << "Template with name \"" << this->getName() << "\" already exists." << endl;
    9191            else
    9292                Template::getTemplateMap()[this->getName()] = this;
     
    117117                else
    118118                {
    119                     COUT(2) << "Warning: Linking from " << this->getName() << " to " << this->link_ << " leads to an infinite loop. Returning own element." << std::endl;
     119                    orxout(internal_warning, context::templates) << "Linking from \"" << this->getName() << "\" to \"" << this->link_ << "\" leads to an infinite loop. Returning own element." << endl;
    120120                }
    121121            }
    122122            else
    123123            {
    124                 COUT(2) << "Warning: " << this->link_ << " is not an existing Template name. Returning own element." << std::endl;
     124                orxout(internal_warning, context::templates) << '"' << this->link_ << "\" is not an existing Template name. Returning own element." << endl;
    125125            }
    126126        }
     
    142142            if (!object->isA(this->baseclassIdentifier_))
    143143            {
    144                 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;
     144                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;
    145145                return;
    146146            }
    147147        }
    148148
    149         COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl;
     149        orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
    150150
    151151        Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
     
    170170        else
    171171        {
    172             COUT(2) << "Warning: Template with name " << name << " doesn't exist." << std::endl;
     172            orxout(internal_warning, context::templates) << "Template with name " << name << " doesn't exist." << endl;
    173173            return 0;
    174174        }
  • code/trunk/src/libraries/core/WeakPtr.h

    r8079 r8858  
    6565    void myCallback()                                   // definition of the callback function
    6666    {
    67         COUT(0) << "Object destroyed" << std::endl;
     67        orxout() << "Object destroyed" << endl;
    6868    }
    6969
  • code/trunk/src/libraries/core/XMLPort.cc

    r7163 r8858  
    6464                        if (!this->sectionname_.empty())
    6565                        {
    66                             COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a valid classname." << std::endl;
     66                            orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a valid classname." << endl;
    6767                        }
    6868                        else
     
    7474                    if (!identifier->isA(objectIdentifier_))
    7575                    {
    76                         COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << std::endl;
     76                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << endl;
    7777                        continue;
    7878                    }
    7979                    if (!identifier->isLoadable())
    8080                    {
    81                         COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl;
     81                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not loadable." << endl;
    8282                        continue;
    8383                    }
     
    8787                    try
    8888                    {
    89                         COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
     89                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
    9090
    9191                        BaseObject* newObject = identifier->fabricate(object);
     
    9595                        {
    9696                            newObject->XMLPort(*child, XMLPort::LoadObject);
    97                             COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
     97                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
    9898                        }
    9999                        else
    100100                        {
    101                             COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
     101                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
    102102                        }
    103 
    104                         COUT(5) << object->getLoaderIndentation();
    105103
    106104                        this->callLoadExecutor(object, newObject);
     
    109107                            newObject->XMLPort(*child, XMLPort::LoadObject);
    110108
    111                         COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
     109                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << endl;
    112110                    }
    113111                    catch (AbortLoadingException& ex)
    114112                    {
    115                         COUT(1) << "An error occurred while loading object, abort loading..." << std::endl;
     113                        orxout(internal_error, context::xml) << "An error occurred while loading object, abort loading..." << endl;
    116114                        throw ex;
    117115                    }
    118116                    catch (...)
    119117                    {
    120                         COUT(1) << "An error occurred while loading object:" << std::endl;
    121                         COUT(1) << Exception::handleMessage() << std::endl;
     118                        orxout(internal_error, context::xml) << "An error occurred while loading object:" << endl;
     119                        orxout(internal_error, context::xml) << Exception::handleMessage() << endl;
    122120                    }
    123121                }
     
    125123            catch (ticpp::Exception& ex)
    126124            {
    127                 COUT(1) << std::endl;
    128                 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;
    129                 COUT(1) << ex.what() << std::endl;
     125                orxout(internal_error, context::xml) << endl;
     126                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;
     127                orxout(internal_error, context::xml) << ex.what() << endl;
    130128            }
    131129        }
  • code/trunk/src/libraries/core/XMLPort.h

    r7851 r8858  
    5353#include <tinyxml/ticpp.h>
    5454
    55 #include "util/Debug.h"
     55#include "util/Output.h"
    5656#include "util/Exception.h"
    5757#include "util/MultiType.h"
     
    415415                        if ((!attributeValue.empty()) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
    416416                        {
    417                             COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
     417                            orxout(verbose_more, context::xml) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << endl;
    418418                            int error;
    419419                            this->loadexecutor_->parse(object, attributeValue, &error, ",");
     
    430430                    catch (ticpp::Exception& ex)
    431431                    {
    432                         COUT(1) << std::endl;
    433                         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;
    434                         COUT(1) << ex.what() << std::endl;
     432                        orxout(internal_error, context::xml) << endl;
     433                        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;
     434                        orxout(internal_error, context::xml) << ex.what() << endl;
    435435                    }
    436436                }
  • code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r8351 r8858  
    9090            ArgumentCompletionList _groupsandcommands(const std::string& fragment, bool bOnlyShowHidden)
    9191            {
    92                 // note: this function returns only arguments that begin with "fragment", which would't be necessary for the
     92                // note: this function returns only arguments that begin with "fragment", which wouldn't be necessary for the
    9393                //       auto-completion, but it's necessary to place the line-break "\n" between groups and commands
    9494                //       only if both groups AND commands are in the list.
     
    100100                const std::map<std::string, std::map<std::string, ConsoleCommand*> >& commands = ConsoleCommand::getCommands();
    101101                for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group)
    102                     if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find_first_of(fragmentLC) == 0))
     102                    if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find(fragmentLC) == 0))
    103103                        groupList.push_back(ArgumentCompletionListElement(it_group->first, getLowercase(it_group->first)));
    104104
     
    113113                    // add the shortcuts
    114114                    for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)
    115                         if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find_first_of(fragmentLC) == 0))
     115                        if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find(fragmentLC) == 0))
    116116                            groupList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first)));
    117117                }
  • code/trunk/src/libraries/core/command/CommandEvaluation.cc

    r7401 r8858  
    131131
    132132            if (!this->execCommand_)
    133                 *error = CommandExecutor::Error;
     133                *error = CommandExecutor::Inexistent;
    134134            else if (!this->execCommand_->isActive())
    135135                *error = CommandExecutor::Deactivated;
     
    151151            if (this->bEvaluatedArguments_)
    152152            {
    153                 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;
     153                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;
    154154
    155155                // pass as many arguments to the executor as were evaluated (thus the executor can still use additional default values)
     
    186186        {
    187187            if (bPrintError)
    188                 COUT(1) << "Error: Can't evaluate arguments, no console command assigned." << std::endl;
    189             return CommandExecutor::Error;
     188                orxout(internal_error, context::commands) << "Can't evaluate arguments, no console command assigned." << endl;
     189            return CommandExecutor::Inexistent;
    190190        }
    191191
     
    200200            this->bEvaluatedArguments_ = true;
    201201        else if (bPrintError)
    202             COUT(1) << "Error: Can't evaluate arguments, not enough arguments given." << std::endl;
     202            orxout(internal_error, context::commands) << "Can't evaluate arguments, not enough arguments given." << endl;
    203203
    204204        return error;
  • code/trunk/src/libraries/core/command/CommandExecutor.cc

    r7401 r8858  
    6969        @return Returns the error-code (see @ref CommandExecutorErrorCodes "error codes")
    7070    */
    71     /* static */ int CommandExecutor::execute(const std::string& command, bool useTcl)
     71    /* static */ int CommandExecutor::execute(const std::string& command, bool useTcl, bool printErrors)
    7272    {
    7373        int error;
    7474        CommandExecutor::queryMT(command, &error, useTcl);
     75        if (error && printErrors)
     76            orxout(user_error) << "Can't execute \"" << command << "\", " << CommandExecutor::getErrorDescription(error) << ". (execute)" << endl;
    7577        return error;
    7678    }
     
    8587    /* static */ MultiType CommandExecutor::queryMT(const std::string& command, int* error, bool useTcl)
    8688    {
     89        MultiType result;
     90        int error_internal;
     91
    8792        if (useTcl)
    8893        {
    8994            // pass the command to tcl
    90             return TclBind::eval(command, error);
     95            result = TclBind::eval(command, &error_internal);
    9196        }
    9297        else
     
    108113
    109114            // query the command and return its return-value
    110             return evaluation.query(error);
    111         }
     115            result = evaluation.query(&error_internal);
     116        }
     117
     118        if (error)
     119            *error = error_internal;
     120        else if (error_internal)
     121            orxout(user_error) << "Can't execute \"" << command << "\", " << CommandExecutor::getErrorDescription(error_internal) << ". (query)" << endl;
     122
     123        return result;
    112124    }
    113125
     
    172184
    173185    /**
     186        @brief Returns a description of the error code.
     187        @param error The error code
     188    */
     189    /* static */ std::string CommandExecutor::getErrorDescription(int error)
     190    {
     191        switch (error)
     192        {
     193            case CommandExecutor::Inexistent:  return "command doesn't exist";
     194            case CommandExecutor::Incomplete:  return "not enough arguments given";
     195            case CommandExecutor::Deactivated: return "command is not active";
     196            case CommandExecutor::Denied:      return "access denied";
     197            case CommandExecutor::Error:       return "an error occurred";
     198            default: return "";
     199        }
     200    }
     201
     202    /**
    174203        @brief Gets an evaluated command from the cache.
    175204        @param command The command that should be looked up in the cache
     
    261290            if ((tokens.size() == 1 && ConsoleCommand::getCommand(tokens[0])) || (tokens.size() == 2 && ConsoleCommand::getCommand(tokens[0], tokens[1])))
    262291            {
    263                 COUT(1) << "Error: A command with name \"" << alias << "\" already exists." << std::endl;
     292                orxout(user_error) << "A command with name \"" << alias << "\" already exists." << endl;
    264293                return;
    265294            }
     
    271300                createConsoleCommand(tokens[0], tokens[1], executor);
    272301            else
    273                 COUT(1) << "Error: \"" << alias << "\" is not a valid alias name (must have one or two words)." << std::endl;
     302                orxout(user_error) << "\"" << alias << "\" is not a valid alias name (must have one or two words)." << endl;
    274303        }
    275304        else
    276             COUT(1) << "Error: \"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << std::endl;
     305            orxout(user_error) << "\"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << endl;
    277306    }
    278307}
  • code/trunk/src/libraries/core/command/CommandExecutor.h

    r7401 r8858  
    111111// tolua_end
    112112        public:
    113             static int execute(const std::string& command, bool useTcl = true); // tolua_export
     113            static int execute(const std::string& command, bool useTcl = true, bool printErrors = true); // tolua_export
    114114
    115115            static MultiType queryMT(const std::string& command, int* error = 0, bool useTcl = true);
     
    119119
    120120            static const int Success = 0;       ///< Error code for "success" (or no error)
    121             static const int Error = 1;         ///< Error code if the command doesn't exist
     121            static const int Inexistent = 1;    ///< Error code if the command doesn't exist
    122122            static const int Incomplete = 2;    ///< Error code if the command needs more arguments
    123123            static const int Deactivated = 3;   ///< Error code if the command is not active
    124124            static const int Denied = 4;        ///< Error code if the command needs a different access level
     125            static const int Error = 5;         ///< Error code if the command returned an error
     126
     127            static std::string getErrorDescription(int error);
    125128
    126129            static MultiType unhide(const std::string& command);
  • code/trunk/src/libraries/core/command/ConsoleCommand.cc

    r8316 r8858  
    172172                if (!this->executor_->defaultValueSet(i))
    173173                {
    174                     COUT(2) << "Default value " << i << " is missing" << std::endl;
     174                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
    175175                    return false;
    176176                }
     
    202202                if (!executor->defaultValueSet(i))
    203203                {
    204                     COUT(2) << "Default value " << i << " is missing" << std::endl;
     204                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
    205205                    return false;
    206206                }
     
    229229        else
    230230        {
    231             COUT(1) << "Error: Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
     231            orxout(internal_error, context::commands) << "Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
    232232            return false;
    233233        }
     
    256256        else
    257257        {
    258             COUT(1) << "Error: Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
     258            orxout(internal_error, context::commands) << "Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
    259259            return false;
    260260        }
     
    307307            this->pushFunction(new Executor(*this->executor_.get()));
    308308        else
    309             COUT(1) << "Error: Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     309            orxout(internal_error, context::commands) << "Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << endl;
    310310    }
    311311
     
    367367            }
    368368            else if (object)
    369                 COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << std::endl;
     369                orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << endl;
    370370        }
    371371        else if (object)
    372             COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     372            orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << endl;
    373373
    374374        return false;
     
    418418            this->executor_->setDefaultValues(arg1);
    419419        else
    420             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     420            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    421421
    422422        return *this;
     
    431431            this->executor_->setDefaultValues(arg1, arg2);
    432432        else
    433             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     433            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    434434
    435435        return *this;
     
    444444            this->executor_->setDefaultValues(arg1, arg2, arg3);
    445445        else
    446             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     446            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    447447
    448448        return *this;
     
    457457            this->executor_->setDefaultValues(arg1, arg2, arg3, arg4);
    458458        else
    459             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     459            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    460460
    461461        return *this;
     
    470470            this->executor_->setDefaultValues(arg1, arg2, arg3, arg4, arg5);
    471471        else
    472             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     472            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    473473
    474474        return *this;
     
    485485            this->executor_->setDefaultValue(index, arg);
    486486        else
    487             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     487            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    488488
    489489        return *this;
     
    500500            this->argumentCompleter_[index] = completer;
    501501        else
    502             COUT(2) << "Warning: Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << std::endl;
     502            orxout(internal_warning, context::commands) << "Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << endl;
    503503
    504504        return *this;
     
    611611        {
    612612            if (group == "")
    613                 COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
     613                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
    614614            else
    615                 COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
     615                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    616616        }
    617617        return 0;
     
    644644        {
    645645            if (group == "")
    646                 COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
     646                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
    647647            else
    648                 COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
     648                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    649649        }
    650650        return 0;
     
    681681        {
    682682            if (group == "")
    683                 COUT(2) << "Warning: A console command with shortcut \"" << name << "\" already exists." << std::endl;
     683                orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
    684684            else
    685                 COUT(2) << "Warning: A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << std::endl;
     685                orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
    686686        }
    687687        else
  • code/trunk/src/libraries/core/command/ConsoleCommand.h

    r8418 r8858  
    5353    void myCoutFunction(const std::string& text)        // Define a static function
    5454    {
    55         COUT(0) << "Text: " << text << std::endl;       // Print the text to the console
     55        orxout() << "Text: " << text << endl;           // Print the text to the console
    5656    }
    5757
     
    125125    void myOtherCoutFunction(const std::string& text)                       // Define a new static function
    126126    {
    127         COUT(0) << "Uppercase: " << getUppercase(text) << std::endl;        // Print the text in uppercase to the console
     127        orxout() << "Uppercase: " << getUppercase(text) << endl;            // Print the text in uppercase to the console
    128128    }
    129129
  • code/trunk/src/libraries/core/command/ConsoleCommandCompilation.cc

    r8079 r8858  
    3838#include <string>
    3939
    40 #include "util/Debug.h"
     40#include "util/Output.h"
    4141#include "util/ExprParser.h"
    4242#include "util/StringUtils.h"
     
    4646namespace orxonox
    4747{
     48    SetConsoleCommand("echo", echo);
     49
     50    SetConsoleCommand("orxout", orxout_level);
     51    SetConsoleCommand("orxout_context", orxout_level_context);
     52
     53    SetConsoleCommand("log"    , log    );
     54    SetConsoleCommand("error"  , error  ).hide();
     55    SetConsoleCommand("warning", warning).hide();
     56    SetConsoleCommand("status" , status ).hide();
     57    SetConsoleCommand("info"   , info   ).hide();
     58    SetConsoleCommand("debug"  , debug  ).hide();
     59
    4860//    SetConsoleCommand("source", source).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
    49     SetConsoleCommand("echo", echo);
    50 //    SetConsoleCommand("puts", puts);                                                    // disabled because we use the implementation in Tcl
    51 
    5261//    SetConsoleCommand("read", read).argumentCompleter(0, autocompletion::files());      // disabled because we use the implementation in Tcl
    5362//    SetConsoleCommand("append", append).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
     
    5766
    5867    /**
     68        @brief Simply returns the arguments.
     69    */
     70    std::string echo(const std::string& text)
     71    {
     72        return text;
     73    }
     74
     75    /**
     76        @brief Builds a map that maps the levels of all output levels to their ID.
     77    */
     78    std::map<std::string, OutputLevel> getOutputLevelsMap()
     79    {
     80        std::map<std::string, OutputLevel> levels;
     81
     82        levels["message"]          = level::message;
     83        levels["debug_output"]     = level::debug_output;
     84        levels["user_error"]       = level::user_error;
     85        levels["user_warning"]     = level::user_warning;
     86        levels["user_status"]      = level::user_status;
     87        levels["user_info"]        = level::user_info;
     88        levels["internal_error"]   = level::internal_error;
     89        levels["internal_warning"] = level::internal_warning;
     90        levels["internal_status"]  = level::internal_status;
     91        levels["internal_info"]    = level::internal_info;
     92        levels["verbose"]          = level::verbose;
     93        levels["verbose_more"]     = level::verbose_more;
     94        levels["verbose_ultra"]    = level::verbose_ultra;
     95
     96        return levels;
     97    }
     98
     99    /**
     100        @brief Prints text to the console.
     101        @param level_name The name of the output level
     102    */
     103    void orxout_level(const std::string& level_name, const std::string& text)
     104    {
     105        static std::map<std::string, OutputLevel> levels = getOutputLevelsMap();
     106
     107        OutputLevel level = level::debug_output;
     108        std::map<std::string, OutputLevel>::iterator it = levels.find(level_name);
     109        if (it != levels.end())
     110            level = it->second;
     111        else
     112            orxout(internal_warning) << "'" << level_name << "' is not a valid output level" << endl;
     113
     114        orxout(level) << text << endl;
     115    }
     116
     117    /**
     118        @brief Prints text to the console.
     119        @param level_name The name of the output level
     120        @param context_name The name of the output context
     121    */
     122    void orxout_level_context(const std::string& level_name, const std::string& context_name, const std::string& text)
     123    {
     124        static std::map<std::string, OutputLevel> levels = getOutputLevelsMap();
     125
     126        OutputLevel level = level::debug_output;
     127        std::map<std::string, OutputLevel>::iterator it = levels.find(level_name);
     128        if (it != levels.end())
     129            level = it->second;
     130        else
     131            orxout(internal_warning) << "'" << level_name << "' is not a valid output level" << endl;
     132
     133        OutputContextContainer context = registerContext(context_name);
     134
     135        orxout(level, context) << text << endl;
     136    }
     137
     138    /// @brief Prints text to the console and the logfile.
     139    void log(const std::string& text)
     140    { orxout() << text << endl; }
     141
     142    /// @brief Prints output with error level.
     143    void error(const std::string& text)
     144    { orxout(user_error) << text << endl; }
     145
     146    /// @brief Prints output with warning level.
     147    void warning(const std::string& text)
     148    { orxout(user_warning) << text << endl; }
     149
     150    /// @brief Prints output with status level.
     151    void status(const std::string& text)
     152    { orxout(user_status) << text << endl; }
     153
     154    /// @brief Prints output with info level.
     155    void info(const std::string& text)
     156    { orxout(user_info) << text << endl; }
     157
     158    /// @brief Prints debug output with verbose level.
     159    void debug(const std::string& text)
     160    { orxout(verbose, context::tcl) << text << endl; }
     161
     162    /**
    59163        @brief Reads the content of a file and executes the commands in it line by line.
    60164    */
     
    66170        if (it != executingFiles.end())
    67171        {
    68             COUT(1) << "Error: Recurring source command in \"" << filename << "\". Stopped execution." << std::endl;
     172            orxout(user_error) << "Recurring source command in \"" << filename << "\". Stopped execution." << endl;
    69173            return;
    70174        }
     
    76180        if (!file.is_open())
    77181        {
    78             COUT(1) << "Error: Couldn't open file \"" << filename << "\"." << std::endl;
     182            orxout(user_error) << "Couldn't open file \"" << filename << "\"." << endl;
    79183            return;
    80184        }
     
    95199
    96200    /**
    97         @brief Simply returns the arguments.
    98     */
    99     std::string echo(const std::string& text)
    100     {
    101         return text;
    102     }
    103 
    104     /**
    105         @brief Writes text to the console, depending on the first argument with or without a line-break after it.
    106     */
    107     void puts(bool newline, const std::string& text)
    108     {
    109         if (newline)
    110         {
    111             COUT(0) << stripEnclosingBraces(text) << std::endl;
    112         }
    113         else
    114         {
    115             COUT(0) << stripEnclosingBraces(text);
    116         }
    117     }
    118 
    119     /**
    120201        @brief Writes text to a file.
    121202    */
     
    127208        if (!file.is_open())
    128209        {
    129             COUT(1) << "Error: Couldn't write to file \"" << filename << "\"." << std::endl;
    130             return;
    131         }
    132 
    133         file << text << std::endl;
     210            orxout(user_error) << "Couldn't write to file \"" << filename << "\"." << endl;
     211            return;
     212        }
     213
     214        file << text << endl;
    134215        file.close();
    135216    }
     
    145226        if (!file.is_open())
    146227        {
    147             COUT(1) << "Error: Couldn't append to file \"" << filename << "\"." << std::endl;
    148             return;
    149         }
    150 
    151         file << text << std::endl;
     228            orxout(user_error) << "Couldn't append to file \"" << filename << "\"." << endl;
     229            return;
     230        }
     231
     232        file << text << endl;
    152233        file.close();
    153234    }
     
    163244        if (!file.is_open())
    164245        {
    165             COUT(1) << "Error: Couldn't read from file \"" << filename << "\"." << std::endl;
     246            orxout(user_error) << "Couldn't read from file \"" << filename << "\"." << endl;
    166247            return "";
    167248        }
     
    192273            if (expr.getResult() == 42.0)
    193274            {
    194                 COUT(3) << "Greetings from the restaurant at the end of the universe." << std::endl;
     275                orxout(user_info) << "Greetings from the restaurant at the end of the universe." << endl;
    195276            }
    196277            if (!expr.getRemains().empty())
    197278            {
    198                 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
     279                orxout(user_warning) << "Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << endl;
    199280            }
    200281            return static_cast<float>(expr.getResult());
     
    202283        else
    203284        {
    204             COUT(1) << "Error: Cannot calculate expression: Parse error." << std::endl;
     285            orxout(user_error) << "Cannot calculate expression: Parse error." << endl;
    205286            return 0;
    206287        }
  • code/trunk/src/libraries/core/command/ConsoleCommandCompilation.h

    r7401 r8858  
    4242    _CoreExport void source(const std::string& filename);
    4343    _CoreExport std::string echo(const std::string& text);
    44     _CoreExport void puts(bool newline, const std::string& test);
     44
     45    _CoreExport void orxout_level(const std::string& level_name, const std::string& text);
     46    _CoreExport void orxout_level_context(const std::string& level_name, const std::string& context_name, const std::string& text);
     47
     48    _CoreExport void log(const std::string& text);
     49    _CoreExport void error(const std::string& text);
     50    _CoreExport void warning(const std::string& text);
     51    _CoreExport void status(const std::string& text);
     52    _CoreExport void info(const std::string& text);
     53    _CoreExport void debug(const std::string& text);
    4554
    4655    _CoreExport void write(const std::string& filename, const std::string& text);
  • code/trunk/src/libraries/core/command/Executor.cc

    r7401 r8858  
    3838
    3939#include "util/Convert.h"
    40 #include "util/Debug.h"
     40#include "util/Output.h"
    4141#include "util/StringUtils.h"
    4242#include "util/SubString.h"
     
    104104        {
    105105            if (bPrintError)
    106                 COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << std::endl;
     106                orxout(internal_warning) << "Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << endl;
    107107            return MT_Type::Null;
    108108        }
    109109
    110         COUT(5) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << std::endl;
     110        orxout(verbose, context::misc::executor) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << endl;
    111111
    112112        // execute the function with the evaluated arguments (the default values of the executor are also included in these arguments)
  • code/trunk/src/libraries/core/command/Executor.h

    r7401 r8858  
    5757    void myFunction(int a, int b)                           // declare a static function
    5858    {
    59         COUT(0) << "The sum is " << (a + b) << std::endl;   // print the sum of a and b to the console
     59        orxout() << "The sum is " << (a + b) << endl;       // print the sum of a and b to the console
    6060    }
    6161
  • code/trunk/src/libraries/core/command/Functor.h

    r8729 r8858  
    118118#include <typeinfo>
    119119
    120 #include "util/Debug.h"
     120#include "util/Output.h"
    121121#include "util/MultiType.h"
    122122#include "core/OrxonoxClass.h"
     
    256256                else
    257257                {
    258                     COUT(1) << "Error: Can't execute FunctorMember, no object set." << std::endl;
     258                    orxout(internal_error) << "Can't execute FunctorMember, no object set." << endl;
    259259                    return MT_Type::Null;
    260260                }
     
    339339            // see Functor::setRawObjectPointer()
    340340            inline void setRawObjectPointer(void*)
    341                 { COUT(2) << "Warning: Can't assign an object pointer to a static functor" << std::endl; }
     341                { orxout(internal_warning) << "Can't assign an object pointer to a static functor" << endl; }
    342342            // see Functor::getRawObjectPointer()
    343343            inline void* getRawObjectPointer() const
  • code/trunk/src/libraries/core/command/IOConsolePOSIX.cc

    r8729 r8858  
    3737#include "util/Clock.h"
    3838#include "util/Math.h"
     39#include "util/output/ConsoleWriter.h"
    3940#include "core/Game.h"
    4041#include "core/input/InputBuffer.h"
     
    5556
    5657    IOConsole::IOConsole()
    57         : shell_(new Shell("IOConsole", false))
     58        : shell_(new Shell("Console", false))
    5859        , buffer_(shell_->getInputBuffer())
    5960        , cout_(std::cout.rdbuf())
     
    7475
    7576        // Disable standard std::cout logging
    76         OutputHandler::getInstance().disableCout();
     77        ConsoleWriter::getInstance().disable();
    7778        // Redirect std::cout to an ostringstream
    7879        // (Other part is in the initialiser list)
     
    8889        std::cout.flush();
    8990        if (!this->origCout_.str().empty())
    90             this->shell_->addOutput(this->origCout_.str(), Shell::None);
     91            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
    9192        // Erase input and status lines
    9293        this->cout_ << "\033[1G\033[J";
     
    102103        std::cout.rdbuf(this->cout_.rdbuf());
    103104        // Enable standard std::cout logging again
    104         OutputHandler::getInstance().enableCout();
     105        ConsoleWriter::getInstance().enable();
    105106    }
    106107
     
    229230        if (!this->origCout_.str().empty())
    230231        {
    231             this->shell_->addOutput(this->origCout_.str(), Shell::None);
     232            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
    232233            this->origCout_.str("");
    233234        }
     
    239240        switch (type)
    240241        {
    241         case Shell::Error:   this->cout_ << "\033[91m"; break;
    242         case Shell::Warning: this->cout_ << "\033[93m"; break;
    243         case Shell::Info:    this->cout_ << "\033[90m"; break;
    244         case Shell::Debug:   this->cout_ << "\033[90m"; break;
    245         case Shell::Verbose: this->cout_ << "\033[90m"; break;
    246         case Shell::Ultra:   this->cout_ << "\033[90m"; break;
    247         case Shell::Command: this->cout_ << "\033[36m"; break;
    248         case Shell::Hint:    this->cout_ << "\033[33m"; break;
    249         case Shell::TDebug:  this->cout_ << "\033[95m"; break;
    250         default: break;
     242            case Shell::Message:
     243            case Shell::DebugOutput:     this->cout_ << "\033[0m"; break;
     244
     245            case Shell::UserError:       this->cout_ << "\033[91m"; break;
     246            case Shell::UserWarning:     this->cout_ << "\033[93m"; break;
     247            case Shell::UserStatus:      this->cout_ << "\033[92m"; break;
     248            case Shell::UserInfo:        this->cout_ << "\033[96m"; break;
     249
     250            case Shell::InternalError:   this->cout_ << "\033[31m"; break;
     251            case Shell::InternalWarning: this->cout_ << "\033[33m"; break;
     252            case Shell::InternalStatus:  this->cout_ << "\033[32m"; break;
     253            case Shell::InternalInfo:    this->cout_ << "\033[36m"; break;
     254
     255            case Shell::Verbose:         this->cout_ << "\033[94m"; break;
     256            case Shell::VerboseMore:     this->cout_ << "\033[34m"; break;
     257            case Shell::VerboseUltra:    this->cout_ << "\033[34m"; break;
     258
     259            case Shell::Command:         this->cout_ << "\033[95m"; break;
     260            case Shell::Hint:            this->cout_ << "\033[35m"; break;
     261
     262            default:                     this->cout_ << "\033[37m"; break;
    251263        }
    252264
     
    371383    void IOConsole::executed()
    372384    {
    373         this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
     385        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
    374386    }
    375387
     
    378390    {
    379391        // Exit is not an option, just do nothing (Shell doesn't really exit too)
    380     }
    381 
    382     //! Called if only the last output-line has changed
    383     void IOConsole::onlyLastLineChanged()
    384     {
    385         // Save cursor position and move it to the beginning of the first output line
    386         this->cout_ << "\033[s\033[1A\033[1G";
    387         // Erase the line
    388         this->cout_ << "\033[K";
    389         // Reprint the last output line
    390         this->printOutputLine(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second);
    391         // Restore cursor
    392         this->cout_ << "\033[u";
    393         this->cout_.flush();
    394392    }
    395393
  • code/trunk/src/libraries/core/command/IOConsolePOSIX.h

    r7401 r8858  
    6666        // Methods from ShellListener
    6767        void linesChanged();
    68         void onlyLastLineChanged();
    6968        void lineAdded();
    7069        void inputChanged();
  • code/trunk/src/libraries/core/command/IOConsoleWindows.cc

    r8729 r8858  
    3434#include "util/Clock.h"
    3535#include "util/Math.h"
     36#include "util/output/ConsoleWriter.h"
    3637#include "core/Game.h"
    3738#include "core/input/InputBuffer.h"
     
    4344    //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode
    4445    IOConsole::IOConsole()
    45         : shell_(new Shell("IOConsole", false))
     46        : shell_(new Shell("Console", false))
    4647        , buffer_(shell_->getInputBuffer())
    4748        , cout_(std::cout.rdbuf())
     
    5253    {
    5354        // Disable standard this->cout_ logging
    54         OutputHandler::getInstance().disableCout();
     55        ConsoleWriter::getInstance().disable();
    5556        // Redirect std::cout to an ostringstream
    5657        // (Other part is in the initialiser list)
     
    9596        std::cout.flush();
    9697        if (!this->origCout_.str().empty())
    97             this->shell_->addOutput(this->origCout_.str(), Shell::None);
     98            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
    9899
    99100        this->shell_->unregisterListener(this);
     
    108109        std::cout.rdbuf(this->cout_.rdbuf());
    109110        // Enable standard this->cout_ logging again
    110         OutputHandler::getInstance().enableCout();
     111        ConsoleWriter::getInstance().enable();
    111112
    112113        resetTerminalMode();
     
    188189        if (!this->origCout_.str().empty())
    189190        {
    190             this->shell_->addOutput(this->origCout_.str(), Shell::None);
     191            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
    191192            this->origCout_.str("");
    192193        }
     
    200201        switch (type)
    201202        {
    202         case Shell::Error:   colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED; break;
    203         case Shell::Warning: colour = FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED; break;
    204         case Shell::Info:
    205         case Shell::Debug:
    206         case Shell::Verbose:
    207         case Shell::Ultra:   colour = FOREGROUND_INTENSITY                                     ; break;
    208         case Shell::Command: colour =                        FOREGROUND_GREEN                  | FOREGROUND_BLUE; break;
    209         case Shell::Hint:    colour =                        FOREGROUND_GREEN | FOREGROUND_RED                  ; break;
    210         case Shell::TDebug:  colour = FOREGROUND_INTENSITY                    | FOREGROUND_RED | FOREGROUND_BLUE; break;
    211         default:             colour =                        FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break;
     203            case Shell::Message:
     204            case Shell::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     205
     206            case Shell::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
     207            case Shell::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
     208            case Shell::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
     209            case Shell::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     210
     211            case Shell::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
     212            case Shell::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
     213            case Shell::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
     214            case Shell::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     215
     216            case Shell::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     217            case Shell::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     218            case Shell::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     219
     220            case Shell::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
     221            case Shell::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
     222
     223            default:                     colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
    212224        }
    213225
     
    238250            || !SetConsoleMode(this->stdInHandle_, 0))
    239251        {
    240             COUT(1) << "Error: Could not set Windows console settings" << std::endl;
     252            orxout(user_error) << "Could not set Windows console settings" << endl;
    241253            return;
    242254        }
     
    318330    void IOConsole::executed()
    319331    {
    320         this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
     332        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
    321333    }
    322334
     
    377389    }
    378390
    379     //! Called if only the last output-line has changed
    380     void IOConsole::onlyLastLineChanged()
    381     {
    382         int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;
    383         // Compute the number of new lines needed
    384         int newLines = newLineHeight - this->lastOutputLineHeight_;
    385         this->lastOutputLineHeight_ = newLineHeight;
    386         // Scroll console if necessary
    387         if (newLines > 0) // newLines < 0 is assumed impossible
    388             this->createNewOutputLines(newLines);
    389         Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
    390         this->printOutputLine(it->first, it->second, makeCOORD(0, this->inputLineRow_ - newLineHeight));
    391     }
    392 
    393391    //! Called if a new output line was added
    394392    void IOConsole::lineAdded()
  • code/trunk/src/libraries/core/command/IOConsoleWindows.h

    r8729 r8858  
    6868        // Methods from ShellListener
    6969        void linesChanged();
    70         void onlyLastLineChanged();
    7170        void lineAdded();
    7271        void inputChanged();
  • code/trunk/src/libraries/core/command/IRC.cc

    r7401 r8858  
    8585        }
    8686        catch (Tcl::tcl_error const &e)
    87         {   COUT(1) << "Tcl (IRC) error: " << e.what();   }
     87        {   orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl;   }
    8888
    8989        this->nickname_ = "orx" + multi_cast<std::string>(static_cast<unsigned int>(rand()));
     
    100100        {
    101101            IRC::getInstance().initialize();
    102             COUT(1) << "Error: IRC client wasn't yet initialized, please try again." << std::endl;
     102            orxout(user_error) << "IRC client wasn't yet initialized, please try again." << endl;
    103103            return false;
    104104        }
     
    110110        }
    111111        catch (Tcl::tcl_error const &e)
    112         {   COUT(1) << "Tcl (IRC) error: " << e.what();   }
     112        {   orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl;   }
    113113
    114114        return false;
     
    139139    void IRC::tcl_say(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
    140140    {
    141         COUT(0) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
     141        orxout(message) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
    142142    }
    143143
     
    145145    void IRC::tcl_privmsg(Tcl::object const &query, Tcl::object const &nick, Tcl::object const &args)
    146146    {
    147         COUT(0) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
     147        orxout(message) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
    148148    }
    149149
     
    151151    void IRC::tcl_action(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
    152152    {
    153         COUT(0) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << std::endl;
     153        orxout(message) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << endl;
    154154    }
    155155
     
    157157    void IRC::tcl_info(Tcl::object const &channel, Tcl::object const &args)
    158158    {
    159         COUT(0) << "IRC> --> " << stripEnclosingBraces(args.get()) << std::endl;
     159        orxout(message) << "IRC> --> " << stripEnclosingBraces(args.get()) << endl;
    160160    }
    161161}
  • code/trunk/src/libraries/core/command/Shell.cc

    r8729 r8858  
    3535
    3636#include "util/Math.h"
    37 #include "util/OutputHandler.h"
    3837#include "util/StringUtils.h"
    3938#include "util/SubString.h"
     39#include "util/output/OutputManager.h"
     40#include "util/output/MemoryWriter.h"
    4041#include "core/CoreIncludes.h"
    4142#include "core/ConfigFileManager.h"
     
    4445#include "core/input/InputBuffer.h"
    4546#include "CommandExecutor.h"
    46 #include "ConsoleCommand.h"
    4747
    4848namespace orxonox
    4949{
    50     SetConsoleCommand("log",     OutputHandler::log    );
    51     SetConsoleCommand("error",   OutputHandler::error  ).hide();
    52     SetConsoleCommand("warning", OutputHandler::warning).hide();
    53     SetConsoleCommand("info",    OutputHandler::info   ).hide();
    54     SetConsoleCommand("debug",   OutputHandler::debug  ).hide();
    55 
    5650    unsigned int Shell::cacheSize_s;
    5751
    58     /**
    59         @brief Constructor: Initializes the values and registers itself at OutputHandler.
     52    namespace DefaultLogLevel
     53    {
     54        const OutputLevel Dev  = level::internal_warning;
     55        const OutputLevel User = level::user_info;
     56    }
     57
     58    /**
     59        @brief Constructor: Initializes the values.
    6060        @param consoleName The name of the shell - used to define the name of the soft-debug-level config-value
    6161        @param bScrollable If true, the user is allowed to scroll through the output-lines
    6262    */
    6363    Shell::Shell(const std::string& consoleName, bool bScrollable)
    64         : OutputListener(consoleName)
     64        : BaseWriter(consoleName, false)
    6565        , inputBuffer_(new InputBuffer())
    66         , consoleName_(consoleName)
    6766        , bScrollable_(bScrollable)
    6867    {
    6968        RegisterRootObject(Shell);
     69
     70        OutputManager::getInstance().registerListener(this);
    7071
    7172        this->scrollPosition_ = 0;
     
    7374        this->historyPosition_ = 0;
    7475        this->historyOffset_ = 0;
    75         this->bFinishedLastLine_ = true;
    7676
    7777        this->clearOutput();
     
    8181        ConfigFileManager::getInstance().setFilename(ConfigFileType::CommandHistory, "commandHistory.ini");
    8282
    83         // Use a stringstream object to buffer the output
    84         this->outputStream_ = &this->outputBuffer_;
     83        // Choose the default level according to the path Orxonox was started (build directory or not)
     84        OutputLevel defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User);
     85        this->setLevelMax(defaultDebugLevel);
    8586
    8687        this->setConfigValues();
    8788
    8889        // Get the previous output and add it to the Shell
    89         OutputHandler::OutputVector::const_iterator it = OutputHandler::getInstance().getOutput().begin();
    90         for (;it != OutputHandler::getInstance().getOutput().end(); ++it)
    91         {
    92             if (it->first <= debugLevel_)
    93             {
    94                 this->outputBuffer_ << it->second;
    95                 this->outputChanged(it->first);
    96             }
    97         }
    98 
    99         // Register the shell as output listener
    100         OutputHandler::getInstance().registerOutputListener(this);
    101         OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_);
    102     }
    103 
    104     /**
    105         @brief Destructor: Unregisters the shell from OutputHandler.
     90        MemoryWriter::getInstance().resendOutput(this);
     91    }
     92
     93    /**
     94        @brief Destructor
    10695    */
    10796    Shell::~Shell()
    10897    {
    109         OutputHandler::getInstance().unregisterOutputListener(this);
    11098        this->inputBuffer_->destroy();
    111     }
    112 
    113     namespace DefaultLogLevel
    114     {
    115         const OutputLevel::Value Dev  = OutputLevel::Info;
    116         const OutputLevel::Value User = OutputLevel::Error;
     99
     100        OutputManager::getInstance().unregisterListener(this);
    117101    }
    118102
     
    129113        SetConfigValue(cacheSize_s, 32);
    130114
    131         // Choose the default level according to the path Orxonox was started (build directory or not)
    132         OutputLevel::Value defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User);
    133         SetConfigValueExternal(debugLevel_, "OutputHandler", "debugLevel" + consoleName_, defaultDebugLevel)
    134             .description("The maximum level of debug output shown in the " + consoleName_);
    135         OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_);
     115        SetConfigValueExternal(this->configurableMaxLevel_,
     116                               this->getConfigurableSectionName(),
     117                               this->getConfigurableMaxLevelName(),
     118                               this->configurableMaxLevel_)
     119            .description("The maximum level of output shown in the " + this->getName())
     120            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevel);
     121        SetConfigValueExternal(this->configurableAdditionalContextsMaxLevel_,
     122                               this->getConfigurableSectionName(),
     123                               this->getConfigurableAdditionalContextsMaxLevelName(),
     124                               this->configurableAdditionalContextsMaxLevel_)
     125            .description("The maximum level of output shown in the " + this->getName() + " for additional contexts")
     126            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContextsLevel);
     127        SetConfigValueExternal(this->configurableAdditionalContexts_,
     128                               this->getConfigurableSectionName(),
     129                               this->getConfigurableAdditionalContextsName(),
     130                               this->configurableAdditionalContexts_)
     131            .description("Additional output contexts shown in the " + this->getName())
     132            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContexts);
    136133    }
    137134
     
    168165        if (isNormal)
    169166        {
    170             ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, update);
     167            ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), update);
    171168        }
    172169        else
    173170        {
    174             OutputLevel::Value level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User);
    175             ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, tset, level);
     171            OutputLevel level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User);
     172            ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), tset, level);
    176173        }
    177174    }
     
    252249
    253250    /**
    254         @brief Sends output to the internal output buffer.
     251        @brief Adds multiple lines to the internal output buffer.
    255252    */
    256253    void Shell::addOutput(const std::string& text, LineType type)
    257254    {
    258         this->outputBuffer_ << text;
    259         this->outputChanged(type);
     255        std::vector<std::string> lines;
     256        vectorize(text, '\n', &lines);
     257
     258        for (size_t i = 0; i < lines.size(); ++i)
     259            this->addLine(lines[i], type);
     260    }
     261
     262    /**
     263        @brief Adds a line to the internal output buffer.
     264    */
     265    void Shell::addLine(const std::string& line, LineType type)
     266    {
     267        // yes it was - push the new line to the list
     268        this->outputLines_.push_front(std::make_pair(line, static_cast<LineType>(type)));
     269
     270        // adjust the scroll position if needed
     271        if (this->scrollPosition_)
     272            this->scrollPosition_++;
     273        else
     274            this->scrollIterator_ = this->outputLines_.begin();
     275
     276        if (!this->scrollPosition_)
     277            this->updateListeners<&ShellListener::lineAdded>();
    260278    }
    261279
     
    269287
    270288        this->scrollPosition_ = 0;
    271         this->bFinishedLastLine_ = true;
    272289
    273290        this->updateListeners<&ShellListener::linesChanged>();
     291    }
     292
     293    /**
     294        @brief Inherited from BaseWriter (LogListener), called if a new line of output was sent.
     295    */
     296    void Shell::printLine(const std::string& line, OutputLevel level)
     297    {
     298        this->addLine(line, static_cast<LineType>(level));
    274299    }
    275300
     
    323348
    324349    /**
    325         @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.
    326     */
    327     void Shell::outputChanged(int lineType)
    328     {
    329         bool newline = false;
    330         do
    331         {
    332             // get the first line from the buffer
    333             std::string output;
    334             std::getline(this->outputBuffer_, output);
    335 
    336             // check the state of the buffer
    337             bool eof = this->outputBuffer_.eof();
    338             bool fail = this->outputBuffer_.fail();
    339             if (eof)
    340                 this->outputBuffer_.flush(); // check if more output was received in the meantime
    341             if (eof || fail)
    342                 this->outputBuffer_.clear(); // clear the error flags
    343 
    344             // the line is terminated with a line-break if neither an error occurred nor the end of the file was reached
    345             newline = (!eof && !fail);
    346 
    347             // no output retrieved - break the loop
    348             if (!newline && output.empty())
    349                 break;
    350 
    351             // check if the last line was terminated with a line-break
    352             if (this->bFinishedLastLine_)
    353             {
    354                 // yes it was - push the new line to the list
    355                 this->outputLines_.push_front(std::make_pair(output, static_cast<LineType>(lineType)));
    356 
    357                 // adjust the scroll position if needed
    358                 if (this->scrollPosition_)
    359                     this->scrollPosition_++;
    360                 else
    361                     this->scrollIterator_ = this->outputLines_.begin();
    362 
    363                 if (!this->scrollPosition_)
    364                     this->updateListeners<&ShellListener::lineAdded>();
    365             }
    366             else
    367             {
    368                 // no it wasn't - add the new output to the last line
    369                 this->outputLines_.front().first += output;
    370                 this->updateListeners<&ShellListener::onlyLastLineChanged>();
    371             }
    372 
    373             // remember if the last line was terminated with a line-break
    374             this->bFinishedLastLine_ = newline;
    375 
    376         } while (newline); // loop as long as more lines are in the buffer
    377     }
    378 
    379     /**
    380350        @brief Clears the text in the input buffer.
    381351    */
     
    409379        const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &error);
    410380        if (error)
    411         {
    412             switch (error)
    413             {
    414                 case CommandExecutor::Error:       this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command doesn't exist. (S)" << std::endl; break;
    415                 case CommandExecutor::Incomplete:  this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", not enough arguments given. (S)" << std::endl; break;
    416                 case CommandExecutor::Deactivated: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command is not active. (S)" << std::endl; break;
    417                 case CommandExecutor::Denied:      this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", access denied. (S)" << std::endl; break;
    418             }
    419             this->outputChanged(Error);
    420         }
     381            this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", UserError);
    421382        else if (result != "")
    422         {
    423             this->outputBuffer_ << result << std::endl;
    424             this->outputChanged(Command);
    425         }
     383            this->addOutput(result, Result);
    426384
    427385        this->clearInput();
     
    432390    {
    433391        this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete());
    434         this->outputBuffer_ << CommandExecutor::evaluate(this->inputBuffer_->get()).hint() << std::endl;
    435         this->outputChanged(Hint);
     392        this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), Hint);
    436393
    437394        this->inputChanged();
  • code/trunk/src/libraries/core/command/Shell.h

    r8729 r8858  
    4848#include <vector>
    4949
    50 #include "util/OutputHandler.h"
     50#include "util/output/BaseWriter.h"
    5151#include "core/Core.h"
    5252#include "core/OrxonoxClass.h"
     
    6666        private:
    6767            virtual void linesChanged() {}          ///< Called if all output-lines have changed
    68             virtual void onlyLastLineChanged() {}   ///< Called if only the last output-line has changed
    6968            virtual void lineAdded() {}             ///< Called if a new line was added to the output
    7069            virtual void inputChanged() {}          ///< Called if the input has changed
     
    7877        @brief The Shell is the logical component of the console that displays output to the user and allows him to enter commands.
    7978
    80         The Shell gathers output sent from OutputHandler by inheriting from OutputListener.
     79        The Shell gathers output sent from OutputManager by inheriting from BaseWriter.
    8180        The output-lines are stored in the shell, so they can be displayed in a graphical
    8281        console. Additionally the Shell has an InputBuffer which is needed by the user to
     
    8584        Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole.
    8685    */
    87     class _CoreExport Shell : public OutputListener, public DevModeListener
     86    class _CoreExport Shell : public BaseWriter, public DevModeListener
    8887    {
    8988        public:
     
    9190            enum LineType
    9291            {
    93                 TDebug  = OutputLevel::TDebug,
    94                 None    = OutputLevel::None,
    95                 Warning = OutputLevel::Warning,
    96                 Error   = OutputLevel::Error,
    97                 Info    = OutputLevel::Info,
    98                 Debug   = OutputLevel::Debug,
    99                 Verbose = OutputLevel::Verbose,
    100                 Ultra   = OutputLevel::Ultra,
     92                DebugOutput     = debug_output,
     93                Message         = message,
     94                UserError       = user_error,
     95                UserWarning     = user_warning,
     96                UserStatus      = user_status,
     97                UserInfo        = user_info,
     98                InternalError   = internal_error,
     99                InternalWarning = internal_warning,
     100                InternalStatus  = internal_status,
     101                InternalInfo    = internal_info,
     102                Verbose         = verbose,
     103                VerboseMore     = verbose_more,
     104                VerboseUltra    = verbose_ultra,
     105                Cout,
    101106                Input,
    102107                Command,
     108                Result,
    103109                Hint
    104110            };
     
    127133            LineList::const_iterator getEndIterator() const;
    128134
    129             void addOutput(const std::string& text, LineType type = None);
     135            void addOutput(const std::string& text, LineType type = DebugOutput);
     136            void addLine(const std::string& line, LineType type = DebugOutput);
    130137            void clearOutput();
    131138
     
    150157            const std::string& getFromHistory() const;
    151158            void clearInput();
    152             // OutputListener
    153             void outputChanged(int level);
     159            // BaseWriter
     160            virtual void printLine(const std::string& line, OutputLevel level);
    154161
    155162            void configureInputBuffer();
     
    183190            std::list<ShellListener*> listeners_;           ///< The registered shell listeners
    184191            InputBuffer*              inputBuffer_;         ///< The input buffer that is needed by the user to enter text
    185             std::stringstream         outputBuffer_;        ///< The output buffer that is used to retrieve lines of output from OutputListener
    186             bool                      bFinishedLastLine_;   ///< Stores if the most recent output-line was terminated with a line-break or if more output is expected for this line
    187192            LineList                  outputLines_;         ///< A list of all output-lines that were displayed in the shell so far
    188193            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
    189194            unsigned int              scrollPosition_;      ///< The number of the line that is currently being referenced by scrollIterator_
    190195            unsigned int              historyPosition_;     ///< If the user scrolls through the history of entered commands (stored in commandHistory_), this contains the currently viewed history entry
    191 
    192             const std::string         consoleName_;         ///< The name of this shell - used to define the name of the soft-debug-level config-value
    193196            const bool                bScrollable_;         ///< If true, the user can scroll through the output-lines
    194197
     
    197200            unsigned int              historyOffset_;       ///< The command history is a circular buffer, this variable defines the current write-offset
    198201            std::vector<std::string>  commandHistory_;      ///< The history of commands that were entered by the user
    199             int                       debugLevel_;          //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)
    200202            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
    201203    };
  • code/trunk/src/libraries/core/command/TclBind.cc

    r8366 r8858  
    3434
    3535#include "SpecialConfig.h"
    36 #include "util/Debug.h"
     36#include "util/Output.h"
    3737#include "util/Exception.h"
    3838#include "util/StringUtils.h"
     
    106106            }
    107107            catch (Tcl::tcl_error const &e)
    108             {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl;   }
     108            {   orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;   }
    109109        }
    110110    }
     
    129129        }
    130130        catch (Tcl::tcl_error const &e)
    131         {   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;   }
     131        {
     132            orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;
     133            orxout(user_error, context::tcl) << "Tcl isn't properly initialized. Orxonox might possibly not work like that." << endl;
     134        }
    132135
    133136        return interpreter;
     
    154157    std::string TclBind::tcl_query(Tcl::object const &args)
    155158    {
    156         COUT(4) << "Tcl_query: " << args.get() << std::endl;
     159        orxout(verbose, context::commands) << "Tcl_query: " << args.get() << endl;
    157160        return TclBind::tcl_helper(args, true);
    158161    }
     
    163166    void TclBind::tcl_execute(Tcl::object const &args)
    164167    {
    165         COUT(4) << "Tcl_execute: " << args.get() << std::endl;
     168        orxout(verbose, context::commands) << "Tcl_execute: " << args.get() << endl;
    166169        TclBind::tcl_helper(args, false);
    167170    }
     
    184187            error = evaluation.execute();
    185188
    186         switch (error)
    187         {
    188             case CommandExecutor::Error:       COUT(1) << "Error: Can't execute command \"" << command << "\", command doesn't exist. (B)" << std::endl; break;
    189             case CommandExecutor::Incomplete:  COUT(1) << "Error: Can't execute command \"" << command << "\", not enough arguments given. (B)" << std::endl; break;
    190             case CommandExecutor::Deactivated: COUT(1) << "Error: Can't execute command \"" << command << "\", command is not active. (B)" << std::endl; break;
    191             case CommandExecutor::Denied:      COUT(1) << "Error: Can't execute command \"" << command << "\", access denied. (B)" << std::endl; break;
    192         }
    193 
    194         if (error == CommandExecutor::Error)
    195             COUT(3) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << std::endl;
     189        if (error)
     190        {
     191            orxout(user_error) << "Can't execute command \"" << command << "\", " + CommandExecutor::getErrorDescription(error) + ". (TclBind)" << endl;
     192            if (error == CommandExecutor::Inexistent)
     193                orxout(user_info) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << endl;
     194        }
    196195
    197196        return result;
     
    211210            }
    212211            catch (Tcl::tcl_error const &e)
    213             {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
     212            {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
    214213        }
    215214
     
    223222    void TclBind::bgerror(const std::string& error)
    224223    {
    225         COUT(1) << "Tcl background error: " << stripEnclosingBraces(error) << std::endl;
     224        orxout(user_error, context::tcl) << "Tcl background error: " << stripEnclosingBraces(error) << endl;
    226225    }
    227226
     
    243242        }
    244243        catch (Tcl::tcl_error const &e)
    245         {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
     244        {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
    246245
    247246        if (error)
  • code/trunk/src/libraries/core/command/TclThreadManager.cc

    r8351 r8858  
    225225        TclThreadManager::getInstance().numInterpreterBundles_++;
    226226        TclThreadManager::createWithId(TclThreadManager::getInstance().numInterpreterBundles_);
    227         COUT(0) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << std::endl;
     227        orxout(user_info) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << endl;
    228228        return TclThreadManager::getInstance().numInterpreterBundles_;
    229229    }
     
    288288        }
    289289        catch (const Tcl::tcl_error& e)
    290         {   bundle->interpreter_ = 0; COUT(1) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << std::endl;   }
     290        {
     291            bundle->interpreter_ = 0;
     292            orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl;
     293        }
    291294    }
    292295
     
    407410            {
    408411                // This query would lead to a deadlock - return with an error
    409                 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
     412                TclThreadManager::error("Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
    410413                            + " -> " + multi_cast<std::string>(target_bundle->id_) \
    411414                            + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \
     
    446449                        int error;
    447450                        output = CommandExecutor::query(command, &error, false);
    448                         switch (error)
    449                         {
    450                             case CommandExecutor::Error:       TclThreadManager::error("Error: Can't execute command \"" + command + "\", command doesn't exist. (T)"); break;
    451                             case CommandExecutor::Incomplete:  TclThreadManager::error("Error: Can't execute command \"" + command + "\", not enough arguments given. (T)"); break;
    452                             case CommandExecutor::Deactivated: TclThreadManager::error("Error: Can't execute command \"" + command + "\", command is not active. (T)"); break;
    453                             case CommandExecutor::Denied:      TclThreadManager::error("Error: Can't execute command \"" + command + "\", access denied. (T)"); break;
    454                         }
     451                        if (error)
     452                            TclThreadManager::error("Can't execute command \"" + command + "\", " + CommandExecutor::getErrorDescription(error) + ". (TclThreadManager)");
    455453                    }
    456454                    else
     
    476474                    // This happens if the main thread tries to query a busy interpreter
    477475                    // To avoid a lock of the main thread, we simply don't proceed with the query in this case
    478                     TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
     476                    TclThreadManager::error("Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
    479477                }
    480478            }
     
    522520        else
    523521        {
    524             TclThreadManager::error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
     522            TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
    525523            return 0;
    526524        }
  • code/trunk/src/libraries/core/input/Button.cc

    r7891 r8858  
    3838#include "util/SubString.h"
    3939#include "util/StringUtils.h"
    40 #include "util/Debug.h"
     40#include "util/Output.h"
    4141#include "core/command/ConsoleCommand.h"
    4242#include "core/command/CommandEvaluation.h"
     
    255255        if (serious)
    256256        {
    257             COUT(2) << "Error while parsing binding for button/axis " << this->name_ << ". "
    258                 << message << std::endl;
     257            orxout(internal_error, context::input) << "Error while parsing binding for button/axis " << this->name_ << ". "
     258                << message << endl;
    259259        }
    260260        else
    261261        {
    262             COUT(3) << "Warning while parsing binding for button/axis " << this->name_ << ". "
    263                 << message << std::endl;
     262            orxout(internal_warning, context::input) << "Warning while parsing binding for button/axis " << this->name_ << ". "
     263                << message << endl;
    264264        }
    265265    }
  • code/trunk/src/libraries/core/input/InputDevice.h

    r8351 r8858  
    4343
    4444#include "util/Clock.h"
    45 #include "util/Debug.h"
     45#include "util/Output.h"
    4646#include "util/Exception.h"
    4747#include "InputState.h"
     
    135135            //       invalid right until the subclass has been constructed!
    136136            oisDevice_->setEventCallback(static_cast<DeviceClass*>(this));
    137             COUT(4) << "Instantiated a " << this->getClassName() << std::endl;
     137            orxout(verbose, context::input) << "Instantiated a " << this->getClassName() << endl;
    138138        }
    139139
     
    147147            catch (const OIS::Exception& ex)
    148148            {
    149                 COUT(1) << this->getClassName() << " destruction failed: " << ex.eText << std::endl
    150                         << "    Potential resource leak!" << std::endl;
     149                orxout(internal_error, context::input) << this->getClassName() << " destruction failed: " << ex.eText << '\n'
     150                                                       << "Potential resource leak!" << endl;
    151151            }
    152152        }
  • code/trunk/src/libraries/core/input/InputManager.cc

    r8729 r8858  
    100100        RegisterRootObject(InputManager);
    101101
    102         CCOUT(4) << "Constructing..." << std::endl;
     102        orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
    103103
    104104        // Allocate space for the function call buffer
     
    128128        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
    129129
    130         CCOUT(4) << "Construction complete." << std::endl;
     130        orxout(internal_status, context::input) << "InputManager: Construction complete." << endl;
    131131        internalState_ = Nothing;
    132132    }
     
    143143    void InputManager::loadDevices()
    144144    {
    145         CCOUT(4) << "Loading input devices..." << std::endl;
     145        orxout(verbose, context::input) << "InputManager: Loading input devices..." << endl;
    146146
    147147        // When loading the devices they should not already be loaded
     
    196196            // Exception-safety
    197197            Loki::ScopeGuard guard = Loki::MakeGuard(OIS::InputManager::destroyInputSystem, oisInputManager_);
    198             CCOUT(4) << "Created OIS input manager." << std::endl;
     198            orxout(verbose, context::input) << "Created OIS input manager." << endl;
    199199
    200200            if (oisInputManager_->getNumberOfDevices(OIS::OISKeyboard) > 0)
     
    219219        this->updateActiveStates();
    220220
    221         CCOUT(4) << "Input devices loaded." << std::endl;
     221        orxout(verbose, context::input) << "Input devices loaded." << endl;
    222222    }
    223223
     
    233233            catch (const std::exception& ex)
    234234            {
    235                 CCOUT(2) << "Warning: Failed to create Mouse:" << ex.what() << std::endl
    236                          << "Proceeding without mouse support." << std::endl;
    237             }
    238         }
    239         else
    240             CCOUT(2) << "Warning: No mouse found! Proceeding without mouse support." << std::endl;
     235                orxout(user_warning, context::input) << "Failed to create Mouse:" << ex.what() << '\n'
     236                                                     << "Proceeding without mouse support." << endl;
     237            }
     238        }
     239        else
     240            orxout(user_warning, context::input) << "No mouse found! Proceeding without mouse support." << endl;
    241241    }
    242242
     
    252252            catch (const std::exception& ex)
    253253            {
    254                 CCOUT(2) << "Warning: Failed to create joy stick: " << ex.what() << std::endl;
     254                orxout(user_warning, context::input) << "Failed to create joy stick: " << ex.what() << endl;
    255255            }
    256256        }
     
    270270    InputManager::~InputManager()
    271271    {
    272         CCOUT(3) << "Destroying..." << std::endl;
     272        orxout(internal_status, context::input) << "InputManager: Destroying..." << endl;
    273273
    274274        // Leave all active InputStates (except "empty")
     
    295295        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
    296296
    297         CCOUT(3) << "Destruction complete." << std::endl;
     297        orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl;
    298298    }
    299299
     
    306306    void InputManager::destroyDevices()
    307307    {
    308         CCOUT(4) << "Destroying devices..." << std::endl;
     308        orxout(verbose, context::input) << "InputManager: Destroying devices..." << endl;
    309309
    310310        BOOST_FOREACH(InputDevice*& device, devices_)
     
    315315            delete device;
    316316            device = 0;
    317             CCOUT(4) << className << " destroyed." << std::endl;
     317            orxout(verbose, context::input) << className << " destroyed." << endl;
    318318        }
    319319        devices_.resize(InputDeviceEnumerator::FirstJoyStick);
     
    326326        catch (const OIS::Exception& ex)
    327327        {
    328             COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl
    329                     << "    Potential resource leak!" << std::endl;
     328            orxout(internal_error, context::input) << "OIS::InputManager destruction failed" << ex.eText << '\n'
     329                                                   << "Potential resource leak!" << endl;
    330330        }
    331331        oisInputManager_ = NULL;
    332332
    333333        internalState_ |= Bad;
    334         CCOUT(4) << "Destroyed devices." << std::endl;
     334        orxout(verbose, context::input) << "Destroyed devices." << endl;
    335335    }
    336336
     
    343343    {
    344344        if (internalState_ & Calibrating)
    345             CCOUT(2) << "Warning: Cannot reload input system. Joy sticks are currently being calibrated." << std::endl;
     345            orxout(internal_warning, context::input) << "Cannot reload input system. Joy sticks are currently being calibrated." << endl;
    346346        else
    347347            reloadInternal();
     
    351351    void InputManager::reloadInternal()
    352352    {
    353         CCOUT(4) << "Reloading ..." << std::endl;
     353        orxout(verbose, context::input) << "InputManager: Reloading ..." << endl;
    354354
    355355        this->destroyDevices();
     
    357357
    358358        internalState_ &= ~Bad;
    359         CCOUT(4) << "Reloading complete." << std::endl;
     359        orxout(verbose, context::input) << "InputManager: Reloading complete." << endl;
    360360    }
    361361
     
    471471    void InputManager::calibrate()
    472472    {
    473         COUT(0) << "Move all joy stick axes fully in all directions." << std::endl
    474                 << "When done, put the axex in the middle position and press enter." << std::endl;
     473        orxout(message) << "Move all joy stick axes fully in all directions." << '\n'
     474                        << "When done, put the axex in the middle position and press enter." << endl;
    475475
    476476        BOOST_FOREACH(InputDevice* device, devices_)
     
    495495        this->clearBuffers();
    496496
    497         COUT(0) << "Calibration has been stored." << std::endl;
     497        orxout(message) << "Calibration has been stored." << endl;
    498498    }
    499499
     
    535535                    if (it->second->getPriority() == priority)
    536536                    {
    537                         COUT(2) << "Warning: Could not add an InputState with the same priority '"
    538                             << static_cast<int>(priority) << "' != 0." << std::endl;
     537                        orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '"
     538                            << static_cast<int>(priority) << "' != 0." << endl;
    539539                        return 0;
    540540                    }
     
    548548        else
    549549        {
    550             COUT(2) << "Warning: Could not add an InputState with the same name '" << name << "'." << std::endl;
     550            orxout(internal_warning, context::input) << "Could not add an InputState with the same name '" << name << "'." << endl;
    551551            return 0;
    552552        }
     
    598598        if (name == "empty")
    599599        {
    600             COUT(2) << "InputManager: Leaving the empty state is not allowed!" << std::endl;
     600            orxout(internal_warning, context::input) << "InputManager: Leaving the empty state is not allowed!" << endl;
    601601            return false;
    602602        }
     
    623623        if (name == "empty")
    624624        {
    625             COUT(2) << "InputManager: Removing the empty state is not allowed!" << std::endl;
     625            orxout(internal_warning, context::input) << "InputManager: Removing the empty state is not allowed!" << endl;
    626626            return false;
    627627        }
     
    649649        if (name == "empty")
    650650        {
    651             COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl;
     651            orxout(internal_warning, context::input) << "InputManager: Changing the empty state is not allowed!" << endl;
    652652            return false;
    653653        }
  • code/trunk/src/libraries/core/input/JoyStick.cc

    r6536 r8858  
    8080        }
    8181
    82         COUT(4) << "Created OIS joy stick with ID " << deviceName_ << std::endl;
     82        orxout(verbose, context::input) << "Created OIS joy stick with ID " << deviceName_ << endl;
    8383
    8484        // Load calibration
  • code/trunk/src/libraries/core/input/KeyBinder.cc

    r8366 r8858  
    3232#include <sstream>
    3333#include "util/Convert.h"
    34 #include "util/Debug.h"
     34#include "util/Output.h"
    3535#include "util/Exception.h"
    3636#include "core/ConfigValueIncludes.h"
     
    251251    void KeyBinder::loadBindings()
    252252    {
    253         COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
     253        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings..." << endl;
    254254
    255255        this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun());
     
    277277        }
    278278
    279         COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
     279        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl;
    280280    }
    281281
     
    294294        else
    295295        {
    296             COUT(2) << "Could not find key/button/axis with name '" << name << "'." << std::endl;
     296            orxout(internal_warning, context::input) << "Could not find key/button/axis with name '" << name << "'." << endl;
    297297            return false;
    298298        }
  • code/trunk/src/libraries/core/input/KeyBinderManager.cc

    r7284 r8858  
    2929#include "KeyBinderManager.h"
    3030
    31 #include "util/Debug.h"
     31#include "util/Output.h"
    3232#include "util/Exception.h"
    3333#include "util/ScopedSingletonManager.h"
     
    168168        if (!this->bBinding_)
    169169        {
    170             COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
     170            orxout(message) << "Press any button/key or move a mouse/joystick axis" << endl;
    171171            KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this));
    172172            InputManager::getInstance().enterState("detector");
     
    185185            if (keyName == "Keys.KeyEscape")
    186186            {
    187                 COUT(0) << "Keybinding aborted." << std::endl;
     187                orxout(message) << "Keybinding aborted." << endl;
    188188            }
    189189            else
    190190            {
    191                 COUT(0) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << std::endl;
     191                orxout(message) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << endl;
    192192                this->currentBinder_->setBinding(command_, keyName, bTemporary_);
    193193            }
  • code/trunk/src/libraries/network/CMakeLists.txt

    r8351 r8858  
    1919
    2020SET_SOURCE_FILES(NETWORK_SRC_FILES
    21   ChatListener.cc
    2221  Client.cc
    2322  ClientConnection.cc
     
    4544
    4645SET_SOURCE_FILES(NETWORK_HDR_FILES
    47   ChatListener.h
    4846  Client.h
    4947  ClientConnection.h
     
    6159  WANDiscovery.h
    6260  MasterServerComm.h
     61  NetworkChatListener.h
    6362  NetworkFunction.h
    6463  NetworkPrecompiledHeaders.h
  • code/trunk/src/libraries/network/Client.cc

    r8327 r8858  
    4444
    4545#include "util/Clock.h"
    46 #include "util/Debug.h"
     46#include "util/Output.h"
    4747#include "util/ScopedSingletonManager.h"
    4848#include "synchronisable/Synchronisable.h"
     
    116116  }
    117117
    118   bool Client::processChat(const std::string& message, unsigned int playerID)
    119   {
    120 //    COUT(1) << "Player " << playerID << ": " << message << std::endl;
    121     return true;
    122   }
    123 
    124118  void Client::printRTT()
    125119  {
    126     COUT(0) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;
    127   }
    128 
    129   /**
    130    * This function implements the method of sending a chat message to the server
     120    orxout(message) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;
     121  }
     122
     123  /**
     124   * @brief Sends a chat message to the server.
    131125   * @param message message to be sent
    132    * @return result(true/false)
     126   * @param sourceID the ID of the sender
     127   * @param targetID the ID of the receiver
    133128   */
    134   bool Client::chat(const std::string& message)
    135   {
    136     packet::Chat *m = new packet::Chat(message, Host::getPlayerID());
    137     return m->send(static_cast<Host*>(this));
    138   }
    139 
     129  void Client::doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
     130  {
     131    // send the message to the server
     132    packet::Chat* packet = new packet::Chat(message, sourceID, targetID);
     133    packet->send(static_cast<Host*>(this));
     134  }
     135
     136  /**
     137   * @brief Gets called if a packet::Chat packet is received. Calls the parent function which passes the message to the listeners.
     138   */
     139  void Client::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
     140  {
     141    // call the parent function which passes the message to the listeners
     142    Host::doReceiveChat(message, sourceID, targetID);
     143  }
    140144
    141145  /**
     
    150154    {
    151155      timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
    152       //     COUT(3) << '.';
    153156      if ( isConnected() && isSynched_ )
    154157      {
    155         COUT(4) << "popping partial gamestate: " << std::endl;
     158        orxout(verbose, context::network) << "popping partial gamestate: " << endl;
    156159//         packet::Gamestate *gs = GamestateClient::getGamestate();
    157160        if( GamestateManager::update() )
     
    166169        //assert(gs); <--- there might be the case that no data has to be sent, so its commented out now
    167170//         if(gs){
    168 //           COUT(4) << "client tick: sending gs " << gs << std::endl;
     171//           orxout(verbose, context::network) << "client tick: sending gs " << gs << endl;
    169172//           if( !gs->send() )
    170 //             COUT(2) << "Problem adding partial gamestate to queue" << std::endl;
     173//             orxout(internal_warning, context::network) << "Problem adding partial gamestate to queue" << endl;
    171174//         // gs gets automatically deleted by enet callback
    172175//         }
     
    204207    Game::getInstance().popState();
    205208  }
    206  
     209
    207210  void Client::processPacket(packet::Packet* packet)
    208211  {
     
    217220      packet->process(static_cast<Host*>(this));
    218221  }
    219 
    220 
    221 
    222 
    223222}
  • code/trunk/src/libraries/network/Client.h

    r7801 r8858  
    7373    Client();
    7474    ~Client();
    75    
     75
    7676    static Client* getInstance(){ return singletonPtr_s; } // tolua_export
    7777
     
    8181    void queuePacket(ENetPacket* packet, int clientID, uint8_t channelID);
    8282    virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
    83     bool processChat(const std::string& message, unsigned int playerID);
    84     virtual bool chat(const std::string& message);
    85     virtual bool broadcast(const std::string& message) { return false; }
     83    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     84    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    8685    virtual void printRTT();
    8786
  • code/trunk/src/libraries/network/ClientConnection.cc

    r8327 r8858  
    3232#define WIN32_LEAN_AND_MEAN
    3333#include <enet/enet.h>
    34 #include "util/Debug.h"
     34#include "util/Output.h"
    3535
    3636namespace orxonox
     
    6060  void ClientConnection::setServerAddress( const std::string& serverAddress ) {
    6161    if (enet_address_set_host (this->serverAddress_, serverAddress.c_str()) < 0)
    62         COUT(1) << "Error: Could not resolve \"" << serverAddress << "\"." << std::endl;
     62        orxout(internal_error, context::network) << "Could not resolve \"" << serverAddress << "\"." << endl;
    6363  }
    6464
     
    7676    if ( this->host_ == NULL )
    7777    {
    78       COUT(1) << "ClientConnection: host_ == NULL" << std::endl;
     78      orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl;
    7979      // error handling
    8080      return false;
     
    8686    assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL );
    8787    if (this->host_->socket4 == ENET_SOCKET_NULL)
    88         COUT(2) << "Warning: IPv4 Socket failed." << std::endl;
     88        orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl;
    8989    else if (this->host_->socket6 == ENET_SOCKET_NULL)
    90         COUT(2) << "Warning: IPv6 Socket failed." << std::endl;
     90        orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl;
    9191    else
    92         COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;
     92        orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl;
    9393
    9494    this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0);
    9595    if ( this->server_==NULL )
    9696    {
    97       COUT(1) << "ClientConnection: server_ == NULL" << std::endl;
     97      orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl;
    9898      // error handling
    9999      return false;
     
    113113      }
    114114    }
    115     COUT(1) << "Could not connect to server" << endl;
     115    orxout(user_error, context::network) << "Could not connect to server" << endl;
    116116    return false;
    117117  }
     
    140140            break;
    141141          case ENET_EVENT_TYPE_DISCONNECT:
    142             COUT(4) << "received disconnect confirmation from server" << endl;
     142            orxout(verbose, context::network) << "received disconnect confirmation from server" << endl;
    143143            this->connectionClosed();
    144144            return true;
     
    167167  {
    168168    this->established_=false;
    169     COUT(1) << "Received disconnect Packet from Server!" << endl;
     169    orxout(internal_error, context::network) << "Received disconnect Packet from Server!" << endl;
    170170        // server closed the connection
    171171    this->stopCommunicationThread();
  • code/trunk/src/libraries/network/Connection.cc

    r8327 r8858  
    144144      while( outgoingEventsCount > 0 )
    145145      {
    146 //         COUT(0) << "outgoing event" << endl;
     146//         orxout(verbose, context::network) << "outgoing event" << endl;
    147147        this->outgoingEventsMutex_->lock();
    148148        outgoingEvent outEvent = this->outgoingEvents_.front();
  • code/trunk/src/libraries/network/GamestateManager.cc

    r8407 r8858  
    5252#include "core/command/Executor.h"
    5353#include "core/GameMode.h"
    54 #include "util/Debug.h"
     54#include "util/Output.h"
    5555#include "util/Clock.h"
    5656#include "util/OrxAssert.h"
     
    128128    if( !this->sendPacket(ack))
    129129    {
    130       COUT(3) << "could not ack gamestate: " << gamestateID << std::endl;
     130      orxout(internal_warning, context::network) << "could not ack gamestate: " << gamestateID << endl;
    131131      return false;
    132132    }
    133133    else
    134134    {
    135       COUT(5) << "acked a gamestate: " << gamestateID << std::endl;
     135      orxout(verbose_more, context::network) << "acked a gamestate: " << gamestateID << endl;
    136136      return true;
    137137    }
     
    182182      if( !peerIt->second.isSynched )
    183183      {
    184         COUT(5) << "Server: not sending gamestate" << std::endl;
     184        orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
    185185        continue;
    186186      }
    187       COUT(5) << "client id: " << peerIt->first << std::endl;
    188       COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;
     187      orxout(verbose_more, context::network) << "client id: " << peerIt->first << endl;
     188      orxout(verbose_more, context::network) << "Server: doing gamestate gamestate preparation" << endl;
    189189      int peerID = peerIt->first; //get client id
    190190
     
    256256//     OrxVerify(gs->compressData(), "");
    257257    clock.capture();
    258     COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl;
    259 //     COUT(5) << "sending gamestate with id " << gs->getID();
     258    orxout(verbose_more, context::network) << "diff and compress time: " << clock.getDeltaTime() << endl;
     259//     orxout(verbose_more, context::network) << "sending gamestate with id " << gs->getID();
    260260//     if(gamestate->isDiffed())
    261 //       COUT(5) << " and baseid " << gs->getBaseID() << endl;
     261//       orxout(verbose_more, context::network) << " and baseid " << gs->getBaseID() << endl;
    262262//     else
    263 //       COUT(5) << endl;
     263//       orxout(verbose_more, context::network) << endl;
    264264    gs->setPeerID(peerID);
    265265    destgamestate = gs;
     
    291291    if( gamestateID <= curid && curid != GAMESTATEID_INITIAL )
    292292        return true;
    293 COUT(4) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << std::endl;
     293orxout(verbose, context::network) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << endl;
    294294    std::map<uint32_t, packet::Gamestate*>::iterator it2;
    295295    for( it2=it->second.gamestates.begin(); it2!=it->second.gamestates.end(); )
  • code/trunk/src/libraries/network/Host.cc

    r8408 r8858  
    3232#include <string>
    3333
     34#include "core/CoreIncludes.h"
    3435#include "core/ObjectList.h"
    3536#include "core/command/ConsoleCommand.h"
    36 #include "ChatListener.h"
     37#include "NetworkChatListener.h"
    3738
    3839namespace orxonox {
     
    4142  static const std::string __CC_printRTT_name = "printRTT";
    4243
    43   SetConsoleCommand("chat", &Host::Chat);
    4444  SetConsoleCommand(__CC_printRTT_group, __CC_printRTT_name, &Host::printRTT);
    4545
     
    8989  }
    9090
    91   void Host::Chat(const std::string& message)
     91  /**
     92   * @brief Sends a chat message through the network.
     93   * @param message message to be sent
     94   * @param sourceID the ID of the sender
     95   * @param targetID the ID of the receiver
     96   */
     97  void Host::sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
    9298  {
    93     if(instances_s.size()==0)
    94     {
    95       for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    96         it->incomingChat(message, 0);
    97 //      return true;
    98     }
    99     else
    100     {
    101       bool result = true;
    102       for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    103       {
    104         if( (*it)->isActive() )
    105         {
    106           if( !(*it)->chat(message) )
    107             result = false;
    108         }
    109       }
    110 //      return result;
    111     }
     99    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
     100      if( (*it)->isActive() )
     101        (*it)->doSendChat(message, sourceID, targetID);
    112102  }
    113103
    114   bool Host::Broadcast(const std::string& message)
     104  /**
     105   * @brief Gets called if a packet::Chat packet is received. Passes the message to the listeners.
     106   */
     107  void Host::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
    115108  {
    116     if(instances_s.size()==0)
    117     {
    118       for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    119         it->incomingChat(message, NETWORK_PEER_ID_BROADCAST);
    120       return true;
    121     }
    122     else
    123     {
    124       bool result = true;
    125       for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    126       {
    127         if( (*it)->isActive() )
    128         {
    129           if( !(*it)->broadcast(message) )
    130             result = false;
    131         }
    132       }
    133       return result;
    134     }
     109    for (ObjectList<NetworkChatListener>::iterator it = ObjectList<NetworkChatListener>::begin(); it != ObjectList<NetworkChatListener>::end(); ++it)
     110      it->incomingChat(message, sourceID);
    135111  }
    136112
    137   bool Host::incomingChat(const std::string& message, unsigned int playerID)
    138   {
    139     for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    140       it->incomingChat(message, playerID);
    141 
    142     bool result = true;
    143     for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    144     {
    145       if( (*it)->isActive() )
    146       {
    147         if( !(*it)->processChat(message, playerID) )
    148           result = false;
    149       }
    150     }
    151     return result;
    152   }
    153113
    154114  bool Host::isServer()
     
    156116    for (std::vector<Host*>::iterator it=instances_s.begin(); it!=instances_s.end(); ++it )
    157117    {
    158       if( (*it)->isServer_() )
    159         return true;
     118      if( (*it)->isActive() )
     119      {
     120        if( (*it)->isServer_() )
     121          return true;
     122      }
    160123    }
    161124    return false;
    162125  }
    163  
     126
    164127  Host* Host::getActiveInstance()
    165128  {
     
    176139
    177140
     141  //////////////////////////////////////////////////////////////////////////
     142  // NetworkChatListener                                                  //
     143  //////////////////////////////////////////////////////////////////////////
     144
     145  NetworkChatListener::NetworkChatListener()
     146  {
     147      RegisterRootObject(NetworkChatListener);
     148  }
     149
    178150}//namespace orxonox
  • code/trunk/src/libraries/network/Host.h

    r8403 r8858  
    5252class _NetworkExport Host: public GamestateManager
    5353{
     54  friend class packet::Chat;
     55
    5456  private:
    55     //TODO add these functions or adequate
    56     //virtual bool processChat(packet::Chat *message, unsigned int clientID)=0;
    57     //virtual bool sendChat(packet::Chat *chat)=0;
    5857    virtual void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID)=0;
    59     virtual bool chat(const std::string& message)=0;
    60     virtual bool broadcast(const std::string& message)=0;
    61     virtual bool processChat(const std::string& message, unsigned int playerID)=0;
    6258    virtual bool isServer_()=0;
    63 
    64 
    6559
    6660  protected:
     
    6862    virtual ~Host();
    6963    void setActive( bool bActive ){ bIsActive_ = bActive; }
    70 //     static Host *instance_;
     64
     65    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)=0;
     66    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)=0;
    7167
    7268  public:
     
    7470    static bool running(){ return instances_s.size(); }
    7571    static void addPacket(ENetPacket* packet, int clientID = NETWORK_PEER_ID_SERVER, uint8_t channelID = 0);
    76     //static bool chat(std::string& message);
    77 //     static bool receiveChat(packet::Chat *message, unsigned int clientID);
    7872    static unsigned int getPlayerID(){ return clientID_s; }
    7973    static void setClientID(unsigned int id){ clientID_s = id; }
    8074    static bool isServer();
    81     static void Chat(const std::string& message);
    82     static bool Broadcast(const std::string& message);
    83     static bool incomingChat(const std::string& message, unsigned int playerID);
     75    static void sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    8476    virtual void printRTT()=0;
    8577    bool isActive(){ return bIsActive_; }
  • code/trunk/src/libraries/network/LANDiscoverable.cc

    r8351 r8858  
    3333#include <cstring>
    3434
    35 #include "util/Debug.h"
     35#include "util/Output.h"
    3636#include "packet/ServerInformation.h"
    3737
     
    7171      this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 );
    7272      if ( this->host_ == NULL )
    73           COUT(1) << "LANDiscoverable: host_ == NULL" << std::endl;
     73          orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl;
    7474    }
    7575    else
     
    9494      {
    9595        case ENET_EVENT_TYPE_CONNECT:
    96             COUT(4) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << std::endl;
     96            orxout(verbose, context::network) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << endl;
    9797            break;
    9898        case ENET_EVENT_TYPE_DISCONNECT:
     
    102102          if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 )      // check for a suitable orxonox client
    103103          {
    104             COUT(3) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << std::endl;
     104            orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl;
    105105            packet::ServerInformation info;
    106106            info.setServerName("Orxonox Server");
  • code/trunk/src/libraries/network/LANDiscovery.cc

    r8706 r8858  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Oliver Scheuss
    2424 *   Co-authors:
    2525 *      ...
     
    4444    this->host_ = enet_host_create(NULL, 10, 0, 0, 0 );
    4545    if ( this->host_ == NULL )
    46         COUT(1) << "LANDiscovery: host_ == NULL" << std::endl;
     46        orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl;
    4747  }
    4848
     
    6666    peer = enet_host_connect(this->host_, &address, 0, 0);
    6767    if (peer == NULL)
    68         COUT(1) << "Error: Could not send LAN discovery to IPv4 Broadcast." << std::endl;
     68        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl;
    6969
    7070    /* IPv6 */
     
    7272    peer = enet_host_connect(this->host_, &address, 0, 0);
    7373    if (peer == NULL)
    74         COUT(1) << "Error: Could not send LAN discovery to IPv6 Multicast." << std::endl;
     74        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl;
    7575
    7676    ENetEvent event;
     
    8181        case ENET_EVENT_TYPE_CONNECT:
    8282        {
    83           COUT(4) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << std::endl;
     83          orxout(verbose, context::network) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << endl;
    8484          ENetPacket* packet = enet_packet_create(LAN_DISCOVERY_MESSAGE, strlen(LAN_DISCOVERY_MESSAGE)+1, ENET_PACKET_FLAG_RELIABLE);
    8585          enet_peer_send(event.peer, 0, packet);
     
    8989          {
    9090            packet::ServerInformation info(&event);
    91             COUT(3) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
     91            orxout(internal_info, context::network) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
    9292            std::vector<packet::ServerInformation>::iterator it;
    9393            for( it=this->servers_.begin(); it!=this->servers_.end(); ++it )
  • code/trunk/src/libraries/network/LANDiscovery.h

    r8351 r8858  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Oliver Scheuss
    2424 *   Co-authors:
    2525 *      ...
  • code/trunk/src/libraries/network/MasterServer.cc

    r8351 r8858  
    3838  helper_output_debug( ENetEvent *event, char *addrconv )
    3939  {
    40     COUT(4) << "A packet of length"
     40    orxout(verbose, context::master_server)
     41      << "A packet of length"
    4142      << event->packet->dataLength
    4243      << " containing "
     
    4546      << addrconv
    4647      << " on channel "
    47       << event->channelID << "\n";
     48      << event->channelID << endl;
    4849  }
    4950
     
    6667          + MSPROTO_SERVERLIST_ITEM_LEN + 2,1 );
    6768      if( !tosend )
    68       { COUT(2) << "Masterserver.cc: Memory allocation failed.\n";
     69      { orxout(internal_warning, context::master_server) << "Masterserver.cc: Memory allocation failed." << endl;
    6970        continue;
    7071      }
     
    108109  { /* check for bad parameters */
    109110    if( !event )
    110     { COUT(2) << "MasterServer::eventConnect: No event given.\n" ;
     111    { orxout(internal_warning, context::master_server) << "MasterServer::eventConnect: No event given." << endl;
    111112      return -1;
    112113    }
     
    117118
    118119    /* output debug info */
    119     COUT(4) << "A new client connected from "
     120    orxout(verbose, context::master_server) << "A new client connected from "
    120121      << addrconv
    121122      << " on port "
    122       << event->peer->address.port << "\n";
     123      << event->peer->address.port << endl;
    123124
    124125    /* store string form of address here */
     
    134135  { /* check for bad parameters */
    135136    if( !event )
    136     { COUT(2) << "No event given.\n";
     137    { orxout(internal_warning, context::master_server) << "No event given." << endl;
    137138      return -1;
    138139    }
    139140
    140141    /* output that the disconnect happened */
    141     COUT(4) << (char*)event->peer->data << " disconnected.\n";
     142    orxout(verbose, context::master_server) << (char*)event->peer->data << " disconnected." << endl;
    142143
    143144    /* create string from peer data */
     
    159160  { /* validate packet */
    160161    if( !event || !(event->packet) || !(event->peer) )
    161     { COUT(2) << "No complete event given.\n";
     162    { orxout(internal_warning, context::master_server) << "No complete event given." << endl;
    162163      return -1;
    163164    }
     
    182183       
    183184        /* tell people we did so */
    184         COUT(2) << "Added new server to list: " <<
    185           packet::ServerInformation( event ).getServerIP() << "\n";
     185        orxout(internal_info, context::master_server) << "Added new server to list: " <<
     186          packet::ServerInformation( event ).getServerIP() << endl;
    186187      }
    187188
     
    197198
    198199        /* tell the user */
    199         COUT(2) << "Removed server " << name << " from list.\n";
     200        orxout(internal_info, context::master_server) << "Removed server " << name << " from list." << endl;
    200201      }
    201202
     
    230231    if( event == NULL )
    231232    {
    232       COUT(1) << "Could not create ENetEvent structure, exiting.\n";
     233      orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl;
    233234      exit( EXIT_FAILURE );
    234235    }
     
    263264    /***** INITIALIZE NETWORKING *****/
    264265    if( enet_initialize () != 0)
    265     { COUT(1) << "An error occurred while initializing ENet.\n";
     266    { orxout(user_error, context::master_server) << "An error occurred while initializing ENet." << endl;
    266267      exit( EXIT_FAILURE );
    267268    }
     
    285286    /* see if creation worked */
    286287    if( !this->server )
    287     { COUT(1) <<
    288         "An error occurred while trying to create an ENet server host.\n";
     288    { orxout(user_error, context::master_server) <<
     289        "An error occurred while trying to create an ENet server host." << endl;
    289290      exit( EXIT_FAILURE );
    290291    }
     
    294295
    295296    /* tell people we're now initialized */
    296     COUT(0) << "MasterServer initialized, waiting for connections.\n";
     297    orxout(internal_status, context::master_server) << "MasterServer initialized, waiting for connections." << endl;
    297298  }
    298299
  • code/trunk/src/libraries/network/MasterServerComm.cc

    r8351 r8858  
    2828
    2929#include "MasterServerComm.h"
    30 #include "util/Debug.h"
     30#include "util/Output.h"
     31#include "WANDiscovery.h"
    3132
    3233namespace orxonox
     
    4445    /* initialize Enet */
    4546    if( enet_initialize () != 0 )
    46     { COUT(1) << "An error occurred while initializing ENet.\n";
     47    { orxout(internal_error, context::master_server) << "An error occurred while initializing ENet." << endl;
    4748      return 1;
    4849    }
     
    6162    /* see if it worked */
    6263    if (this->client == NULL)
    63     { COUT(1) << "An error occurred while trying to create an "
    64         << "ENet client host.\n";
     64    { orxout(internal_error, context::master_server) << "An error occurred while trying to create an "
     65        << "ENet client host." << endl;
    6566      return 1;
    6667    }
     
    8586
    8687    if( this->peer == NULL )
    87     { COUT(2) << "ERROR: No available peers for initiating an ENet"
    88         << " connection.\n";
     88    { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet"
     89        << " connection." << endl;
    8990      return -1;
    9091    }
     
    9394    if (enet_host_service (this->client, &this->event, 500) > 0 &&
    9495        this->event.type == ENET_EVENT_TYPE_CONNECT )
    95       COUT(3) << "Connection to master server succeeded.\n";
     96      orxout(internal_info, context::master_server) << "Connection to master server succeeded." << endl;
    9697    else
    9798    {
    9899      enet_peer_reset (this->peer);
    99       COUT(2) << "ERROR: connection to " << address << " failed.\n";
     100      orxout(internal_warning, context::master_server) << "Connection to " << address << " failed." << endl;
    100101      return -1;
    101102    }
     
    128129
    129130        case ENET_EVENT_TYPE_DISCONNECT:
    130           COUT(4) << "Disconnect from master server successful.\n";
     131          orxout(verbose, context::master_server) << "Disconnect from master server successful." << endl;
    131132          return 0;
    132133        default: break;
     
    149150   * so we can also make callbacks from objects
    150151   */
    151   int MasterServerComm::pollForReply( int (*callback)( char*, ENetEvent* ),
    152     int delayms )
     152  int MasterServerComm::pollForReply( WANDiscovery* listener, int delayms )
    153153  {
    154154    /* see whether anything happened */
    155155    /* WORK MARK REMOVE THIS OUTPUT */
    156     COUT(2) << "polling masterserver...\n";
     156    orxout(verbose, context::master_server) << "polling masterserver..." << endl;
    157157
    158158    /* address buffer */
     
    176176          addrconv = (char *) calloc( 50, 1 );
    177177          if( !addrconv )
    178           { COUT(2) << "MasterServerComm.cc: Could not allocate memory!\n";
     178          { orxout(internal_warning, context::master_server) << "MasterServerComm.cc: Could not allocate memory!" << endl;
    179179            break;
    180180          }
     
    185185
    186186          /* DEBUG */
    187           COUT(3) << "MasterServer Debug: A packet of length "
     187          orxout(verbose, context::master_server) << "MasterServer Debug: A packet of length "
    188188            << this->event.packet->dataLength
    189189            << " containing " << this->event.packet->data
     
    193193
    194194          /* call the supplied callback, if any. */
    195           if( (*callback) != NULL )
    196             retval = (*callback)( addrconv, &(this->event) );
     195          if( listener != NULL )
     196            retval = listener->rhandler( addrconv, &(this->event) );
    197197
    198198          /* clean up */
  • code/trunk/src/libraries/network/MasterServerComm.h

    r8351 r8858  
    9393       *
    9494       * Poll the master server for new data and act accordingly */
    95       int pollForReply( int (*callback)( char*, ENetEvent* ), int delayms );
     95      int pollForReply( WANDiscovery* listener, int delayms );
    9696
    9797    private:
  • code/trunk/src/libraries/network/NetworkPrecompiledHeaders.h

    r8351 r8858  
    5252#include <set>      // 20
    5353
    54 #include "util/Debug.h"      // 20
     54#include "util/Output.h"      // 20
    5555#include <loki/TypeTraits.h> // 18
    5656
  • code/trunk/src/libraries/network/NetworkPrereqs.h

    r8351 r8858  
    118118namespace orxonox
    119119{
    120   class ChatListener;
    121120  class Client;
    122121  class ClientConnection;
     
    130129  class GamestateManager;
    131130  class Host;
     131  class MasterServer;
     132  class MasterServerComm;
     133  class NetworkChatListener;
    132134  class NetworkFunctionBase;
    133135  struct NetworkFunctionPointer;
     
    136138  class NetworkMemberFunction;
    137139  class NetworkMemberFunctionBase;
     140  class PeerList;
    138141  class Server;
    139142  class ServerConnection;
    140143  class TrafficControl;
     144  class WANDiscoverable;
     145  class WANDiscovery;
    141146
    142147  // packet
  • code/trunk/src/libraries/network/PeerList.cc

    r8351 r8858  
    2828
    2929#include "PeerList.h"
    30 #include <network/packet/ServerInformation.h>
     30
    3131#include <cstdio>
     32#include "util/Output.h"
     33#include "network/packet/ServerInformation.h"
    3234
    3335namespace orxonox
     
    4042  { /* error correction */
    4143    if( toadd == NULL )
    42     { fprintf( stderr, "PeerList::addPeer: empty peer given.\n" );
     44    { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl;
    4345      return -1;
    4446    }
  • code/trunk/src/libraries/network/Server.cc

    r8706 r8858  
    4747
    4848#include "util/Clock.h"
    49 #include "util/Debug.h"
     49#include "util/Output.h"
    5050#include "core/ObjectList.h"
    5151#include "core/command/Executor.h"
     
    5656#include "packet/Gamestate.h"
    5757#include "packet/Welcome.h"
    58 #include "ChatListener.h"
    5958// #include "ClientInformation.h"
    6059#include "FunctionCallManager.h"
    6160#include "GamestateManager.h"
    62 #include "WANDiscovery.h"
    6361
    6462namespace orxonox
     
    10098  }
    10199
    102 
    103   /** helper that connects to the master server */
    104   void Server::helper_ConnectToMasterserver()
    105   {
    106 //     WANDiscovery::getInstance().msc.sendRequest( MSPROTO_GAME_SERVER " "
    107 //       MSPROTO_REGISTER_SERVER );
    108   }
    109 
    110100  /**
    111101  * This function opens the server by creating the listener thread
     
    114104  {
    115105    Host::setActive(true);
    116     COUT(4) << "opening server" << endl;
     106    orxout(verbose, context::network) << "opening server" << endl;
    117107    this->openListener();
    118    
     108
    119109    /* make discoverable on LAN */
    120110    LANDiscoverable::setActivity(true);
     
    122112    /* make discoverable on WAN */
    123113    WANDiscoverable::setActivity(true);
    124     /* TODO this needs to be optional, we need a switch from the UI to
    125      * enable/disable this
    126      */
    127 //     helper_ConnectToMasterserver();
    128114
    129115    /* done */
     
    137123  {
    138124    Host::setActive(false);
    139     COUT(4) << "closing server" << endl;
     125    orxout(verbose, context::network) << "closing server" << endl;
    140126    this->disconnectClients();
    141127    this->closeListener();
    142128
    143129    /* tell master server we're closing */
    144     COUT(2) << "disconnecting." << endl;
    145     WANDiscoverable::setActivity(false);   
    146     COUT(2) << "disconnecting done" << endl;
     130    orxout(internal_info, context::network) << "disconnecting." << endl;
     131    WANDiscoverable::setActivity(false);
     132    orxout(internal_info, context::network) << "disconnecting done" << endl;
    147133
    148134    LANDiscoverable::setActivity(false);
    149135    return;
    150   }
    151 
    152   bool Server::processChat(const std::string& message, unsigned int playerID)
    153   {
    154 //     ClientInformation *temp = ClientInformation::getBegin();
    155     packet::Chat *chat;
    156 //     while(temp){
    157     chat = new packet::Chat(message, playerID);
    158     chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
    159     chat->send( static_cast<Host*>(this) );
    160 //         COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
    161 //       temp = temp->next();
    162 //     }
    163 //    COUT(1) << "Player " << playerID << ": " << message << std::endl;
    164     return true;
    165   }
    166 
    167 
    168   /* handle incoming data */
    169   int rephandler( char *addr, ENetEvent *ev )
    170   {
    171     /* reply to pings */
    172     if( !strncmp( (char *)ev->packet->data, MSPROTO_PING_GAMESERVER,
    173       MSPROTO_PING_GAMESERVER_LEN ) )
    174       //this->msc.sendRequest( MSPROTO_ACK );
    175       /* NOTE implement this after pollForReply
    176        * reimplementation
    177        */
    178       return 0;
    179 
    180     /* done handling, return all ok code 0 */
    181     return 0;
    182   }
    183 
    184   void Server::helper_HandleMasterServerRequests()
    185   {
    186     /* poll the master server for replies and see whether something
    187      * has to be done or changed.
    188      */
    189     //WANDiscovery::getInstance().msc.pollForReply( rhandler, 10 );
    190136  }
    191137
     
    202148    // receive and process incoming discovery packets
    203149    LANDiscoverable::update();
    204    
    205     // receive and process requests from master server
    206     /* todo */
    207     //helper_HandleMasterServerRequests();
    208150
    209151    if ( GamestateManager::hasPeers() )
     
    246188  {
    247189//     for( ClientInformation* temp=ClientInformation::getBegin(); temp!=0; temp=temp->next() )
    248 //       COUT(0) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;
     190//       orxout(message) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;
    249191  }
    250192
     
    268210      return;
    269211    GamestateManager::update();
    270 //     COUT(5) << "Server: one gamestate update complete, goig to sendGameState" << std::endl;
    271     //std::cout << "updated gamestate, sending it" << std::endl;
     212//     orxout(verbose_more, context::network) << "Server: one gamestate update complete, goig to sendGameState" << endl;
     213    //orxout(verbose_more, context::network) << "updated gamestate, sending it" << endl;
    272214    //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
    273215    sendGameStates();
    274216    sendObjectDeletes();
    275 //     COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
    276     //std::cout << "sent gamestate" << std::endl;
     217//     orxout(verbose_more, context::network) << "Server: one sendGameState turn complete, repeat in next tick" << endl;
     218    //orxout(verbose_more, context::network) << "sent gamestate" << endl;
    277219  }
    278220
     
    305247      return true;  //everything ok (no deletes this tick)
    306248    }
    307 //     COUT(3) << "sending DeleteObjects" << std::endl;
     249//     orxout(verbose, context::network) << "sending DeleteObjects" << endl;
    308250//     while(temp != NULL){
    309251//       if( !(temp->getSynched()) )
    310252//       {
    311 //         COUT(5) << "Server: not sending gamestate" << std::endl;
     253//         orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
    312254//         temp=temp->next();
    313255//         continue;
     
    318260    del->setPeerID(NETWORK_PEER_ID_BROADCAST);
    319261    if ( !del->send( static_cast<Host*>(this) ) )
    320       COUT(3) << "Server: could not broadcast deleteObjects packet" << std::endl;
     262      orxout(internal_warning, context::network) << "Server: could not broadcast deleteObjects packet" << endl;
    321263//       temp=temp->next();
    322264      // gs gets automatically deleted by enet callback
     
    330272  {
    331273//     static unsigned int newid=1;
    332 // 
    333 //     COUT(2) << "Server: adding client" << std::endl;
     274//
     275//     orxout(internal_info, context::network) << "Server: adding client" << endl;
    334276//     ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
    335277//     if(!temp)
    336278//     {
    337 //       COUT(2) << "Server: could not add client" << std::endl;
     279//       orxout(internal_warning, context::network) << "Server: could not add client" << endl;
    338280//     }
    339281//     temp->setID(newid);
     
    347289//     ++newid;
    348290
    349     COUT(3) << "Server: added client id: " << peerID << std::endl;
     291    orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl;
    350292    createClient(peerID);
    351293}
     
    353295  void Server::removePeer(uint32_t peerID)
    354296  {
    355     COUT(4) << "removing client from list" << std::endl;
     297    orxout(verbose, context::network) << "removing client from list" << endl;
    356298//     ClientInformation *client = ClientInformation::findClient(&event->peer->address);
    357299//     if(!client)
     
    375317//     }
    376318  }
    377  
     319
    378320  void Server::processPacket(packet::Packet* packet)
    379321  {
     
    395337//     if(!temp)
    396338//     {
    397 //       COUT(2) << "Server. could not create client with id: " << clientID << std::endl;
     339//       orxout(internal_error, context::network) << "Server. could not create client with id: " << clientID << endl;
    398340//       return false;
    399341//     }
    400 //     COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;
     342//     orxout(verbose, context::network) << "Con.Man: creating client id: " << temp->getID() << endl;
    401343
    402344    // synchronise class ids
     
    411353//     temp->setSynched(true);
    412354    GamestateManager::setSynched(clientID);
    413    
    414     COUT(4) << "sending welcome" << std::endl;
     355
     356    orxout(verbose, context::network) << "sending welcome" << endl;
    415357    packet::Welcome *w = new packet::Welcome(clientID);
    416358    w->setPeerID(clientID);
     
    438380  }
    439381
    440   bool Server::chat(const std::string& message)
    441   {
    442       return this->sendChat(message, Host::getPlayerID());
    443   }
    444 
    445   bool Server::broadcast(const std::string& message)
    446   {
    447       return this->sendChat(message, NETWORK_PEER_ID_BROADCAST);
    448   }
    449 
    450   bool Server::sendChat(const std::string& message, unsigned int clientID)
    451   {
    452 //     ClientInformation *temp = ClientInformation::getBegin();
    453     packet::Chat *chat;
    454 //     while(temp)
    455     {
    456       chat = new packet::Chat(message, clientID);
    457       chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
    458       chat->send( static_cast<Host*>(this) );
    459 //         COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
    460 //       temp = temp->next();
    461     }
    462 //    COUT(1) << "Player " << Host::getPlayerID() << ": " << message << std::endl;
    463     for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    464       it->incomingChat(message, clientID);
    465 
    466     return true;
     382  /**
     383   * @brief Sends a chat message to the given target ID.
     384   * @param message message to be sent
     385   * @param sourceID the ID of the sender
     386   * @param targetID the ID of the receiver
     387   */
     388  void Server::doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
     389  {
     390    // check if the target exists. just ignore the message otherwise
     391    if (!this->isValidTarget(targetID)) // TODO: remove this if an invalid clientIDs don't trigger assertions anymore
     392      return;
     393
     394    // send the message to the target
     395    packet::Chat* packet = new packet::Chat(message, sourceID, targetID);
     396    packet->setPeerID(targetID);
     397    packet->send( static_cast<Host*>(this) );
     398
     399    // if the target is (or includes) this host as well, call the parent function which passes the message to the listeners
     400    if (targetID == NETWORK_PEER_ID_BROADCAST || targetID == Host::getPlayerID())
     401      Host::doReceiveChat(message, sourceID, targetID);
     402  }
     403
     404  /**
     405   * @brief Gets called if a packet::Chat packet is received. Forwards the packet to the target
     406   * and calls the parent function if necessary.
     407   */
     408  void Server::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
     409  {
     410      this->doSendChat(message, sourceID, targetID);
     411  }
     412
     413  /**
     414   * @brief Returns true if the target ID is in the list of clients (or if it
     415   * corresponds to the broadcast or the server ID).
     416   */
     417  bool Server::isValidTarget(unsigned int targetID)
     418  {
     419    if (targetID == NETWORK_PEER_ID_BROADCAST || targetID == NETWORK_PEER_ID_SERVER)
     420      return true;
     421
     422    std::vector<uint32_t>::iterator it;
     423    for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it )
     424      if( *it == targetID )
     425        return true;
     426
     427    return false;
    467428  }
    468429
     
    476437    }
    477438    assert(failures<10);
    478     COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;
     439    orxout(verbose, context::network) << "syncClassid:\tall synchClassID packets have been sent" << endl;
    479440  }
    480441
  • code/trunk/src/libraries/network/Server.h

    r8351 r8858  
    4242#include "LANDiscoverable.h"
    4343#include "WANDiscoverable.h"
    44 // #include "MasterServerComm.h"
    45 // #include "MasterServerProtocol.h"
    4644
    4745
     
    6159    ~Server();
    6260
    63     /* helpers */
    64     void helper_ConnectToMasterserver();
    65     void helper_HandleMasterServerRequests();
    66     int replyhandler( char *addr, ENetEvent *ev );
    67 
    6861    void open();
    6962    void close();
    70     bool processChat(const std::string& message, unsigned int playerID);
    7163    void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID);
    7264    virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
     
    8981    bool sendGameStates();
    9082    bool sendObjectDeletes();
    91     virtual bool chat(const std::string& message);
    92     virtual bool broadcast(const std::string& message);
    93     bool sendChat(const std::string& message, unsigned int clientID);
     83    bool isValidTarget(unsigned int targetID);
     84    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     85    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    9486    void syncClassid(unsigned int clientID);
    9587
  • code/trunk/src/libraries/network/ServerConnection.cc

    r8358 r8858  
    3434#include <enet/enet.h>
    3535
    36 #include "util/Debug.h"
     36#include "util/Output.h"
    3737#include <util/Sleep.h>
    3838// #include "ClientInformation.h"
     
    6161  {
    6262    if (enet_address_set_host (this->bindAddress_, bindAddress.c_str()) < 0)
    63         COUT(1) << "Error: Could not resolve \"" << bindAddress << "\"." << std::endl;
     63        orxout(internal_error, context::network) << "Could not resolve \"" << bindAddress << "\"." << endl;
    6464  }
    6565
     
    7575    if ( this->host_ == NULL )
    7676    {
    77         COUT(1) << "ServerConnection: host_ == NULL" << std::endl;
     77        orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl;
    7878        return false;
    7979    }
     
    8383    assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL );
    8484    if (this->host_->socket4 == ENET_SOCKET_NULL)
    85         COUT(2) << "Warning: IPv4 Socket failed." << std::endl;
     85        orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl;
    8686    else if (this->host_->socket6 == ENET_SOCKET_NULL)
    87         COUT(2) << "Warning: IPv6 Socket failed." << std::endl;
     87        orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl;
    8888    else
    89         COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;
     89        orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl;
    9090   
    9191    // start communication thread
     
    114114//       ClientInformation *temp = ClientInformation::findClient(clientID);
    115115//       if(!temp){
    116 //         COUT(3) << "C.Man: addPacket findClient failed" << std::endl;
     116//         orxout(internal_warning, context::network) << "C.Man: addPacket findClient failed" << endl;
    117117//       }
    118118      Connection::addPacket(packet, clientID, channelID);
  • code/trunk/src/libraries/network/TrafficControl.cc

    r6417 r8858  
    287287  {
    288288    std::list<obj>::iterator it;
    289     COUT(0) << "=========== Objectlist ===========" << endl;
     289    orxout(debug_output, context::network) << "=========== Objectlist ===========" << endl;
    290290    for( it=list.begin(); it!=list.end(); it++)
    291       COUT(0) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
     291      orxout(debug_output, context::network) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
    292292  }
    293293
  • code/trunk/src/libraries/network/WANDiscoverable.cc

    r8351 r8858  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau (original)
     23 *      Sandro 'smerkli' Merkli
    2424 *   Co-authors:
    25  *      Sandro 'smerkli' Merkli (adaptions to WAN)
    26  *      ...
     25 *      Oliver Scheuss (original)
    2726 *
    2827 */
     
    4443  {
    4544    /* debugging output */
    46     COUT(4) << "Creating WANDiscoverable.\n";
     45    orxout(verbose, context::master_server) << "Creating WANDiscoverable." << endl;
    4746 
    4847    /* register object in orxonox */
     
    9190    if( msc.initialize() )
    9291    {
    93       COUT(2) << "Error: could not initialize master server communications!\n";
     92      orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl;
    9493      return false;
    9594    }
     
    9897    if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) )
    9998    {
    100       COUT(2) << "Error: could not connect to master server at "
    101                  << this->msaddress << std::endl;
     99      orxout(internal_error, context::master_server) << "Could not connect to master server at "
     100                 << this->msaddress << endl;
    102101      return false;
    103102    }
    104103                 
    105104    /* debugging output */
    106     COUT(4) << "Initialization of WANDiscoverable complete.\n";
     105    orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl;
    107106   
    108107   
  • code/trunk/src/libraries/network/WANDiscoverable.h

    r8729 r8858  
    1919 *   Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2020 *
    21  *   Author: Fabian 'x3n' Landau (original) Co-authors: Sandro 'smerkli' Merkli
    22  *   (copied and adapted to WAN)
     21 *   Author:
     22 *      Sandro 'smerkli' Merkli
     23 *   Co-authors:
     24 *      Oliver Scheuss (original)
    2325 *
    2426 */
  • code/trunk/src/libraries/network/WANDiscovery.cc

    r8351 r8858  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau (original)
     23 *      Sandro 'smerkli' Merkli
    2424 *   Co-authors:
    25  *      Sandro 'smerkli' Merkli (adaptions to WAN)
    26  *      ...
     25 *      Oliver Scheuss (original)
    2726 *
    2827 */
     
    3332#include <cstring>
    3433
    35 #include "util/ScopedSingletonManager.h"
    3634#include "core/CoreIncludes.h"
    3735
     
    3937namespace orxonox
    4038{
    41   ManageScopedSingleton(WANDiscovery, ScopeID::Graphics, true);
    42 
    43 
    4439  WANDiscovery::WANDiscovery()
    4540  {
    4641    /* debugging output */
    47     COUT(4) << "Creating WANDiscovery.\n";
     42    orxout(verbose, context::master_server) << "Creating WANDiscovery." << endl;
    4843 
    4944    /* register object in orxonox */
     
    5550    /* initialize it and see if it worked */
    5651    if( msc.initialize() )
    57       COUT(2) << "Error: could not initialize master server communications!\n";
     52      orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl;
    5853
    5954    /* connect and see if it worked */
    6055    if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) )
    61       COUT(2) << "Error: could not connect to master server at "
    62         << this->msaddress << std::endl;
     56      orxout(internal_error, context::master_server) << "Could not connect to master server at "
     57        << this->msaddress << endl;
    6358
    6459    /* debugging output */
    65     COUT(4) << "Initialization of WANDiscovery complete.\n";
     60    orxout(verbose, context::master_server) << "Initialization of WANDiscovery complete." << endl;
    6661  }
    6762
     
    8176
    8277  /* callback for the network reply poller */
    83   int rhandler( char *addr, ENetEvent *ev )
     78  int WANDiscovery::rhandler( char *addr, ENetEvent *ev )
    8479  {
    8580    /* error recognition */
    8681    if( !ev || !ev->packet || !ev->packet->data )
    87     { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n";
     82    { orxout(internal_warning, context::master_server) << "Bad arguments received in WANDiscovery's reply handler." << endl;
    8883      return 0;
    8984    }
     
    10499
    105100      /* add to list */
    106       WANDiscovery::getInstance().servers_.push_back( toadd );
     101      this->servers_.push_back( toadd );
    107102    }
    108103    else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
     
    133128    {
    134129      /* poll for reply and act according to what was received */
    135       switch( this->msc.pollForReply( rhandler, 500 ) )
     130      switch( this->msc.pollForReply( this, 500 ) )
    136131      { case 0: /* no event occured, decrease timeout */
    137132          --i; break;
  • code/trunk/src/libraries/network/WANDiscovery.h

    r8351 r8858  
    1919 *   Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2020 *
    21  *   Author: Fabian 'x3n' Landau (original) Co-authors: Sandro 'smerkli' Merkli
    22  *   (copied and adapted to WAN)
     21 *   Author:
     22 *      Sandro 'smerkli' Merkli
     23 *   Co-authors:
     24 *      Oliver Scheuss (original)
    2325 *
    2426 */
     
    3032#include "packet/ServerInformation.h"
    3133#include "core/ConfigFileManager.h"
    32 #include "util/Singleton.h"
    3334#include "core/OrxonoxClass.h"
    3435#include "core/ConfigValueIncludes.h"
     
    4748  class _NetworkExport WANDiscovery
    4849// tolua_end
    49     : public Singleton<WANDiscovery>, public OrxonoxClass
     50    : public OrxonoxClass
    5051  { // tolua_export
    51     friend class Singleton<WANDiscovery>;
    5252    public:
    5353      /** constructor */
    54       WANDiscovery();
     54      WANDiscovery(); // tolua_export
    5555
    5656      /** destructor */
     
    8181      std::string getServerListItemIP( unsigned int index ); // tolua_export
    8282
    83       /** \return an instance of WANDiscovery
    84        *
    85        * Create and return an instance of WANDiscovery.
    86        */
    87       static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
    88    
    8983      /* todo: might make this private and use getter/setter methods
    9084       * at some later time.
     
    9892      /** Master server communications object */
    9993      MasterServerComm msc;
     94
     95      int rhandler( char *addr, ENetEvent *ev );
    10096     
    10197    private:
    102       /** Singleton pointer */
    103       static WANDiscovery* singletonPtr_s;
    104 
    10598      /** master server address */
    10699      std::string msaddress;
  • code/trunk/src/libraries/network/packet/Acknowledgement.cc

    r7801 r8858  
    2929#include "Acknowledgement.h"
    3030
    31 #include "util/Debug.h"
     31#include "util/Output.h"
    3232#include "network/GamestateHandler.h"
    3333#include "network/Host.h"
     
    6464
    6565bool Acknowledgement::process(orxonox::Host* host){
    66   COUT(5) << "processing ACK with ID: " << getAckID() << endl;
     66  orxout(verbose_more, context::packets) << "processing ACK with ID: " << getAckID() << endl;
    6767  bool b = host->ackGamestate(getAckID(), peerID_);
    6868  delete this;
  • code/trunk/src/libraries/network/packet/Chat.cc

    r7801 r8858  
    3939
    4040/* Some lengths */
    41 #define   _PACKETID         0
    42 const int _PLAYERID     =   _PACKETID + sizeof(Type::Value);
    43 #define   _MESSAGELENGTH    _PLAYERID + sizeof(uint32_t)
    44 #define   _MESSAGE          _MESSAGELENGTH + sizeof(uint32_t)
     41#define _PACKETID         0
     42#define _SOURCEID         _PACKETID + sizeof(Type::Value)
     43#define _TARGETID         _SOURCEID + sizeof(uint32_t)
     44#define _MESSAGELENGTH    _TARGETID + sizeof(uint32_t)
     45#define _MESSAGE          _MESSAGELENGTH + sizeof(uint32_t)
    4546
    46 Chat::Chat( const std::string& message, unsigned int playerID )
     47Chat::Chat( const std::string& message, unsigned int sourceID, unsigned int targetID )
    4748 : Packet()
    4849{
     
    5758
    5859  *(Type::Value *)(data_ + _PACKETID ) = Type::Chat;
    59   *(unsigned int *)(data_ + _PLAYERID ) = playerID;
     60  *(unsigned int *)(data_ + _SOURCEID ) = sourceID;
     61  *(unsigned int *)(data_ + _TARGETID ) = targetID;
    6062  *(unsigned int *)(data_ + _MESSAGELENGTH ) = messageLength_;
    6163
     
    8183
    8284bool Chat::process(orxonox::Host* host){
    83   bool b = host->incomingChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_PLAYERID));
     85  host->doReceiveChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_SOURCEID), *(uint32_t *)(data_+_TARGETID));
    8486  delete this;
    85   return b;
     87  return true;
    8688}
    8789
  • code/trunk/src/libraries/network/packet/Chat.h

    r7801 r8858  
    4242public:
    4343  /* constructors */
    44   Chat( const std::string& message, unsigned int playerID );
     44  Chat( const std::string& message, unsigned int sourceID, unsigned int targetID );
    4545  Chat( uint8_t* data, unsigned int clientID );
    4646
  • code/trunk/src/libraries/network/packet/ClassID.cc

    r7801 r8858  
    9292  assert(tempsize==packetSize);
    9393
    94   COUT(5) << "classid packetSize is " << packetSize << endl;
     94  orxout(verbose_more, context::packets) << "classid packetSize is " << packetSize << endl;
    9595
    9696}
     
    131131  Identifier::clearNetworkIDs();
    132132
    133   COUT(4) << "=== processing classids: " << endl;
     133  orxout(verbose, context::packets) << "=== processing classids: " << endl;
    134134  std::pair<uint32_t, std::string> tempPair;
    135135  Identifier *id;
     
    143143    classname = temp+2*sizeof(uint32_t);
    144144    id=ClassByString( std::string((const char*)classname) );
    145     COUT(3) << "processing classid: " << networkID << " name: " << classname << " id: " << id << std::endl;
     145    orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl;
    146146    if(id==NULL){
    147       COUT(0) << "Received a bad classname" << endl;
     147      orxout(user_error, context::packets) << "Received a bad classname" << endl;
    148148      abort();
    149149    }
  • code/trunk/src/libraries/network/packet/DeleteObjects.cc

    r7801 r8858  
    3131
    3232#include <cassert>
    33 #include "util/Debug.h"
     33#include "util/Output.h"
    3434#include "network/synchronisable/Synchronisable.h"
    3535
     
    6262  if(number==0)
    6363    return false;
    64   COUT(4) << "sending DeleteObjects: ";
     64  orxout(verbose, context::packets) << "sending DeleteObjects: ";
    6565  unsigned int size = sizeof(Type::Value) + sizeof(uint32_t)*(number+1);
    6666  data_ = new uint8_t[size];
     
    7373    unsigned int temp = Synchronisable::popDeletedObject();
    7474    *reinterpret_cast<uint32_t*>(tdata) = temp;
    75     COUT(4) << temp << ' ';
     75    orxout(verbose, context::packets) << temp << ' ';
    7676    tdata += sizeof(uint32_t);
    7777  }
    78   COUT(4) << std::endl;
     78  orxout(verbose, context::packets) << endl;
    7979  return true;
    8080}
     
    9090  for(unsigned int i=0; i<*(unsigned int *)(data_+_QUANTITY); i++)
    9191  {
    92     COUT(4) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << std::endl;
     92    orxout(verbose, context::packets) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << endl;
    9393    Synchronisable::deleteObject( *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) );
    9494  }
  • code/trunk/src/libraries/network/packet/FunctionIDs.cc

    r7801 r8858  
    3434#include <string>
    3535
    36 #include "util/Debug.h"
     36#include "util/Output.h"
    3737#include "core/ObjectList.h"
    3838#include "network/NetworkFunction.h"
     
    8888  }
    8989
    90   COUT(5) << "FunctionIDs packetSize is " << packetSize << endl;
     90  orxout(verbose_more, context::packets) << "FunctionIDs packetSize is " << packetSize << endl;
    9191
    9292}
     
    126126  unsigned char *functionname;
    127127
    128   COUT(4) << "=== processing functionids: " << endl;
     128  orxout(verbose, context::packets) << "=== processing functionids: " << endl;
    129129  std::pair<uint32_t, std::string> tempPair;
    130130  // read the total number of classes
     
    137137    stringsize = *(uint32_t*)(temp+sizeof(uint32_t));
    138138    functionname = temp+2*sizeof(uint32_t);
    139     COUT(3) << "processing functionid: " << networkID << " name: " << functionname << std::endl;
     139    orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl;
    140140    NetworkFunctionBase::setNetworkID((const char*)functionname, networkID);
    141141    temp += 2*sizeof(uint32_t) + stringsize;
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r8394 r8858  
    3131#include <zlib.h>
    3232
    33 #include "util/Debug.h"
     33#include "util/Output.h"
    3434#include "util/OrxAssert.h"
    3535#include "core/GameMode.h"
     
    108108  uint32_t size = calcGamestateSize(id, mode);
    109109
    110   COUT(5) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
     110  orxout(verbose_more, context::packets) << "G.ST.Man: producing gamestate with id: " << id << endl;
    111111  if(size==0)
    112112    return false;
     
    114114  if(!data_)
    115115  {
    116     COUT(2) << "GameStateManager: could not allocate memory" << std::endl;
     116    orxout(internal_warning, context::packets) << "GameStateManager: could not allocate memory" << endl;
    117117    return false;
    118118  }
     
    139139      assert(0); // if we don't use multithreading this part shouldn't be neccessary
    140140      // start allocate additional memory
    141       COUT(3) << "Gamestate: need additional memory" << std::endl;
     141      orxout(internal_info, context::packets) << "Gamestate: need additional memory" << endl;
    142142      ObjectList<Synchronisable>::iterator temp = it;
    143143      uint32_t addsize=tempsize;
     
    167167  //stop write gamestate header
    168168
    169   COUT(5) << "Gamestate: Gamestate size: " << currentsize << std::endl;
    170   COUT(5) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << std::endl;
     169  orxout(verbose_more, context::packets) << "Gamestate: Gamestate size: " << currentsize << endl;
     170  orxout(verbose_more, context::packets) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << endl;
    171171  return true;
    172172}
     
    175175bool Gamestate::spreadData(uint8_t mode)
    176176{
    177   COUT(5) << "processing gamestate with id " << header_.getID() << endl;
     177  orxout(verbose_more, context::packets) << "processing gamestate with id " << header_.getID() << endl;
    178178  assert(data_);
    179179  assert(!header_.isCompressed());
     
    195195      else
    196196      {
    197 //         COUT(4) << "not creating object of classid " << objectheader.getClassID() << endl;
     197//         orxout(verbose, context::packets) << "not creating object of classid " << objectheader.getClassID() << endl;
    198198        mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() );
    199199      }
     
    201201    else
    202202    {
    203 //       COUT(4) << "updating object of classid " << objectheader.getClassID() << endl;
     203//       orxout(verbose, context::packets) << "updating object of classid " << objectheader.getClassID() << endl;
    204204      OrxVerify(s->updateData(mem, mode), "ERROR: could not update Synchronisable with Gamestate data");
    205205    }
     
    219219        if (it->objectMode_ != 0x0)
    220220        {
    221           COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl;
    222           COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl;
    223           COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl;
     221          orxout(user_error, context::packets) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << endl;
     222          orxout(user_error, context::packets) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << endl;
     223          orxout(user_error, context::packets) << "Objects class: " << it->getIdentifier()->getName() << endl;
    224224          assert(false);
    225225        }
     
    232232          if (it->getObjectID() == *it2)
    233233          {
    234             COUT(0) << "Found duplicate objectIDs on the client!" << std::endl
    235                     << "Are you sure you don't create a Sychnronisable objcect with 'new' \
    236                         that doesn't have objectMode = 0x0?" << std::endl;
     234            orxout(user_error, context::packets) << "Found duplicate objectIDs on the client!" << endl
     235                                                 << "Are you sure you don't create a Sychnronisable objcect with 'new' \
     236                                                     that doesn't have objectMode = 0x0?" << endl;
    237237            assert(false);
    238238          }
     
    293293  switch ( retval )
    294294  {
    295     case Z_OK: COUT(5) << "G.St.Man: compress: successfully compressed" << std::endl; break;
    296     case Z_MEM_ERROR: COUT(1) << "G.St.Man: compress: not enough memory available in gamestate.compress" << std::endl; return false;
    297     case Z_BUF_ERROR: COUT(2) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << std::endl; return false;
    298     case Z_DATA_ERROR: COUT(2) << "G.St.Man: compress: data corrupted in gamestate.compress" << std::endl; return false;
     295    case Z_OK: orxout(verbose_more, context::packets) << "G.St.Man: compress: successfully compressed" << endl; break;
     296    case Z_MEM_ERROR: orxout(internal_error, context::packets) << "G.St.Man: compress: not enough memory available in gamestate.compress" << endl; return false;
     297    case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << endl; return false;
     298    case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: data corrupted in gamestate.compress" << endl; return false;
    299299  }
    300300
     
    310310  header_.setCompSize( buffer );
    311311  header_.setCompressed( true );
    312   COUT(4) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << std::endl;
     312  orxout(verbose, context::packets) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << endl;
    313313  return true;
    314314}
     
    319319  assert(data_);
    320320  assert(header_.isCompressed());
    321   COUT(4) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << std::endl;
     321  orxout(verbose, context::packets) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << endl;
    322322  uint32_t datasize = header_.getDataSize();
    323323  uint32_t compsize = header_.getCompSize();
     
    333333  switch ( retval )
    334334  {
    335     case Z_OK: COUT(5) << "successfully decompressed" << std::endl; break;
    336     case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return false;
    337     case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return false;
    338     case Z_DATA_ERROR: COUT(2) << "data corrupted (zlib)" << std::endl; return false;
     335    case Z_OK: orxout(verbose_more, context::packets) << "successfully decompressed" << endl; break;
     336    case Z_MEM_ERROR: orxout(internal_error, context::packets) << "not enough memory available" << endl; return false;
     337    case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "not enough memory available in the buffer" << endl; return false;
     338    case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "data corrupted (zlib)" << endl; return false;
    339339  }
    340340
     
    375375  if( memcmp( origDataPtr+objectOffset, baseDataPtr+objectOffset, objectHeader.getDataSize()) == 0 )
    376376  {
    377 //     COUT(4) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;
     377//     orxout(verbose, context::packets) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;
    378378    origDataPtr += objectOffset + objectHeader.getDataSize(); // skip the whole object
    379379    baseDataPtr += objectOffset + objectHeader.getDataSize();
     
    431431inline void /*Gamestate::*/copyObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes )
    432432{
    433   //       COUT(4) << "docopy" << endl;
     433  //       orxout(verbose, context::packets) << "docopy" << endl;
    434434  // Just copy over the whole Object
    435435  memcpy( newData, origData, objectHeader.getDataSize()+SynchronisableHeader::getSize() );
     
    440440//   SynchronisableHeader baseHeader( baseData );
    441441//   baseData += baseHeader.getDataSize()+SynchronisableHeader::getSize();
    442   //       COUT(4) << "copy " << h.getObjectID() << endl;
    443   //       COUT(4) << "copy " << h.getObjectID() << ":";
     442  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << endl;
     443  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << ":";
    444444  sizes += Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables();
    445445//   for( unsigned int i = 0; i < Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables(); ++i )
    446446//   {
    447 //     //         COUT(4) << " " << *sizes;
     447//     //         orxout(verbose, context::packets) << " " << *sizes;
    448448//     ++sizes;
    449449//   }
    450     //       COUT(4) << endl;
     450    //       orxout(verbose, context::packets) << endl;
    451451}
    452452
     
    541541      if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() )
    542542      {
    543 //         COUT(4) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     543//         orxout(verbose, context::packets) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    544544        diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    545545        diffedObject = true;
     
    547547      else
    548548      {
    549 //         COUT(4) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     549//         orxout(verbose, context::packets) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    550550        copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    551551        assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd);
     
    565565        if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() )
    566566        {
    567 //           COUT(4) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     567//           orxout(verbose, context::packets) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    568568          diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    569569          diffedObject = true;
     
    571571        else
    572572        {
    573 //           COUT(4) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     573//           orxout(verbose, context::packets) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    574574          copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    575575          assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd);
     
    578578      else
    579579      {
    580 //         COUT(4) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     580//         orxout(verbose, context::packets) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    581581        assert(baseDataPtr == oldBaseDataPtr);
    582582        copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
     
    718718  //copy in the zeros
    719719//   std::list<obj>::iterator itt;
    720 //   COUT(0) << "myvector contains:";
     720//   orxout() << "myvector contains:";
    721721//   for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ )
    722 //     COUT(0) << " " << (*itt).objID;
    723 //   COUT(0) << endl;
     722//     orxout() << " " << (*itt).objID;
     723//   orxout() << endl;
    724724  for(it=dataVector_.begin(); it!=dataVector_.end();){
    725725    SynchronisableHeader oldobjectheader(origdata);
     
    771771    nrOfVariables += it->getNrOfVariables();
    772772  }
    773 //   COUT(0) << "allocating " << nrOfVariables << " ints" << endl;
     773//   orxout() << "allocating " << nrOfVariables << " ints" << endl;
    774774  this->sizes_.reserve(nrOfVariables);
    775775  return size;
  • code/trunk/src/libraries/network/packet/Packet.cc

    r8327 r8858  
    3737#include <boost/thread/mutex.hpp>
    3838
    39 #include "util/Debug.h"
     39#include "util/Output.h"
    4040#include "Acknowledgement.h"
    4141#include "Chat.h"
     
    192192//     peerID = NETWORK_PEER_ID_SERVER;
    193193  Packet *p = 0;
    194 //   COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;
     194//   orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl;
    195195  switch( *(Type::Value *)(data + _PACKETID) )
    196196  {
    197197    case Type::Acknowledgement:
    198 //       COUT(5) << "ack" << std::endl;
     198//       orxout(verbose_more, context::packets) << "ack" << endl;
    199199    p = new Acknowledgement( data, peerID );
    200200      break;
    201201    case Type::Chat:
    202 //       COUT(5) << "chat" << std::endl;
     202//       orxout(verbose_more, context::packets) << "chat" << endl;
    203203      p = new Chat( data, peerID );
    204204      break;
    205205    case Type::ClassID:
    206 //       COUT(5) << "classid" << std::endl;
     206//       orxout(verbose_more, context::packets) << "classid" << endl;
    207207      p = new ClassID( data, peerID );
    208208      break;
    209209    case Type::Gamestate:
    210 //       COUT(5) << "gamestate" << std::endl;
     210//       orxout(verbose_more, context::packets) << "gamestate" << endl;
    211211      p = new Gamestate( data, peerID );
    212212      break;
    213213    case Type::Welcome:
    214 //       COUT(5) << "welcome" << std::endl;
     214//       orxout(verbose_more, context::packets) << "welcome" << endl;
    215215      p = new Welcome( data, peerID );
    216216      break;
    217217    case Type::DeleteObjects:
    218 //       COUT(5) << "deleteobjects" << std::endl;
     218//       orxout(verbose_more, context::packets) << "deleteobjects" << endl;
    219219      p = new DeleteObjects( data, peerID );
    220220      break;
    221221    case Type::FunctionCalls:
    222 //       COUT(5) << "functionCalls" << std::endl;
     222//       orxout(verbose_more, context::packets) << "functionCalls" << endl;
    223223      p = new FunctionCalls( data, peerID );
    224224      break;
    225225    case Type::FunctionIDs:
    226 //       COUT(5) << "functionIDs" << std::endl;
     226//       orxout(verbose_more, context::packets) << "functionIDs" << endl;
    227227      p = new FunctionIDs( data, peerID );
    228228      break;
     
    255255  packetMap_.erase(it);
    256256  Packet::packetMapMutex_.unlock();
    257 //   COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;
     257//   orxout(verbose_ultra, context::packets) << "PacketMap size: " << packetMap_.size() << endl;
    258258}
    259259
  • code/trunk/src/libraries/network/packet/Welcome.cc

    r8706 r8858  
    3232
    3333#include <cassert>
    34 #include "util/Debug.h"
     34#include "util/Output.h"
    3535#include "network/Host.h"
    3636#include "network/synchronisable/Synchronisable.h"
     
    7878  assert(*(uint32_t *)(data_ + _ENDIANTEST ) == 0xFEDC4321);
    7979  host->setClientID(clientID);
    80   COUT(3) << "Welcome set clientId: " << clientID << endl;
     80  orxout(internal_info, context::packets) << "Welcome set clientId: " << clientID << endl;
    8181  Synchronisable::setClient(true);
    8282  delete this;
  • code/trunk/src/libraries/network/synchronisable/Synchronisable.cc

    r8706 r8858  
    130130//     assert( !header.isDiffed() );
    131131
    132     COUT(4) << "fabricating object with id: " << header.getObjectID() << std::endl;
     132    orxout(verbose, context::network) << "fabricating object with id: " << header.getObjectID() << endl;
    133133
    134134    Identifier* id = ClassByID(header.getClassID());
     
    136136    {
    137137        for(int i = 0; i<160; i++)
    138             COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
    139         COUT(0) << "Assertion failed: id" << std::endl;
    140         COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;
     138            orxout(user_error, context::network) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
     139        orxout(user_error, context::network) << "Assertion failed: id" << endl;
     140        orxout(user_error, context::network) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << endl;
    141141        abort();
    142142    }
     
    168168      bo->setLevel(creator->getLevel());          // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself)
    169169    //assert(no->classID_ == header.getClassID());
    170     COUT(4) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << std::endl;
     170    orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl;
    171171          // update data and create object/entity...
    172172    bool b = no->updateData(mem, mode, true);
     
    242242    uint8_t* oldmem = mem;
    243243    if (this->classID_==0)
    244       COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
     244      orxout(internal_info, context::network) << "classid 0 " << this->getIdentifier()->getName() << endl;
    245245#endif
    246246
     
    258258    // end copy header
    259259
    260     CCOUT(5) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << std::endl;
    261 //     COUT(4) << "objectid: " << this->objectID_ << ":";
     260    orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl;
     261//     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
    262262    // copy to location
    263263    for(i=syncList_.begin(); i!=syncList_.end(); ++i)
    264264    {
    265265      uint32_t varsize = (*i)->getData( mem, mode );
    266 //       COUT(4) << " " << varsize;
     266//       orxout(verbose, context::network) << " " << varsize;
    267267      tempsize += varsize;
    268268      sizes.push_back(varsize);
     
    271271    }
    272272    assert(tempsize!=0);  // if this happens an empty object (with no variables) would be transmitted
    273 //     COUT(4) << endl;
     273//     orxout(verbose, context::network) << endl;
    274274
    275275    header.setObjectID( this->objectID_ );
     
    305305    if(syncList_.empty())
    306306    {
     307      orxout(internal_warning, context::network) << "Synchronisable::updateData syncList_ is empty" << endl;
    307308      assert(0);
    308       COUT(2) << "Synchronisable::updateData syncList_ is empty" << std::endl;
    309309      return false;
    310310    }
     
    326326    }
    327327
    328     //COUT(5) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << std::endl;
     328    //orxout(verbose_more, context::network) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << endl;
    329329    if( !syncHeaderLight.isDiffed() )
    330330    {
     
    344344    {
    345345      mem += SynchronisableHeaderLight::getSize();
    346 //       COUT(0) << "objectID: " << this->objectID_ << endl;
     346//       orxout(debug_output, context::network) << "objectID: " << this->objectID_ << endl;
    347347      while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() )
    348348      {
    349349        VariableID varID = *(VariableID*)mem;
    350 //         COUT(0) << "varID: " << varID << endl;
     350//         orxout(debug_output, context::network) << "varID: " << varID << endl;
    351351        assert( varID < syncList_.size() );
    352352        mem += sizeof(VariableID);
  • code/trunk/src/libraries/network/synchronisable/Synchronisable.h

    r8706 r8858  
    232232        it++;
    233233    }
    234     COUT(1) << "Tried to unregister not registered variable" << endl;
     234    orxout(internal_error, context::network) << "Tried to unregister not registered variable" << endl;
    235235    assert(false); //if we reach this point something went wrong:
    236236    // the variable has not been registered before
  • code/trunk/src/libraries/network/synchronisable/SynchronisableVariable.h

    r7266 r8858  
    202202        if ( *static_cast<uint8_t*>(mem) != this->varReference_ )
    203203        { // wrong reference number, so discard the data
    204 //           COUT(0) << "discharding data" << endl;
     204//           orxout(debug_output, context::network) << "discharding data" << endl;
    205205          mem += getSize( mode ); // SynchronisableVariableBidirectional::getSize returns size of variable + reference
    206206          return;
  • code/trunk/src/libraries/tools/BillboardSet.cc

    r6417 r8858  
    8080        catch (...)
    8181        {
    82             COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
     82            orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl;
    8383            this->billboardSet_ = 0;
    8484        }
     
    103103        catch (...)
    104104        {
    105             COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
     105            orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl;
    106106            this->billboardSet_ = 0;
    107107        }
  • code/trunk/src/libraries/tools/Mesh.cc

    r8351 r8858  
    7272            catch (...)
    7373            {
    74                 COUT(1) << "Error: Couln't load mesh \"" << meshsource << '"' << std::endl;
     74                orxout(internal_error) << "Couldn't load mesh \"" << meshsource << '"' << endl;
    7575                this->entity_ = 0;
    7676            }
  • code/trunk/src/libraries/tools/ParticleInterface.cc

    r7166 r8858  
    7878            catch (...)
    7979            {
    80                 COUT(1) << "Error: Couln't load particle system \"" << templateName << '"' << std::endl;
     80                orxout(internal_error) << "Couldn't load particle system \"" << templateName << '"' << endl;
    8181                this->particleSystem_ = 0;
    8282            }
  • code/trunk/src/libraries/tools/ResourceCollection.cc

    r8351 r8858  
    6262        if (resourceGroup.empty())
    6363        {
    64             COUT(2) << "Warning: \"\" is not a valid resource group." << std::endl;
     64            orxout(internal_warning) << "\"\" is not a valid resource group." << endl;
    6565            return;
    6666        }
  • code/trunk/src/libraries/tools/ResourceLocation.cc

    r8366 r8858  
    8080        else
    8181        {
    82             COUT(2) << "Warning: ResourceLocation '" << this->getPath() << "' does not seem to exist" << std::endl;
     82            orxout(internal_warning) << "ResourceLocation '" << this->getPath() << "' does not seem to exist" << endl;
    8383            return;
    8484        }
     
    101101        catch (const Ogre::Exception& ex)
    102102        {
    103             COUT(1) << "Removing of a ResourceLocation failed: " << ex.what() << std::endl;
     103            orxout(internal_error) << "Removing of a ResourceLocation failed: " << ex.what() << endl;
    104104        }
    105105    }
  • code/trunk/src/libraries/tools/Shader.cc

    r8079 r8858  
    141141                }
    142142                else
    143                     COUT(2) << "Warning: Couldn't load compositor with name \"" << this->compositorName_ << "\"." << std::endl;
     143                    orxout(internal_warning) << "Couldn't load compositor with name \"" << this->compositorName_ << "\"." << endl;
    144144            }
    145145            this->oldcompositorName_ = this->compositorName_;
     
    217217                }
    218218                else
    219                     COUT(2) << "Warning: No pass " << it->pass_ << " in technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << std::endl;
     219                    orxout(internal_warning) << "No pass " << it->pass_ << " in technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
    220220            }
    221221            else
    222                 COUT(2) << "Warning: No technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << std::endl;
     222                orxout(internal_warning) << "No technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
    223223        }
    224224        this->parameters_.clear();
  • code/trunk/src/libraries/tools/Timer.h

    r8729 r8858  
    6666    void MyClass::myFunction()
    6767    {
    68         COUT(0) << "Hello World" << std::endl;
     68        orxout() << "Hello World" << endl;
    6969    }
    7070    @endcode
  • code/trunk/src/libraries/util/CMakeLists.txt

    r8729 r8858  
    2626  CRC32.cc
    2727  ExprParser.cc
    28   OutputHandler.cc
    2928  Scope.cc
    3029  ScopedSingletonManager.cc
     
    4241)
    4342
     43ADD_SUBDIRECTORY(output)
     44
    4445ORXONOX_ADD_LIBRARY(util
    4546  FIND_HEADER_FILES
  • code/trunk/src/libraries/util/Clipboard.cc

    r7401 r8858  
    4848#undef min
    4949#undef max
    50 #include "Debug.h"
     50#include "Output.h"
    5151
    5252namespace orxonox
     
    7676        catch (...)
    7777        {
    78             COUT(1) << "Error: Unable to copy the following text to the clipboard:" << std::endl;
    79             COUT(1) << "       \"" << text << '"' << std::endl;
     78            orxout(user_error) << "Unable to copy the following text to the clipboard:" << endl;
     79            orxout(user_error) << '"' << text << '"' << endl;
    8080        }
    8181        return false;
     
    104104        catch (...)
    105105        {
    106             COUT(1) << "Error: Unable to retrieve text from the clipboard." << std::endl;
     106            orxout(user_error) << "Unable to retrieve text from the clipboard." << endl;
    107107        }
    108108        return "";
  • code/trunk/src/libraries/util/Convert.h

    r8729 r8858  
    130130#include <loki/TypeManip.h>
    131131
    132 #include "Debug.h"
     132#include "Output.h"
    133133#include "ImplicitConversion.h"
    134134
     
    151151        ORX_FORCEINLINE static bool convert(ToType* /*output*/, const FromType& /*input*/)
    152152        {
    153             COUT(2) << "Could not convert value of type " << typeid(FromType).name()
    154                     << " to type " << typeid(ToType).name() << std::endl;
     153            orxout(internal_warning) << "Could not convert value of type " << typeid(FromType).name()
     154                                     << " to type " << typeid(ToType).name() << endl;
    155155            return false;
    156156        }
  • code/trunk/src/libraries/util/Exception.cc

    r8410 r8858  
    3737#include <cstddef>
    3838#include <CEGUIExceptions.h>
    39 #include "Debug.h"
     39#include "Output.h"
    4040
    4141namespace orxonox
     
    111111        catch (...)
    112112        {
    113             COUT(0) << "BIG WARNING: Unknown exception type encountered."
    114                     << "Rethrowing" << endl;
     113            orxout(user_error) << "BIG WARNING: Unknown exception type encountered."
     114                               << " Rethrowing" << endl;
    115115            throw;
    116116        }
  • code/trunk/src/libraries/util/Exception.h

    r8706 r8858  
    6363#include <sstream>
    6464#include <string>
    65 #include "Debug.h"
     65#include "Output.h"
    6666
    6767namespace orxonox
     
    176176    inline const T& exceptionThrowerHelper(const T& exception)
    177177    {
    178         // let the catcher decide whether to display the message below level 4
    179         COUT(4) << exception.getFullDescription() << std::endl;
     178        // let the catcher decide whether to display the message also to the user
     179        orxout(internal_error) << exception.getFullDescription() << endl;
    180180        return exception;
    181181    }
  • code/trunk/src/libraries/util/ExprParser.h

    r8351 r8858  
    5555            if (!expr.getRemains().empty())
    5656            {
    57                 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
     57                orxout(user_warning) << "Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << endl;
    5858            }
    5959            float result = expr.getResult();
    6060        }
    6161        else
    62             COUT(1) << "Error: Cannot calculate expression: Parse error." << std::endl;
     62            orxout(user_error) << "Cannot calculate expression: Parse error." << endl;
    6363        @endcode
    6464        getRemains() returns the expression after what could be parsed. For instance
  • code/trunk/src/libraries/util/MultiType.h

    r7401 r8858  
    7878    void myfunction(int value)
    7979    {
    80         COUT(0) << "doubled value is " << (2 * value) << std::endl;
     80        orxout() << "doubled value is " << (2 * value) << endl;
    8181    }
    8282
  • code/trunk/src/libraries/util/OrxAssert.h

    r8372 r8858  
    4040
    4141#include <cassert>
    42 #include "Debug.h"
     42#include "Output.h"
    4343
    4444#ifndef NDEBUG
     
    4646/** Run time assertion like assert(), but with an embedded message.
    4747@details
    48     The message will be printed as error with COUT(1). <br>
     48    The message will be printed as error with orxout(user_error). <br>
    4949    You can use the same magic here as you can with \ref ThrowException
    5050    @code
     
    5757        if (!(condition)) \
    5858        { \
    59             COUT(1) << __FILE__ << "(" << __LINE__ << "): "; \
    60             COUT(1) << "Assertion failed in " << __FUNCTIONNAME__ << std::endl; \
    61             COUT(1) << "Expression: " << #condition << std::endl; \
    62             COUT(1) << "Message   : " << errorMessage << std::endl; \
     59            orxout(user_error) << __FILE__ << "(" << __LINE__ << "): "; \
     60            orxout(user_error) << "Assertion failed in " << __FUNCTIONNAME__ << endl; \
     61            orxout(user_error) << "Expression: " << #condition << endl; \
     62            orxout(user_error) << "Message   : " << errorMessage << endl; \
    6363            /* Don't use the condition again to avoid double evaluation */ \
    6464            /* Instead, stringify the expression and negate it */ \
     
    7070    mode (no abort() triggered then).
    7171@details
    72     The message will be printed as error with COUT(1). <br>
     72    The message will be printed as error with orxout(user_error). <br>
    7373    You can use the same magic here as you can with \ref ThrowException
    7474    @code
     
    8181        if (!(condition)) \
    8282        { \
    83             COUT(1) << __FILE__ << "(" << __LINE__ << "): "; \
    84             COUT(1) << "Verification failed in " << __FUNCTIONNAME__ << std::endl; \
    85             COUT(1) << "Expression: " << #condition << std::endl; \
    86             COUT(1) << "Message   : " << errorMessage << std::endl; \
     83            orxout(user_error) << __FILE__ << "(" << __LINE__ << "): "; \
     84            orxout(user_error) << "Verification failed in " << __FUNCTIONNAME__ << endl; \
     85            orxout(user_error) << "Expression: " << #condition << endl; \
     86            orxout(user_error) << "Message   : " << errorMessage << endl; \
    8787            /* Don't use the condition again to avoid double evaluation */ \
    8888            /* Instead, stringify the expression and negate it */ \
     
    100100        if (!(condition)) \
    101101        { \
    102             COUT(1) << __FILE__ << "(" << __LINE__ << "): "; \
    103             COUT(1) << "Verification failed in " << __FUNCTIONNAME__ << std::endl; \
    104             COUT(1) << "Expression: " << #condition << std::endl; \
    105             COUT(1) << "Message   : " << errorMessage << std::endl; \
     102            orxout(user_error) << __FILE__ << "(" << __LINE__ << "): "; \
     103            orxout(user_error) << "Verification failed in " << __FUNCTIONNAME__ << endl; \
     104            orxout(user_error) << "Expression: " << #condition << endl; \
     105            orxout(user_error) << "Message   : " << errorMessage << endl; \
    106106            /* No assert() in release configuration */ \
    107107        } \
  • code/trunk/src/libraries/util/Scope.h

    r7401 r8858  
    6060#include <loki/ScopeGuard.h>
    6161
    62 #include "Debug.h"
     62#include "Output.h"
    6363
    6464namespace orxonox
     
    128128            Scope()
    129129            {
     130                orxout(internal_status) << "creating scope... (" << scope << ")" << endl;
     131
    130132                try
    131133                {
     
    148150                    throw;
    149151                }
     152
     153                orxout(internal_status) << "created scope (" << scope << ")" << endl;
    150154            }
    151155
     
    153157            ~Scope()
    154158            {
     159                orxout(internal_status) << "destroying scope... (" << scope << ")" << endl;
     160
    155161                ScopeManager::instanceCounts_s[scope]--;
    156162
     
    162168                if (ScopeManager::instanceCounts_s[scope] == 0)
    163169                    this->deactivateListeners();
     170
     171                orxout(internal_status) << "destroyed scope (" << scope << ")" << endl;
    164172            }
    165173
     
    174182                            { (*it)->deactivated(); }
    175183                        catch (...)
    176                             { COUT(0) << "ScopeListener::deactivated() failed! This MUST NOT happen, fix it!" << std::endl; }
     184                            { orxout(internal_warning) << "ScopeListener::deactivated() failed! This MUST NOT happen, fix it!" << endl; }
    177185                        (*(it++))->bActivated_ = false;
    178186                    }
  • code/trunk/src/libraries/util/ScopedSingletonManager.h

    r8706 r8858  
    231231                { singletonPtr_ = new T(); }
    232232            catch (const InitialisationAbortedException& ex)
    233                 { COUT(3) << ex.getDescription() << std::endl; }
     233                { orxout(internal_error) << ex.getDescription() << endl; }
    234234            catch (...)
    235                 { COUT(1) << "Singleton creation failed: " << Exception::handleMessage() << std::endl; }
     235                { orxout(internal_error) << "Singleton creation failed: " << Exception::handleMessage() << endl; }
    236236        }
    237237
  • code/trunk/src/libraries/util/SignalHandler.cc

    r8351 r8858  
    3939#include <cstdio>
    4040
    41 #include "Debug.h"
     41#include "Output.h"
    4242
    4343namespace orxonox
     
    127127      if( SignalHandler::singletonPtr_s == 0 )
    128128      {
    129         COUT(0) << "Received signal " << sigName.c_str() << std::endl << "Can't write backtrace because SignalHandler is already destroyed" << std::endl;
     129        orxout(user_error) << "Received signal " << sigName.c_str() << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl;
    130130        exit(EXIT_FAILURE);
    131131      }
     
    137137
    138138
    139       COUT(0) << "Received signal " << sigName.c_str() << std::endl << "Try to write backtrace to file orxonox_crash.log" << std::endl;
     139      orxout(user_error) << "Received signal " << sigName.c_str() << endl << "Try to write backtrace to file orxonox_crash.log" << endl;
    140140
    141141     
     
    206206#ifdef PR_SET_PTRACER
    207207        if( prctl(PR_SET_PTRACER, gdbPid, 0, 0, 0) == -1 )
    208           COUT(0) << "could not set proper permissions for GDB to attach to process..." << endl;
     208          orxout(user_error) << "could not set proper permissions for GDB to attach to process..." << endl;
    209209#endif
    210210       
     
    213213
    214214        if( read( sigPipe[0], &someData, sizeof(someData) ) != sizeof(someData) )
    215           COUT(0) << "something went wrong :(" << std::endl;
     215          orxout(user_error) << "something went wrong :(" << endl;
    216216
    217217        if ( someData != 0x12345678 )
    218218        {
    219           COUT(0) << "something went wrong :(" << std::endl;
     219          orxout(user_error) << "something went wrong :(" << endl;
    220220        }
    221221
     
    328328      if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
    329329      {
    330         COUT(0) << "could not write " << bt.length() << " byte to " << getInstance().filename << std::endl;
     330        orxout(user_error) << "could not write " << bt.length() << " byte to " << getInstance().filename << endl;
    331331        exit(EXIT_FAILURE);
    332332      }
     
    364364_UtilExport void __cdecl abort()
    365365{
    366     COUT(1) << "This application has requested the Runtime to terminate it in an unusual way." << std::endl;
    367     COUT(1) << "Please contact the application's support team for more information." << std::endl;
     366    using namespace orxonox;
     367    orxout(user_error) << "This application has requested the Runtime to terminate it in an unusual way." << endl;
     368    orxout(user_error) << "Please contact the application's support team for more information." << endl;
    368369    DebugBreak();
    369370    exit(0x3);
     
    373374_UtilExport void __cdecl _assert(const char* expression, const char* file, int line)
    374375{
    375     COUT(1) << "Assertion failed: " << expression << ", file " << file << ", line " << line << std::endl;
    376     COUT(1) << std::endl;
     376    using namespace orxonox;
     377    orxout(user_error) << "Assertion failed: " << expression << ", file " << file << ", line " << line << endl;
     378    orxout(user_error) << endl;
    377379    abort();
    378380}
     
    423425            bExecuting = true;
    424426
    425             COUT(1) << std::endl;
     427            orxout(user_error) << endl;
    426428
    427429            // if the signalhandler has already been destroyed then don't do anything
    428430            if (SignalHandler::singletonPtr_s == 0)
    429431            {
    430                 COUT(1) << "Caught an unhandled exception" << std::endl << "Can't write backtrace because SignalHandler is already destroyed" << std::endl;
     432                orxout(user_error) << "Caught an unhandled exception" << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl;
    431433                exit(EXIT_FAILURE);
    432434            }
    433435
    434             COUT(1) << "Caught an unhandled exception" << std::endl << "Try to write backtrace to orxonox_crash.log..." << std::endl;
     436            orxout(user_error) << "Caught an unhandled exception" << endl << "Try to write backtrace to orxonox_crash.log..." << endl;
    435437
    436438            // write the crash log
     
    439441            time_t now = time(NULL);
    440442
    441             crashlog << "=======================================================" << std::endl;
     443            crashlog << "=======================================================" << endl;
    442444            crashlog << "= Time: " << std::string(ctime(&now));
    443             crashlog << "=======================================================" << std::endl;
    444             crashlog << std::endl;
     445            crashlog << "=======================================================" << endl;
     446            crashlog << endl;
    445447
    446448            const std::string& error = SignalHandler::getExceptionType(pExceptionInfo);
    447449
    448             crashlog << error << std::endl;
    449             crashlog << std::endl;
     450            crashlog << error << endl;
     451            crashlog << endl;
    450452
    451453            const std::string& callstack = SignalHandler::getStackTrace(pExceptionInfo);
    452454
    453             crashlog << "Call stack:" << std::endl;
    454             crashlog << callstack << std::endl;
     455            crashlog << "Call stack:" << endl;
     456            crashlog << callstack << endl;
    455457
    456458            crashlog.close();
    457459
    458460            // print the same information also to the console
    459             COUT(1) << std::endl;
    460             COUT(1) << error << std::endl;
    461             COUT(1) << std::endl;
    462             COUT(1) << "Call stack:" << std::endl;
    463             COUT(1) << callstack << std::endl;
     461            orxout(user_error) << endl;
     462            orxout(user_error) << error << endl;
     463            orxout(user_error) << endl;
     464            orxout(user_error) << "Call stack:" << endl;
     465            orxout(user_error) << callstack << endl;
    464466
    465467            bExecuting = false;
     
    467469        else
    468470        {
    469             COUT(1) << "An error occurred while writing the backtrace" << std::endl;
     471            orxout(user_error) << "An error occurred while writing the backtrace" << endl;
    470472        }
    471473
  • code/trunk/src/libraries/util/Singleton.h

    r7904 r8858  
    100100    void TestSingleton::testFunction()                      // implement testFunction
    101101    {
    102         COUT(0) << "My value is " << this->testValue_ << std::endl;
     102        orxout() << "My value is " << this->testValue_ << endl;
    103103    }
    104104
  • code/trunk/src/libraries/util/Sleep.cc

    r5738 r8858  
    3434
    3535#include "Sleep.h"
    36 #include "Debug.h"
     36#include "Output.h"
    3737
    3838#ifdef ORXONOX_PLATFORM_WINDOWS
     
    4949    {
    5050        //if (microseconds < 1000)
    51         //    COUT(2) << "Warning: Windows cannot sleep less than 1ms, ignoring" << std::endl;
     51        //    orxout(internal_warning) << "Windows cannot sleep less than 1ms, ignoring" << endl;
    5252        Sleep(microseconds / 1000);
    5353    }
  • code/trunk/src/libraries/util/StringUtils.cc

    r8232 r8858  
    7979        for (; pos2 > 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
    8080        return str.substr(pos1, pos2 - pos1 + 1);
     81    }
     82
     83    /// Splits a given string by a delimiter and stores it in an output vector
     84    void vectorize(const std::string& str, char delimiter, std::vector<std::string>* output)
     85    {
     86        for (size_t start = 0, end = 0; end != std::string::npos; start = end + 1)
     87        {
     88            end = str.find_first_of(delimiter, start);
     89            output->push_back(str.substr(start, end - start));
     90        }
    8191    }
    8292
     
    517527        return matrix[(rows-1)*cols + cols-1];
    518528    }
    519    
     529
    520530    /**
    521531    @brief
  • code/trunk/src/libraries/util/StringUtils.h

    r8232 r8858  
    4343#include "UtilPrereqs.h"
    4444#include <string>
     45#include <vector>
    4546
    4647namespace orxonox
     
    5455
    5556    _UtilExport std::string  removeTrailingWhitespaces(const std::string& str);
     57
     58    _UtilExport void         vectorize(const std::string& str, char delimiter, std::vector<std::string>* output);
    5659
    5760    _UtilExport size_t       getNextQuote(const std::string& str, size_t start);
     
    8891
    8992    _UtilExport unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2);
    90    
     93
    9194    _UtilExport std::string  getTimestamp(void);
    9295}
  • code/trunk/src/libraries/util/SubString.cc

    r7401 r8858  
    4545#include "SubString.h"
    4646#include <cstdio>
    47 #include "Debug.h"
     47#include "Output.h"
    4848
    4949namespace orxonox
     
    513513    void SubString::debug() const
    514514    {
    515         COUT(0) << "Substring-information::count=" << this->tokens_.size() << " ::";
     515        orxout(debug_output) << "Substring-information::count=" << this->tokens_.size() << " ::";
    516516        for (unsigned int i = 0; i < this->tokens_.size(); ++i)
    517             COUT(0) << "s" << i << "='" << this->tokens_[i].c_str() << "'::";
    518         COUT(0) << std::endl;
     517            orxout(debug_output) << "s" << i << "='" << this->tokens_[i].c_str() << "'::";
     518        orxout(debug_output) << endl;
    519519    }
    520520}
  • code/trunk/src/libraries/util/SubString.h

    r8706 r8858  
    5959
    6060    for (unsigned int i = 0; i < tokens.size(); ++i)
    61         COUT(0) << i << ": " << tokens[i] << std::endl;
     61        orxout() << i << ": " << tokens[i] << endl;
    6262    @endcode
    6363
  • code/trunk/src/libraries/util/UtilPrereqs.h

    r8729 r8858  
    8888    class ExprParser;
    8989    class MultiType;
    90     class OutputHandler;
    9190    class OutputListener;
     91    class OutputManager;
     92    class OutputStream;
    9293    template <ScopeID::Value>
    9394    class Scope;
  • code/trunk/src/modules/designtools/ScreenshotManager.cc

    r8415 r8858  
    153153            finalImage->save(PathConfig::getInstance().getLogPathString() + "screenshot_" + getTimestamp() + this->fileExtension_);
    154154            delete finalImage;
    155             COUT(3) << "Finished taking " << this->gridSize_*this->windowWidth_ << "x" << this->gridSize_*this->windowHeight_ << " pixel HD screenshot. Storing in log/." << endl;
     155            orxout(user_info) << "Finished taking " << this->gridSize_*this->windowWidth_ << "x" << this->gridSize_*this->windowHeight_ << " pixel HD screenshot. Storing in log/." << endl;
    156156        }
    157157        else
    158             COUT(1) << "There needs to be an active camera to make screenshots." << endl;
     158            orxout(user_error) << "There needs to be an active camera to make screenshots." << endl;
    159159
    160160        this->cleanup();
     
    257257                this->buffer_->blitToMemory(this->finalPicturePB_->getSubVolume(subBox));
    258258               
    259                 COUT(4) << "Created screenshot number " << nbScreenshots << " for multi grid HD screenshot." << endl;
     259                orxout(internal_info) << "Created screenshot number " << nbScreenshots << " for multi grid HD screenshot." << endl;
    260260               
    261261            }
  • code/trunk/src/modules/designtools/SkyboxGenerator.cc

    r8413 r8858  
    149149            else
    150150            {
    151                 COUT(1) << "You must be in a level to generate a skybox." << endl;
     151                orxout(user_error) << "You must be in a level to generate a skybox." << endl;
    152152                this->bGenerateSkybox_ = false;
    153153                return;
     
    175175                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getInstance().getLogPathString(), "FileSystem", Resource::getDefaultResourceGroup());
    176176               
    177                 COUT(4) << "Setting up SkyboxGenerator..." << endl;
     177                orxout(internal_status) << "Setting up SkyboxGenerator..." << endl;
    178178               
    179179                this->bSetup_ = false;
     
    194194                    entity->pitch(Degree((float)rotate.second));
    195195               
    196                 COUT(4) << "Created face number " << this->faceCounter_ << "." << endl;
     196                orxout(internal_info) << "Created face number " << this->faceCounter_ << "." << endl;
    197197                // Check whether we've generated all 6 faces.
    198198                if(++this->faceCounter_ >= 6)
     
    225225                CommandExecutor::execute("pause");
    226226               
    227                 COUT(3) << "Skybox with face size " << this->size_ << "x" << this->size_ << " pixels created. Storing in log/." << endl;
     227                orxout(user_info) << "Skybox with face size " << this->size_ << "x" << this->size_ << " pixels created. Storing in log/." << endl;
    228228            }
    229229        }
  • code/trunk/src/modules/docking/Dock.cc

    r8729 r8858  
    8787        {
    8888            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
    89                 COUT(4) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
     89                orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
    9090                return false;
    9191            }
     
    9494        else
    9595        {
    96             COUT(4) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
     96            orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
    9797            return false;
    9898        }
    9999        if(player == NULL)
    100100        {
    101             COUT(4) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
     101            orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
    102102            return false;
    103103        }
     
    168168        if(candidates_.find(player) == candidates_.end())
    169169        {
    170             COUT(2) << "Dock::dock Player is not a candidate!" << std::endl;
     170            orxout(internal_warning, context::docking) << "Dock::dock Player is not a candidate!" << endl;
    171171            return false;
    172172        }
     
    187187        if(docked_.find(player) == docked_.end())
    188188        {
    189             COUT(2) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl;
     189            orxout(internal_warning, context::docking) << "Dock::dockingAnimationFinished Player is not currently docked." << endl;
    190190            return false;
    191191        }
     
    200200        if(docked_.find(player) == docked_.end())
    201201        {
    202             COUT(2) << "Dock::undock Player is not docked to this Dock." << std::endl;
     202            orxout(internal_warning, context::docking) << "Dock::undock Player is not docked to this Dock." << endl;
    203203            return false;
    204204        }
     
    218218
    219219    bool Dock::undockingAnimationFinished(PlayerInfo* player) {
    220         COUT(4) << "Dock::undockingAnimationFinished executed" << std::endl;
     220        orxout(verbose, context::docking) << "Dock::undockingAnimationFinished executed" << endl;
    221221        return true;
    222222    }
  • code/trunk/src/modules/docking/DockToShip.cc

    r8706 r8858  
    4343    {
    4444        RegisterObject(DockToShip);
    45         COUT(4) << "DockToShip instance created.." << endl;
     45        orxout(verbose, context::docking) << "DockToShip instance created.." << endl;
    4646    }
    4747
     
    6969    bool DockToShip::docking(PlayerInfo* player)
    7070    {
    71         COUT(4) << "DockToShip::attach" << endl;
     71        orxout(verbose, context::docking) << "DockToShip::attach" << endl;
    7272
    7373        DockingTarget *target = DockingEffect::findTarget(this->target_);
    7474        if (target == NULL) {
    75             COUT(0) << "Can't retrieve target for '" << this->target_ << "'.." << std::endl;
     75            orxout(internal_warning, context::docking) << "Can't retrieve target for '" << this->target_ << "'.." << endl;
    7676            return false;
    7777        }
     
    7979        ControllableEntity *dockTo = (ControllableEntity*) target->getParent();
    8080        if (dockTo == NULL) {
    81             COUT(2) << "Parent is not a ControllableEntity.." << std::endl;
     81            orxout(internal_warning, context::docking) << "Parent is not a ControllableEntity.." << endl;
    8282            return false;
    8383        }
     
    9292    bool DockToShip::release(PlayerInfo* player)
    9393    {
    94         COUT(4) << "DockToShip::release" << endl;
     94        orxout(verbose, context::docking) << "DockToShip::release" << endl;
    9595
    9696        player->stopTemporaryControl();
  • code/trunk/src/modules/docking/DockingController.cc

    r8706 r8858  
    9797        if (docking)
    9898        {
    99             COUT(4) << "DockingController::takeControl Taking over control." << std::endl;
     99            orxout(verbose, context::docking) << "DockingController::takeControl Taking over control." << endl;
    100100
    101101            this->entity_->setDestroyWhenPlayerLeft(false);
     
    108108    void DockingController::positionReached()
    109109    {
    110         COUT(4) << "DockingController::positionReached() called." << std::endl;
     110        orxout(verbose, context::docking) << "DockingController::positionReached() called." << endl;
    111111
    112112        assert(this->player_);
  • code/trunk/src/modules/docking/DockingTarget.cc

    r8706 r8858  
    5353        SUPER(DockingTarget, XMLPort, xmlelement, mode);
    5454
    55         COUT(4) << "DockingTarget with name '" << this->getName() << "' created.." << std::endl;
     55        orxout(verbose, context::docking) << "DockingTarget with name '" << this->getName() << "' created.." << endl;
    5656    }
    5757
  • code/trunk/src/modules/gametypes/RaceCheckPoint.cc

    r8767 r8858  
    2929#include "RaceCheckPoint.h"
    3030
     31#include "util/Convert.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/XMLPort.h"
    33 #include "util/Convert.h"
     34#include "chat/ChatManager.h"
    3435
    3536#include "SpaceRace.h"
     
    110111            {
    111112                const std::string& message =  "You have " + multi_cast<std::string>(this->bTimeLimit_)
    112                             + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1) + "\n";
    113                 COUT(3) << message;
     113                            + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
    114114                const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
     115                ChatManager::message(message);
    115116            }
    116117        }
  • code/trunk/src/modules/gametypes/SpaceRace.cc

    r8767 r8858  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "network/Host.h"
     32#include "chat/ChatManager.h"
    3333#include "util/Convert.h"
    3434#include "util/Math.h"
     
    5454            this->clock_.capture();
    5555            int s = this->clock_.getSeconds();
    56             int ms = this->clock_.getMilliseconds()-1000*s;
     56            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
    5757            const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
    5858                        + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
    5959                        + " before the time limit. You lose!";
    60             COUT(3) << message;
    6160            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
     61            ChatManager::message(message);
    6262        }
    6363        else
     
    6565            this->clock_.capture();
    6666            int s = this->clock_.getSeconds();
    67             int ms = this->clock_.getMilliseconds()-1000*s;
     67            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
    6868            const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
    6969                        + "." + multi_cast<std::string>(ms) + " seconds.";
    70             COUT(3) << message << std::endl;
    7170            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
     71            ChatManager::message(message);
     72/*
    7273            float time = this->clock_.getSecondsPrecise();
    7374            this->scores_.insert(time);
    7475            std::set<float>::iterator it;
    7576            for (it=this->scores_.begin(); it!=this->scores_.end(); it++)
    76             COUT(3) <<  multi_cast<std::string>(*it) << std::endl;
     77                orxout(level::message) << multi_cast<std::string>(*it) << endl;
     78*/
    7779        }
    7880    }
     
    8385
    8486        std::string message("The match has started! Reach the check points as quickly as possible!");
    85         COUT(3) << message << std::endl;
    8687        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
     88        ChatManager::message(message);
    8789    }
    8890
     
    9294        this->clock_.capture();
    9395        int s = this->clock_.getSeconds();
    94         int ms = this->clock_.getMilliseconds()-1000*s;
     96        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
    9597        const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
    9698                        + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
    97                         + " seconds.\n";
    98         COUT(3) << message;
     99                        + " seconds.";
    99100        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
     101        ChatManager::message(message);
    100102    }
    101103
  • code/trunk/src/modules/notifications/NotificationDispatcher.cc

    r8706 r8858  
    137137            return false;
    138138
    139         COUT(4) << "NotificationDispatcher (&" << this << ") triggered." << std::endl;
     139        orxout(verbose, context::notifications) << "NotificationDispatcher (&" << this << ") triggered." << endl;
    140140
    141141        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
     
    155155        if(player == NULL)
    156156        {
    157             COUT(4) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
     157            orxout(verbose, context::notifications) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
    158158            return false;
    159159        }
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r8706 r8858  
    5757        RegisterRootObject(NotificationManager);
    5858
    59         COUT(3) << "NotificatioManager created." << std::endl;
     59        orxout(internal_info, context::notifications) << "NotificatioManager created." << endl;
    6060    }
    6161
     
    7171        this->allNotificationsList_.clear();
    7272
    73         COUT(3) << "NotificationManager destroyed." << std::endl;
     73        orxout(internal_info, context::notifications) << "NotificationManager destroyed." << endl;
    7474    }
    7575
     
    132132
    133133        if(commandExecuted)
    134             COUT(3) << "Notification command \"" << NotificationListener::command2Str(command) << "\" executed." << endl;
     134            orxout(internal_info, context::notifications) << "Notification command \"" << NotificationListener::command2Str(command) << "\" executed." << endl;
    135135
    136136        return commandExecuted;
     
    198198        }
    199199
    200         COUT(4) << "Notification (&" << notification << ") registered with the NotificationManager." << std::endl;
     200        orxout(verbose, context::notifications) << "Notification (&" << notification << ") registered with the NotificationManager." << endl;
    201201
    202202        return true;
     
    219219        this->removeNotification(notification, *(this->notificationLists_.find(queue->getName())->second));
    220220
    221         COUT(4) << "Notification (&" << notification << ") unregistered with the NotificationManager from NotificationQueue " << queue->getName() << "." << std::endl;
     221        orxout(verbose, context::notifications) << "Notification (&" << notification << ") unregistered with the NotificationManager from NotificationQueue " << queue->getName() << "." << endl;
    222222    }
    223223
     
    351351        queue->update(); // Update the queue.
    352352       
    353         COUT(4) << "NotificationQueue '" << queue->getName() << "' registered with the NotificationManager." << std::endl;
     353        orxout(verbose, context::notifications) << "NotificationQueue '" << queue->getName() << "' registered with the NotificationManager." << endl;
    354354        return true;
    355355    }
     
    384384        this->notificationLists_.erase(queue->getName());
    385385       
    386         COUT(4) << "NotificationQueue '" << queue->getName() << "' unregistered with the NotificationManager." << std::endl;
     386        orxout(verbose, context::notifications) << "NotificationQueue '" << queue->getName() << "' unregistered with the NotificationManager." << endl;
    387387    }
    388388
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r8706 r8858  
    131131        {
    132132            this->registered_ = false;
    133             COUT(1) << "Error: NotificationQueue '" << this->getName() << "' could not be registered." << std::endl;
     133            orxout(internal_error, context::notifications) << "NotificationQueue '" << this->getName() << "' could not be registered." << endl;
    134134            return;
    135135        }
    136136
    137         COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
     137        orxout(internal_info, context::notifications) << "NotificationQueue '" << this->getName() << "' created." << endl;
    138138    }
    139139
     
    215215        delete notifications;
    216216
    217         COUT(4) << "NotificationQueue '" << this->getName() << "' updated." << std::endl;
     217        orxout(verbose, context::notifications) << "NotificationQueue '" << this->getName() << "' updated." << endl;
    218218    }
    219219
     
    232232        this->push(notification, time);
    233233
    234         COUT(4) << "NotificationQueue '" << this->getName() << "' updated. A new Notification has been added." << std::endl;
     234        orxout(verbose, context::notifications) << "NotificationQueue '" << this->getName() << "' updated. A new Notification has been added." << endl;
    235235    }
    236236
     
    265265        this->notificationPushed(notification);
    266266
    267         COUT(5) << "Notification \"" << notification->getMessage() << "\" pushed to NotificationQueue '" << this->getName() << "'" << endl;
    268         COUT(3) << "NotificationQueue \"" << this->getName() << "\": " << notification->getMessage() << endl;
     267        orxout(verbose_more, context::notifications) << "Notification \"" << notification->getMessage() << "\" pushed to NotificationQueue '" << this->getName() << "'" << endl;
     268        orxout(internal_info, context::notifications) << "NotificationQueue \"" << this->getName() << "\": " << notification->getMessage() << endl;
    269269    }
    270270
     
    284284            if(container == *it)
    285285            {
    286                 COUT(5) << "Notification \"" << (*it)->notification->getMessage() << "\" popped from NotificationQueue '" << this->getName() << "'" << endl;
     286                orxout(verbose_more, context::notifications) << "Notification \"" << (*it)->notification->getMessage() << "\" popped from NotificationQueue '" << this->getName() << "'" << endl;
    287287                this->ordering_.erase(it);
    288288                break;
     
    311311        std::vector<NotificationContainer*>::difference_type index = it - this->notifications_.begin ();
    312312
    313         COUT(5) << "Notification \"" << (*it)->notification->getMessage() << "\" removed from NotificationQueue '" << this->getName() << "'" << endl;
     313        orxout(verbose_more, context::notifications) << "Notification \"" << (*it)->notification->getMessage() << "\" removed from NotificationQueue '" << this->getName() << "'" << endl;
    314314
    315315        this->ordering_.erase(containerIterator);
     
    333333    void NotificationQueue::clear(bool noGraphics)
    334334    {
    335         COUT(4) << "Clearing NotificationQueue " << this->getName() << "." << endl;
     335        orxout(verbose, context::notifications) << "Clearing NotificationQueue " << this->getName() << "." << endl;
    336336        this->ordering_.clear();
    337337        // Delete all NotificationContainers in the list.
     
    367367        if(size == 0)
    368368        {
    369             COUT(2) << "Trying to set maximal size of NotificationQueue '" << this->getName() << "' to 0. Ignoring..." << endl;
     369            orxout(internal_warning, context::notifications) << "Trying to set maximal size of NotificationQueue '" << this->getName() << "' to 0. Ignoring..." << endl;
    370370            return;
    371371        }
     
    398398        if(time != NotificationQueue::INF && time <= 0)
    399399        {
    400             COUT(2) << "Trying to set display time of NotificationQueue '" << this->getName() << "' to non-positive value. Ignoring..." << endl;
     400            orxout(internal_warning, context::notifications) << "Trying to set display time of NotificationQueue '" << this->getName() << "' to non-positive value. Ignoring..." << endl;
    401401        }
    402402           
  • code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc

    r8729 r8858  
    143143        if(size.x < 0.0 || size.x > 1.0 || size.z < 0.0 || size.z > 1.0)
    144144        {
    145             COUT(2) << "The display size of the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative size was not in [0,1]. Aborting..." << endl;
     145            orxout(internal_warning, context::notifications) << "The display size of the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative size was not in [0,1]. Aborting..." << endl;
    146146            return;
    147147        }
     
    183183        if(position.x < 0.0 || position.x > 1.0 || position.z < 0.0 || position.z > 1.0)
    184184        {
    185             COUT(2) << "The position the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative position was not in [0,1]. Aborting..." << endl;
     185            orxout(internal_warning, context::notifications) << "The position the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative position was not in [0,1]. Aborting..." << endl;
    186186            return;
    187187        }
  • code/trunk/src/modules/objects/ForceField.cc

    r8397 r8858  
    216216        else
    217217        {
    218             COUT(2) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << std::endl;
     218            orxout(internal_warning) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << endl;
    219219            this->mode_ = forceFieldMode::tube;
    220220        }
  • code/trunk/src/modules/objects/Planet.cc

    r7401 r8858  
    7373            {
    7474                float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
    75                 //             COUT(2) << distance << std::endl;
     75                //             orxout(internal_warning) << distance << endl;
    7676                float planetRadius = this->getScale();
    7777
  • code/trunk/src/modules/objects/Script.cc

    r8706 r8858  
    137137            return false;
    138138
    139         COUT(4) << "Script (&" << this << ") triggered." << std::endl;
     139        orxout(verbose, context::misc::script) << "Script (&" << this << ") triggered." << endl;
    140140
    141141        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
     
    155155        if(player == NULL)  //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.
    156156        {
    157             COUT(4) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
     157            orxout(internal_warning) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
    158158            return false;
    159159        }
     
    272272        else
    273273        {
    274             COUT(2) << "Invalid mode '" << mode << "' in Script object. Setting to 'normal'." << std::endl;
     274            orxout(internal_warning) << "Invalid mode '" << mode << "' in Script object. Setting to 'normal'." << endl;
    275275            this->setMode(ScriptMode::normal);
    276276            this->modeStr_ = Script::NORMAL;
     
    323323        else
    324324        {
    325             COUT(2) << "Invalid times '" << times << "' in Script. Setting to infinity." << std::endl;
     325            orxout(internal_warning) << "Invalid times '" << times << "' in Script. Setting to infinity." << endl;
    326326            this->times_ = Script::INF;
    327327            this->remainingExecutions_ = Script::INF;
  • code/trunk/src/modules/objects/SpaceBoundaries.cc

    r8767 r8858  
    215215                distance = this->computeDistance(currentPawn);
    216216                humanItem = this->isHumanPlayer(currentPawn);
    217                 COUT(5) << "Distance:" << distance << std::endl; // message for debugging
     217//                orxout() << "Distance:" << distance << endl; // message for debugging
    218218                if(distance > this->warnDistance_ && distance < this->maxDistance_) // Display warning
    219219                {
     
    231231                    if( humanItem )
    232232                    {
    233                         COUT(5) << "Health should be decreasing!" << std::endl;
     233//                        orxout() << "Health should be decreasing!" << endl;
    234234                        this->displayWarning("You are out of the area now!");
    235235                    }
  • code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc

    r8706 r8858  
    9393        if(!this->hasUniformScaling())
    9494        {
    95             CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl;
     95            orxout(internal_error) << "BoxCollisionShape: Non-uniform scaling is not yet supported." << endl;
    9696            return;
    9797        }
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc

    r8706 r8858  
    9292        if(!this->hasUniformScaling())
    9393        {
    94             CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl;
     94            orxout(internal_error) << "ConeCollisionShape: Non-uniform scaling is not yet supported." << endl;
    9595            return;
    9696        }
  • code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc

    r8706 r8858  
    9292        if(!this->hasUniformScaling())
    9393        {
    94             CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl;
     94            orxout(internal_error) << "PlaneCollisionShape: Non-uniform scaling is not yet supported." << endl;
    9595            return;
    9696        }
  • code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc

    r8706 r8858  
    8989        if(!this->hasUniformScaling())
    9090        {
    91             CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl;
     91            orxout(internal_error) << "SphereCollisionShape: Non-uniform scaling is not yet supported." << endl;
    9292            return;
    9393        }
  • code/trunk/src/modules/objects/eventsystem/EventFilter.cc

    r8729 r8858  
    6363        if (this->bActive_)
    6464        {
    65             COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << '"' << std::endl;
     65            orxout(internal_warning, context::events) << "Detected Event loop in EventFilter \"" << this->getName() << '"' << endl;
    6666            return;
    6767        }
  • code/trunk/src/modules/objects/eventsystem/EventListener.cc

    r8729 r8858  
    5959        if (this->bActive_)
    6060        {
    61             COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << '"' << std::endl;
     61            orxout(internal_warning, context::events) << "Detected Event loop in EventListener \"" << this->getName() << '"' << endl;
    6262            return;
    6363        }
    6464
    65         COUT(4) << "EventListener, processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << std::endl;
     65        orxout(verbose, context::events) << "EventListener, processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << endl;
    6666
    6767        this->bActive_ = true;
  • code/trunk/src/modules/objects/eventsystem/EventTarget.cc

    r6417 r8858  
    6060        if (this->bActive_)
    6161        {
    62             COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << '"' << std::endl;
     62            orxout(internal_warning, context::events) << "Detected Event loop in EventTarget \"" << this->getName() << '"' << endl;
    6363            return;
    6464        }
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r8706 r8858  
    247247            this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::exclude);
    248248        else
    249             COUT(1) << "Invalid beacon mode in DistanceMultiTrigger." << endl;
     249            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceMultiTrigger." << endl;
    250250    }
    251251
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.cc

    r8706 r8858  
    108108        if (targetId == NULL)
    109109        {
    110             COUT(1) << "Error: \"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << std::endl;
     110            orxout(internal_error, context::triggers) << "\"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << endl;
    111111            return;
    112112        }
     
    209209                        this->setTriggeringPawn(pawn);
    210210                    else
    211                         CCOUT(2) << "Pawn was NULL." << endl;
     211                        orxout(internal_warning, context::triggers) << "Pawn was NULL." << endl;
    212212                }
    213213               
     
    270270            this->setBeaconModeDirect(distanceTriggerBeaconMode::exclude);
    271271        else
    272             COUT(1) << "Invalid beacon mode in DistanceTrigger." << endl;
     272            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceTrigger." << endl;
    273273    }
    274274
  • code/trunk/src/modules/objects/triggers/MultiTrigger.cc

    r8706 r8858  
    7272    MultiTrigger::~MultiTrigger()
    7373    {
    74         COUT(4) << "Destroying MultiTrigger &" << this << ". " << this->stateQueue_.size() << " states still in queue. Deleting." << std::endl;
     74        orxout(verbose, context::triggers) << "Destroying MultiTrigger &" << this << ". " << this->stateQueue_.size() << " states still in queue. Deleting." << endl;
    7575        while(this->stateQueue_.size() > 0)
    7676        {
     
    9494        XMLPortParamLoadOnly(MultiTrigger, "target", addTarget, xmlelement, mode).defaultValues("Pawn"); //TODO: Remove load only
    9595
    96         COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") created." << std::endl;
     96        orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") created." << endl;
    9797    }
    9898
     
    132132                if(state == NULL)
    133133                {
    134                     COUT(1) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << std::endl;
     134                    orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << endl;
    135135                    queue->pop();
    136136                    continue;
     
    241241                            // Print some debug output if the state has changed.
    242242                            if(state->originator != NULL)
    243                                 COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << std::endl;
     243                                orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;
    244244                            else
    245                                 COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << std::endl;
     245                                orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;
    246246
    247247                            // If the MultiTrigger has a parent trigger, that is itself a MultiTrigger, it needs to call a method to notify him, that its activity has changed.
     
    254254                        {
    255255                            this->BaseObject::setActive(false);
    256                             COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") ran out of activations. Setting it to inactive." << std::endl;
     256                            orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") ran out of activations. Setting it to inactive." << endl;
    257257                        }
    258258                    }
     
    301301        if (target == NULL)
    302302        {
    303             COUT(1) << "Error: '" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
     303            orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl;
    304304            return;
    305305        }
     
    329329        if (target == NULL)
    330330        {
    331             COUT(1) << "Error: '" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
     331            orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl;
    332332            return;
    333333        }
     
    447447        {
    448448            this->fireEvent(status);
    449             COUT(4) << "MultiTrigger '" <<  this->getName() << "' (&" << this << "): Fired event. status: " << status << "." << std::endl;
     449            orxout(verbose, context::triggers) << "MultiTrigger '" <<  this->getName() << "' (&" << this << "): Fired event. status: " << status << "." << endl;
    450450            return;
    451451        }
     
    453453        MultiTriggerContainer* container = new MultiTriggerContainer(this, this, originator);
    454454        this->fireEvent(status, container);
    455         COUT(4) << "MultiTrigger '" <<  this->getName() << "' (&" << this << "): Fired event. originator: " << originator->getIdentifier()->getName() << " (&" << originator << "), status: " << status << "." << std::endl;
     455        orxout(verbose, context::triggers) << "MultiTrigger '" <<  this->getName() << "' (&" << this << "): Fired event. originator: " << originator->getIdentifier()->getName() << " (&" << originator << "), status: " << status << "." << endl;
    456456        delete container;
    457457    }
  • code/trunk/src/modules/objects/triggers/TriggerBase.cc

    r8706 r8858  
    128128            this->setMode(TriggerMode::EventTriggerXOR);
    129129        else
    130             COUT(2) << "Invalid mode '" << modeName << "' in TriggerBase " << this->getName() << " &(" << this << "). Leaving mode at '" << this->getModeString() << "'." << std::endl;
     130            orxout(internal_warning, context::triggers) << "Invalid mode '" << modeName << "' in TriggerBase " << this->getName() << " &(" << this << "). Leaving mode at '" << this->getModeString() << "'." << endl;
    131131    }
    132132
  • code/trunk/src/modules/overlays/GUIOverlay.cc

    r7401 r8858  
    7676            GUIManager::getInstance().showGUIExtra(this->guiName_, str);
    7777
    78             COUT(4) << "Showing GUI " << this->guiName_ << std::endl;
     78            orxout(verbose, context::misc::gui) << "Showing GUI " << this->guiName_ << endl;
    7979        }
    8080        else
    8181        {
    8282            GUIManager::hideGUI(this->guiName_);
    83             COUT(4) << "Hiding GUI " << this->guiName_ << std::endl;
     83            orxout(verbose, context::misc::gui) << "Hiding GUI " << this->guiName_ << endl;
    8484        }
    8585    }
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r8327 r8858  
    6767    }
    6868
    69     void ChatOverlay::incomingChat(const std::string& message, unsigned int senderID)
     69    void ChatOverlay::incomingChat(const std::string& message, const std::string& /*name*/)
    7070    {
    71         std::string text;
    72 
    73         if (senderID != NETWORK_PEER_ID_UNKNOWN)
    74         {
    75             std::string name = "unknown";
    76 
    77             PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    78             if (player)
    79                 name = player->getName();
    80 
    81             text = name + ": " + message;
    82         }
    83         else
    84         {
    85             text = message;
    86         }
    87 
    88         this->messages_.push_back(multi_cast<Ogre::DisplayString>(text));
    89         COUT(0) << "Chat: " << text << std::endl;
     71        this->messages_.push_back(multi_cast<Ogre::DisplayString>(message));
    9072
    9173        Timer* timer = new Timer();
     
    11092        this->text_->setCaption("");
    11193
    112         for (std::list<Ogre::DisplayString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
     94        for (std::list<Ogre::DisplayString>::iterator it = this->messages_.begin(); it != this->messages_.end(); ++it)
    11395        {
    11496            this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));
  • code/trunk/src/modules/overlays/hud/ChatOverlay.h

    r6417 r8858  
    3535#include <OgreOverlayElement.h>
    3636
    37 #include "network/ChatListener.h"
     37#include "chat/ChatListener.h"
    3838#include "overlays/OverlayText.h"
    3939
     
    4949
    5050        protected:
    51             virtual void incomingChat(const std::string& message, unsigned int senderID);
     51            virtual void incomingChat(const std::string& message, const std::string& name);
    5252
    5353            std::list<Ogre::DisplayString> messages_;
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r8706 r8858  
    105105    if ( fontPtr.isNull() )
    106106    {
    107         COUT ( 2 ) << "Warning: HUDNavigation: Font '" << font << "' not found" << std::endl;
     107        orxout(internal_warning) << "HUDNavigation: Font '" << font << "' not found" << endl;
    108108        return;
    109109    }
     
    125125    if ( size <= 0.0f )
    126126    {
    127         COUT ( 2 ) << "Warning: HUDNavigation: Negative font size not allowed" << std::endl;
     127        orxout(internal_warning) << "HUDNavigation: Negative font size not allowed" << endl;
    128128        return;
    129129    }
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r8738 r8858  
    160160            if( !wePointer )
    161161            {
    162                 CCOUT(0) << "Cannot display a non-WorldEntitiy on the radar" << std::endl;
     162                orxout(internal_error) << "Cannot display a non-WorldEntitiy on the radar" << endl;
    163163                assert(0);
    164164            }
  • code/trunk/src/modules/pickup/Pickup.cc

    r7547 r8858  
    169169        else
    170170        {
    171             COUT(1) << "Invalid activationType '" << type << "' in pickup." << std::endl;
     171            orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in pickup." << endl;
    172172        }
    173173    }
     
    191191        else
    192192        {
    193             COUT(1) << "Invalid durationType '" << type << "' in pickup." << std::endl;
     193            orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in pickup." << endl;
    194194        }
    195195    }
  • code/trunk/src/modules/pickup/PickupManager.cc

    r8729 r8858  
    7272        this->defaultRepresentation_ = new PickupRepresentation();
    7373
    74         COUT(3) << "PickupManager created." << std::endl;
     74        orxout(internal_info, context::pickups) << "PickupManager created." << endl;
    7575    }
    7676
     
    101101        this->indexes_.clear();
    102102
    103         COUT(3) << "PickupManager destroyed." << std::endl;
     103        orxout(internal_info, context::pickups) << "PickupManager destroyed." << endl;
    104104    }
    105105
     
    126126        this->representations_[identifier] = representation;
    127127
    128         COUT(4) << "PickupRepresentation &" << representation << " registered with the PickupManager." << std::endl;
     128        orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " registered with the PickupManager." << endl;
    129129        return true;
    130130    }
     
    151151        this->representations_.erase(it);
    152152
    153         COUT(4) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << std::endl;
     153        orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << endl;
    154154        return true;
    155155    }
     
    208208        if(it == this->representations_.end()) // If there is no PickupRepresentation associated with the input PickupIdentifier.
    209209        {
    210             COUT(4) << "PickupManager::getRepresentation() returned default representation." << std::endl;
     210            orxout(verbose, context::pickups) << "PickupManager::getRepresentation() returned default representation." << endl;
    211211            return this->defaultRepresentation_;
    212212        }
     
    284284        if(manager.pickupInventoryContainers_.find(pickup) == manager.pickupInventoryContainers_.end())
    285285        {
    286             COUT(1) << "Error: Pickupable &(" << pickup << ") was not registered with PickupManager for the PickupInventory, when it changed used." << std::endl;
     286            orxout(internal_error, context::pickups) << "Pickupable &(" << pickup << ") was not registered with PickupManager for the PickupInventory, when it changed used." << endl;
    287287            return;
    288288        }
  • code/trunk/src/modules/pickup/PickupRepresentation.cc

    r8713 r8858  
    140140            this->spawnerRepresentation_->setVisible(false);
    141141
    142         COUT(4) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << std::endl;
     142        orxout(verbose, context::pickups) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << endl;
    143143    }
    144144
     
    155155        if(this->spawnerRepresentation_ == NULL)
    156156        {
    157             COUT(4) << "PickupRepresentation: No spawner representation found." << std::endl;
     157            orxout(verbose, context::pickups) << "PickupRepresentation: No spawner representation found." << endl;
    158158            if(this->spawnerTemplate_ == "")
    159159            {
    160                 COUT(4) << "PickupRepresentation: Spawner template is empty." << std::endl;
     160                orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
    161161                // If neither spawnerRepresentation nor spawnerTemplate was specified
    162162                return this->getDefaultSpawnerRepresentation(spawner);
  • code/trunk/src/modules/pickup/PickupSpawner.cc

    r7801 r8858  
    9090        if(this->pickup_ == NULL)
    9191        {
    92             COUT(2) << "A PickupSpawner was created without a valid Pickupable. This won't work." << std::endl;
     92            orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
    9393            this->setActive(false);
    9494        }
     
    144144        if(this->pickup_ == NULL)
    145145        {
    146             COUT(2) << "A PickupSpawner was created without a valid Pickupable. This won't work." << std::endl;
     146            orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
    147147            this->setActive(false);
    148148        }
     
    239239        else
    240240        {
    241             COUT(4) << "PickupSpawner (&" << this << ") empty, selfdestruct initialized." << std::endl;
     241            orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") empty, selfdestruct initialized." << endl;
    242242            this->setActive(false);
    243243            this->destroy();
     
    264264        if(this->pickup_ != NULL)
    265265        {
    266             COUT(1) << "In PickupSpawner (&" << this << "): setPickupable called, with this->pickup_ already set." << std::endl;
     266            orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): setPickupable called, with this->pickup_ already set." << endl;
    267267            return;
    268268        }
    269269        if(pickup == NULL)
    270270        {
    271             COUT(1) << "In PickupSpawner (&" << this << "): Argument of setPickupable is NULL." << std::endl;
     271            orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): Argument of setPickupable is NULL." << endl;
    272272            return;
    273273        }
     
    298298        if(this->isActive()) // Checks whether PickupSpawner is active.
    299299        {
    300             COUT(4) << "PickupSpawner (&" << this << ") triggered and active." << std::endl;
     300            orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered and active." << endl;
    301301
    302302            PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
     
    306306            if(!carrier->isTarget(this->pickup_))
    307307            {
    308                 COUT(4) << "PickupSpawner (&" << this << ") triggered but Pawn wasn't a target of the Pickupable." << std::endl;
     308                orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered but Pawn wasn't a target of the Pickupable." << endl;
    309309                return;
    310310            }
     
    335335        if(this->spawnsRemaining_ == 0)
    336336        {
    337             COUT(1) << "Massive Error: PickupSpawner still alive until having spawned last item." << std::endl;
     337            orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
    338338            return NULL;
    339339        }
     
    349349    void PickupSpawner::respawnTimerCallback()
    350350    {
    351         COUT(4) << "PickupSpawner (&" << this << ") reactivated." << std::endl;
     351        orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") reactivated." << endl;
    352352
    353353        this->setActive(true);
  • code/trunk/src/modules/pickup/items/DronePickup.cc

    r7548 r8858  
    179179        if(pawn == NULL)
    180180        {
    181             COUT(1) << "Invalid PickupCarrier in DronePickup." << std::endl;
     181            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DronePickup." << endl;
    182182        }
    183183
  • code/trunk/src/modules/pickup/items/HealthPickup.cc

    r7548 r8858  
    169169                    break;
    170170                default:
    171                     COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
     171                    orxout(internal_error, context::pickups) << "Invalid healthType in HealthPickup." << endl;
    172172            }
    173173
     
    218218                        break;
    219219                    default:
    220                         COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
     220                        orxout(internal_error, context::pickups) << "Invalid healthType in HealthPickup." << endl;
    221221                }
    222222
     
    234234                if(pawn == NULL)
    235235                {
    236                     COUT(1) << "Something went horribly wrong in Health Pickup. PickupCarrier is no Pawn." << std::endl;
     236                    orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is no Pawn." << endl;
    237237                    this->Pickupable::destroy();
    238238                    return;
     
    268268        if(pawn == NULL)
    269269        {
    270             COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl;
     270            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl;
    271271        }
    272272
     
    312312                return HealthPickup::healthTypePermanent_s;
    313313            default:
    314                 COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
     314                orxout(internal_error, context::pickups) << "Invalid healthType in HealthPickup." << endl;
    315315                return BLANKSTRING;
    316316        }
     
    331331        else
    332332        {
    333             COUT(1) << "Invalid health in HealthPickup." << std::endl;
     333            orxout(internal_error, context::pickups) << "Invalid health in HealthPickup." << endl;
    334334            this->health_ = 0.0;
    335335        }
     
    350350        else
    351351        {
    352             COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl;
     352            orxout(internal_error, context::pickups) << "Invalid healthSpeed in HealthPickup." << endl;
    353353        }
    354354    }
     
    376376        else
    377377        {
    378             COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
     378            orxout(internal_error, context::pickups) << "Invalid healthType in HealthPickup." << endl;
    379379        }
    380380    }
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r8220 r8858  
    206206        if(pawn == NULL)
    207207        {
    208             COUT(1) << "Invalid PickupCarrier in InvisiblePickup." << std::endl;
     208            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in InvisiblePickup." << endl;
    209209        }
    210210        return pawn;
     
    225225        else
    226226        {
    227             COUT(1) << "Invalid duration in InvisiblePickup." << std::endl;
     227            orxout(internal_error, context::pickups) << "Invalid duration in InvisiblePickup." << endl;
    228228            this->duration_ = 0.0f;
    229229        }
  • code/trunk/src/modules/pickup/items/MetaPickup.cc

    r7548 r8858  
    232232        }
    233233        else
    234             COUT(2) << "Invalid metaType '" << type << "' in MetaPickup." << std::endl;
     234            orxout(internal_warning, context::pickups) << "Invalid metaType '" << type << "' in MetaPickup." << endl;
    235235    }
    236236
  • code/trunk/src/modules/pickup/items/ShieldPickup.cc

    r7548 r8858  
    181181        if(pawn == NULL)
    182182        {
    183             COUT(1) << "Invalid PickupCarrier in ShieldPickup." << std::endl;
     183            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in ShieldPickup." << endl;
    184184        }
    185185        return pawn;
     
    220220        else
    221221        {
    222             COUT(1) << "Invalid duration in ShieldPickup." << std::endl;
     222            orxout(internal_error, context::pickups) << "Invalid duration in ShieldPickup." << endl;
    223223            this->duration_ = 0.0f;
    224224        }
     
    239239        else
    240240        {
    241             COUT(1) << "Invalid Shieldhealth in ShieldPickup." << std::endl;
     241            orxout(internal_error, context::pickups) << "Invalid Shieldhealth in ShieldPickup." << endl;
    242242            this->shieldHealth_=0;
    243243        }
     
    258258        else
    259259        {
    260             COUT(1) << "Invalid Absorption in ShieldPickup." << std::endl;
     260            orxout(internal_error, context::pickups) << "Invalid Absorption in ShieldPickup." << endl;
    261261            this->shieldAbsorption_=0;
    262262        }
  • code/trunk/src/modules/pickup/items/ShrinkPickup.h

    r8713 r8858  
    9393            */
    9494            inline void setShrinkFactor(float factor)
    95                 { if(factor <= 1.0f) { COUT(2) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; }
     95                { if(factor <= 1.0f) { orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; }
    9696            /**
    9797            @brief Get the duration for which the ship remains shrunken.
     
    105105            */
    106106            inline void setDuration(float duration)
    107                 { if(duration < 0.0f) { COUT(2) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; }
     107                { if(duration < 0.0f) { orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; }
    108108            /**
    109109            @brief Get the shrink speed.
     
    117117            */
    118118            inline void setShrinkDuration(float speed)
    119                 { if(speed <= 0.0f) { COUT(2) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
     119                { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
    120120
    121121        protected:
  • code/trunk/src/modules/pickup/items/SpeedPickup.cc

    r8727 r8858  
    180180        if(ship == NULL)
    181181        {
    182             COUT(1) << "Invalid PickupCarrier in SpeedPickup." << std::endl;
     182            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in SpeedPickup." << endl;
    183183        }
    184184
     
    221221        else
    222222        {
    223             COUT(1) << "Invalid duration in SpeedPickup." << std::endl;
     223            orxout(internal_error, context::pickups) << "Invalid duration in SpeedPickup." << endl;
    224224            this->duration_ = 0.0f;
    225225        }
     
    240240        else
    241241        {
    242             COUT(1) << "Invalid speedAdd in SpeedPickup." << std::endl;
     242            orxout(internal_error, context::pickups) << "Invalid speedAdd in SpeedPickup." << endl;
    243243            this->speedAdd_ = 0.0f;
    244244        }
     
    259259        else
    260260        {
    261             COUT(1) << "Invalid speedMultiply in SpeedPickup." << std::endl;
     261            orxout(internal_error, context::pickups) << "Invalid speedMultiply in SpeedPickup." << endl;
    262262            this->speedMultiply_ = 1.0f;
    263263        }
  • code/trunk/src/modules/pong/Pong.cc

    r8108 r8858  
    162162        else // If no centerpoint was specified, an error is thrown and the level is exited.
    163163        {
    164             COUT(1) << "Error: No Centerpoint specified." << std::endl;
     164            orxout(internal_error) << "Pong: No Centerpoint specified." << endl;
    165165            GSLevel::startMainMenu();
    166166            return;
  • code/trunk/src/modules/questsystem/GlobalQuest.cc

    r7552 r8858  
    7171        XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
    7272
    73         COUT(4) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
     73        orxout(verbose, context::quests) << "New GlobalQuest {" << this->getId() << "} created." << endl;
    7474    }
    7575
     
    8787        if(!this->isFailable(player)) // Check whether the Quest can be failed.
    8888        {
    89             COUT(4) << "A non-completable quest was trying to be failed." << std::endl;
     89            orxout(verbose, context::quests) << "A non-completable quest was trying to be failed." << endl;
    9090            return false;
    9191        }
     
    114114        if(!this->isCompletable(player)) // Check whether the Quest can be completed.
    115115        {
    116             COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
     116            orxout(verbose, context::quests) << "A non-completable quest was trying to be completed." << endl;
    117117            return false;
    118118        }
     
    227227        this->rewards_.push_back(effect); // Add the QuestEffect to the list.
    228228
    229         COUT(4) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
     229        orxout(verbose, context::quests) << "Reward effect was added to Quest {" << this->getId() << "}." << endl;
    230230        return true;
    231231    }
  • code/trunk/src/modules/questsystem/LocalQuest.cc

    r7552 r8858  
    6969        SUPER(LocalQuest, XMLPort, xmlelement, mode);
    7070
    71         COUT(4) << "New LocalQuest {" << this->getId() << "} created." << std::endl;
     71        orxout(verbose, context::quests) << "New LocalQuest {" << this->getId() << "} created." << endl;
    7272    }
    7373
     
    8585        if(!this->isFailable(player)) // Checks whether the quest can be failed.
    8686        {
    87             COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
     87            orxout(verbose, context::quests) << "A non-failable quest was trying to be failed." << endl;
    8888            return false;
    8989        }
     
    108108        if(!this->isCompletable(player)) // Checks whether the Quest can be completed.
    109109        {
    110             COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
     110            orxout(verbose, context::quests) << "A non-completable quest was trying to be completed." << endl;
    111111            return false;
    112112        }
  • code/trunk/src/modules/questsystem/Quest.cc

    r7552 r8858  
    9696        this->parentQuest_ = quest;
    9797
    98         COUT(4) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     98        orxout(verbose, context::quests) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << endl;
    9999        return true;
    100100    }
     
    115115        this->subQuests_.push_back(quest); // Adds the Quest to the end of the list of sub-quests.
    116116
    117         COUT(4) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     117        orxout(verbose, context::quests) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << endl;
    118118        return true;
    119119    }
     
    135135        this->hints_.push_back(hint); // Adds the QuestHint to the end of the list of QuestHints.
    136136
    137         COUT(4) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     137        orxout(verbose, context::quests) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << endl;
    138138        return true;
    139139    }
     
    153153        this->failEffects_.push_back(effect); // Adds the QuestEffect to the end of the list of fail QuestEffects.
    154154
    155         COUT(4) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
     155        orxout(verbose, context::quests) << "A FailEffect was added to Quest {" << this->getId() << "}." << endl;
    156156        return true;
    157157    }
     
    171171        this->completeEffects_.push_back(effect); // Adds the QuestEffect to the end of the list of complete QuestEffects.
    172172
    173         COUT(4) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
     173        orxout(verbose, context::quests) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << endl;
    174174        return true;
    175175    }
     
    341341        this->setStatus(player, QuestStatus::Failed);
    342342
    343         COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
     343        orxout(verbose, context::quests) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." << endl;
    344344
    345345        this->getDescription()->sendFailQuestNotification(player);
     
    360360        this->setStatus(player, QuestStatus::Completed);
    361361
    362         COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
     362        orxout(verbose, context::quests) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." << endl;
    363363
    364364        this->getDescription()->sendCompleteQuestNotification(player);
     
    378378        if(!this->isStartable(player)) // Checks whether the quest can be started.
    379379        {
    380             COUT(4) << "A non-startable quest was trying to be started." << std::endl;
     380            orxout(verbose, context::quests) << "A non-startable quest was trying to be started." << endl;
    381381            return false;
    382382        }
    383383
    384         COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
     384        orxout(verbose, context::quests) << "Quest {" << this->getId() << "} is started for player: " << player << " ." << endl;
    385385
    386386        QuestListener::advertiseStatusChange(this->listeners_, "start"); // Tells the QuestListeners, that the status has changed to active.
  • code/trunk/src/modules/questsystem/QuestDescription.cc

    r8706 r8858  
    7979        XMLPortParam(QuestDescription, "completeMessage", setCompleteMessage, getCompleteMessage, xmlelement, mode);
    8080
    81         COUT(4) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
     81        orxout(verbose, context::quests) << "New QuestDescription with title '" << this->getTitle() << "' created." << endl;
    8282    }
    8383
     
    109109            else
    110110            {
    111                 COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl;
     111                orxout(internal_warning, context::quests) << "Bad input in notificationHelper, this should not be happening!" << endl;
    112112                return false;
    113113            }
     
    115115        else
    116116        {
    117             COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl;
     117            orxout(internal_warning, context::quests) << "Bad input in notificationHelper, this should not be happening!" << endl;
    118118            return false;
    119119        }
  • code/trunk/src/modules/questsystem/QuestEffect.cc

    r8351 r8858  
    7070        bool temp = true;
    7171
    72         COUT(4) << "Invoking QuestEffects on player: " << player << " ."  << std::endl;
     72        orxout(verbose, context::quests) << "Invoking QuestEffects on player: " << player << " ."  << endl;
    7373
    7474        for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.cc

    r8706 r8858  
    7979        XMLPortEventSink(QuestEffectBeacon, BaseObject, "execute", execute, xmlelement, mode); //TODO: Change BaseObject to MultiTrigger as soon as MultiTrigger is the base of all triggers.
    8080
    81         COUT(4) << "New QuestEffectBeacon created." << std::endl;
     81        orxout(verbose, context::quests) << "New QuestEffectBeacon created." << endl;
    8282    }
    8383
     
    108108        if(!(this->isActive())) // If the QuestEffectBeacon is inactive it cannot be executed.
    109109        {
    110             COUT(4) << "The QuestEffectBeacon is inactive." << std::endl;
     110            orxout(verbose, context::quests) << "The QuestEffectBeacon is inactive." << endl;
    111111            return false;
    112112        }
     
    128128        if(player == NULL)
    129129        {
    130             COUT(4) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
    131             return false;
    132         }
    133 
    134         COUT(4) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
     130            orxout(verbose, context::quests) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
     131            return false;
     132        }
     133
     134        orxout(verbose, context::quests) << "QuestEffectBeacon executed on player: " << player << " ." << endl;
    135135
    136136        bool temp = QuestEffect::invokeEffects(player, this->effects_); // Invoke the QuestEffects on the PlayerInfo.
     
    221221        this->effects_.push_back(effect);
    222222
    223         COUT(4) << "A QuestEffect was added to a QuestEffectBeacon." << std::endl;
     223        orxout(verbose, context::quests) << "A QuestEffect was added to a QuestEffectBeacon." << endl;
    224224        return true;
    225225    }
  • code/trunk/src/modules/questsystem/QuestHint.cc

    r7552 r8858  
    7474        QuestManager::getInstance().registerHint(this); // Registers the QuestHint with the QuestManager.
    7575
    76         COUT(4) << "New QuestHint {" << this->getId() << "} created." << std::endl;
     76        orxout(verbose, context::quests) << "New QuestHint {" << this->getId() << "} created." << endl;
    7777    }
    7878
     
    120120            else
    121121            {
    122                 COUT(4) << "An already active questHint was trying to get activated." << std::endl;
     122                orxout(verbose, context::quests) << "An already active questHint was trying to get activated." << endl;
    123123                return false;
    124124            }
    125125        }
    126126
    127         COUT(4) << "A hint of a non-active quest was trying to get activated." << std::endl;
     127        orxout(verbose, context::quests) << "A hint of a non-active quest was trying to get activated." << endl;
    128128        return false;
    129129    }
  • code/trunk/src/modules/questsystem/QuestItem.cc

    r8079 r8858  
    8989        if(id == "") // Checks whether the id is a valid id.
    9090        {
    91             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     91            orxout(internal_warning, context::quests) << "Invalid id. QuestItem id {" << id << "} could not be set." << endl;
    9292            return;
    9393        }
  • code/trunk/src/modules/questsystem/QuestListener.cc

    r7462 r8858  
    8484            this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners.
    8585
    86         COUT(4) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
     86        orxout(verbose, context::quests) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << endl;
    8787    }
    8888
     
    146146        else
    147147        {
    148             COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl;
     148            orxout(internal_warning, context::quests) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << endl;
    149149            this->mode_ = QuestListenerMode::All;
    150150            return false;
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r8729 r8858  
    6161        RegisterRootObject(QuestManager);
    6262
    63         COUT(3) << "QuestManager created." << std::endl;
     63        orxout(internal_info, context::quests) << "QuestManager created." << endl;
    6464    }
    6565
     
    7070    QuestManager::~QuestManager()
    7171    {
    72         COUT(3) << "QuestManager destroyed." << std::endl;
     72        orxout(internal_info, context::quests) << "QuestManager destroyed." << endl;
    7373    }
    7474
     
    103103        {
    104104            quest->setRegistered();
    105             COUT(4) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
     105            orxout(verbose, context::quests) << "Quest with questId {" << quest->getId() << "} successfully inserted." << endl;
    106106            return true;
    107107        }
    108108        else
    109109        {
    110            COUT(2) << "Quest with the same id was already present." << std::endl;
     110           orxout(internal_warning, context::quests) << "Quest with the same id was already present." << endl;
    111111           return false;
    112112        }
     
    141141        {
    142142            hint->setRegistered();
    143             COUT(4) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
     143            orxout(verbose, context::quests) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << endl;
    144144            return true;
    145145        }
    146146        else
    147147        {
    148            COUT(2) << "QuestHint with the same id was already present." << std::endl;
     148           orxout(internal_warning, context::quests) << "QuestHint with the same id was already present." << endl;
    149149           return false;
    150150        }
     
    183183        {
    184184           quest = NULL;
    185            COUT(2) << "The quest with id {" << questId << "} is nowhere to be found." << std::endl;
     185           orxout(internal_warning, context::quests) << "The quest with id {" << questId << "} is nowhere to be found." << endl;
    186186        }
    187187
     
    212212        {
    213213           hint = NULL;
    214            COUT(2) << "The hint with id {" << hintId << "} is nowhere to be found." << std::endl;
     214           orxout(internal_warning, context::quests) << "The hint with id {" << hintId << "} is nowhere to be found." << endl;
    215215        }
    216216
     
    431431        if(player == NULL)
    432432        {
    433             COUT(1) << "Error: GUIOverlay with name '" << guiName << "' has no player." << std::endl;
     433            orxout(internal_error, context::quests) << "GUIOverlay with name '" << guiName << "' has no player." << endl;
    434434            return NULL;
    435435        }
  • code/trunk/src/modules/questsystem/effects/AddQuest.cc

    r7552 r8858  
    7070        SUPER(AddQuest, XMLPort, xmlelement, mode);
    7171
    72         COUT(4) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     72        orxout(verbose, context::quests) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << endl;
    7373    }
    7474
     
    8585        assert(player);
    8686
    87         COUT(5) << "AddQuest on player: " << player << " ." << std::endl;
     87        orxout(verbose_more, context::quests) << "AddQuest on player: " << player << " ." << endl;
    8888
    8989        try
     
    9595        catch(const orxonox::Exception& ex)
    9696        {
    97             COUT(2) << ex.getFullDescription() << std::endl;
     97            orxout(internal_warning, context::quests) << ex.getFullDescription() << endl;
    9898            return false;
    9999        }
    100100
    101         COUT(4) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << std::endl;
     101        orxout(verbose, context::quests) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << endl;
    102102        return true;
    103103    }
  • code/trunk/src/modules/questsystem/effects/AddQuestHint.cc

    r8079 r8858  
    7373        XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
    7474
    75         COUT(4) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
     75        orxout(verbose, context::quests) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << endl;
    7676    }
    7777
     
    8888        if(id == "")
    8989        {
    90             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     90            orxout(internal_warning, context::quests) << "Invalid id. QuestItem id {" << id << "} could not be set." << endl;
    9191            return false;
    9292        }
     
    108108        assert(player);
    109109
    110         COUT(5) << "AddQuestHint on player: " << player << " ." << std::endl;
     110        orxout(verbose_more, context::quests) << "AddQuestHint on player: " << player << " ." << endl;
    111111
    112112        try
     
    118118        catch(const Exception& e)
    119119        {
    120            COUT(2) << e.getFullDescription() << std::endl;
     120           orxout(internal_warning, context::quests) << e.getFullDescription() << endl;
    121121           return false;
    122122        }
    123123
    124         COUT(4) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << std::endl;
     124        orxout(verbose, context::quests) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << endl;
    125125        return true;
    126126
  • code/trunk/src/modules/questsystem/effects/AddReward.cc

    r8351 r8858  
    7070        XMLPortObject(AddReward, Rewardable, "", addRewardable, getRewardables, xmlelement, mode);
    7171
    72         COUT(4) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
     72        orxout(verbose, context::quests) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << endl;
    7373    }
    7474
     
    103103    bool AddReward::invoke(PlayerInfo* player)
    104104    {
    105         COUT(5) << "AddReward on player: " << player << " ." << std::endl;
     105        orxout(verbose_more, context::quests) << "AddReward on player: " << player << " ." << endl;
    106106
    107107        bool temp = true;
     
    109109            temp = temp && (*reward)->reward(player);
    110110
    111         COUT(4) << "Rewardable successfully added to player." << player << " ." << std::endl;
     111        orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl;
    112112
    113113        return temp;
  • code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc

    r8079 r8858  
    8383        if(id == "")
    8484        {
    85             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     85            orxout(internal_warning, context::quests) << "Invalid id. QuestItem id {" << id << "} could not be set." << endl;
    8686            return false;
    8787        }
  • code/trunk/src/modules/questsystem/effects/CompleteQuest.cc

    r7552 r8858  
    7070        SUPER(CompleteQuest, XMLPort, xmlelement, mode);
    7171
    72         COUT(4) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     72        orxout(verbose, context::quests) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << endl;
    7373    }
    7474
     
    8585        assert(player);
    8686
    87         COUT(5) << "CompleteQuest on player: " << player << " ." << std::endl;
     87        orxout(verbose_more, context::quests) << "CompleteQuest on player: " << player << " ." << endl;
    8888
    8989        Quest* quest;
     
    9797        catch(const Exception& e)
    9898        {
    99             COUT(2) << e.getFullDescription() << std::endl;
     99            orxout(internal_warning, context::quests) << e.getFullDescription() << endl;
    100100            return false;
    101101        }
    102102
    103         COUT(4) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << std::endl;
     103        orxout(verbose, context::quests) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << endl;
    104104        return true;
    105105    }
  • code/trunk/src/modules/questsystem/effects/FailQuest.cc

    r7552 r8858  
    7070        SUPER(FailQuest, XMLPort, xmlelement, mode);
    7171
    72         COUT(4) << "New FailQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     72        orxout(verbose, context::quests) << "New FailQuest, with target Quest {" << this->getQuestId() << "}, created." << endl;
    7373    }
    7474
     
    8585        assert(player);
    8686
    87         COUT(4) << "FailQuest on player: " << player << " ." << std::endl;
     87        orxout(verbose, context::quests) << "FailQuest on player: " << player << " ." << endl;
    8888
    8989        Quest* quest;
     
    9696        catch(const Exception& e)
    9797        {
    98             COUT(2) << e.getFullDescription() << std::endl;
     98            orxout(internal_warning, context::quests) << e.getFullDescription() << endl;
    9999            return false;
    100100        }
    101101
    102         COUT(4) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
     102        orxout(verbose, context::quests) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << endl;
    103103        return true;
    104104    }
  • code/trunk/src/modules/tetris/Tetris.cc

    r8706 r8858  
    165165        else // If no centerpoint was specified, an error is thrown and the level is exited.
    166166        {
    167             COUT(1) << "Error: No Centerpoint specified." << std::endl;
     167            orxout(internal_error) << "Tetris: No Centerpoint specified." << endl;
    168168            GSLevel::startMainMenu();
    169169            return;
  • code/trunk/src/modules/weapons/RocketController.cc

    r8855 r8858  
    4848    {
    4949        RegisterObject(RocketController);
    50         COUT(5)<< "RocketController constructed\n";
     50//        orxout() << "RocketController constructed" << endl;
    5151
    5252        // Create a rocket for the controller.
     
    7373    RocketController::~RocketController()
    7474    {
    75         COUT(5)<< "RocketController destroyed\n";
     75//        orxout() << "RocketController destroyed" << endl;
    7676    }
    7777
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.h

    r8855 r8858  
    6464            */
    6565            inline void setDamage(float damage)
    66                 { if(damage >= 0.0f)  { this->damage_ = damage; return; } COUT(1) << "The input projectile damage must be non-negative. Ignoring..." << endl; }
     66                { if(damage >= 0.0f)  { this->damage_ = damage; return; } orxout(internal_warning) << "The input projectile damage must be non-negative. Ignoring..." << endl; }
    6767            /**
    6868            @brief Get the normal damage done by this projectile.
     
    7979            */
    8080            inline void setHealthDamage(float healthdamage)
    81                 { if(healthdamage >= 0.0f)  { this->healthdamage_ = healthdamage; return; } COUT(1) << "The input projectile health-damage must be non-negative. Ignoring..." << endl; }
     81                { if(healthdamage >= 0.0f)  { this->healthdamage_ = healthdamage; return; } orxout(internal_warning) << "The input projectile health-damage must be non-negative. Ignoring..." << endl; }
    8282            /**
    8383            @brief Get the health-damage done by this projectile.
     
    9494            */
    9595            inline void setShieldDamage(float shielddamage)
    96                 { if(shielddamage >= 0.0f)  { this->shielddamage_ = shielddamage; return; } COUT(1) << "The input projectile shield-damage must be non-negative. Ignoring..." << endl; }
     96                { if(shielddamage >= 0.0f)  { this->shielddamage_ = shielddamage; return; } orxout(internal_warning) << "The input projectile shield-damage must be non-negative. Ignoring..." << endl; }
    9797            /**
    9898            @brief Get the shield-damage done by this projectile.
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r8855 r8858  
    3939#include "core/CoreIncludes.h"
    4040#include "core/XMLPort.h"
    41 #include "util/Debug.h"
    4241
    4342#include "controllers/Controller.h"
  • code/trunk/src/orxonox/CMakeLists.txt

    r8729 r8858  
    3232  PlayerManager.cc
    3333  Radar.cc
    34   ChatHistory.cc
    35   ChatInputHandler.cc
    3634#  Test.cc
    3735
     
    4240)
    4341
     42ADD_SUBDIRECTORY(chat)
    4443ADD_SUBDIRECTORY(collisionshapes)
    4544ADD_SUBDIRECTORY(controllers)
     
    5958  FIND_HEADER_FILES
    6059  TOLUA_FILES
    61     ChatInputHandler.h
     60    chat/ChatInputHandler.h
    6261    LevelInfo.h
    6362    LevelManager.h
  • code/trunk/src/orxonox/Level.cc

    r7648 r8858  
    8888    void Level::networkcallback_applyXMLFile()
    8989    {
    90         COUT(0) << "Loading level \"" << this->xmlfilename_ << "\"..." << std::endl;
     90        orxout(user_status) << "Loading level \"" << this->xmlfilename_ << "\"..." << endl;
    9191
    9292        ClassTreeMask mask;
     
    115115        if (!identifier || !identifier->isA(Class(Gametype)))
    116116        {
    117             COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;
     117            orxout(internal_error) << "\"" << gametype << "\" is not a valid gametype." << endl;
    118118            identifier = Class(Gametype);
    119119            this->gametype_ = "Gametype";
     
    157157//         this->lodInformation_.insert(std::make_pair(meshName,lodInformation));
    158158        if( this->lodInformation_.find(meshName) != this->lodInformation_.end())
    159           CCOUT(4) << "replacing lod information for " << meshName << endl;
     159            orxout(verbose, context::lod) << "replacing lod information for " << meshName << endl;
    160160        this->lodInformation_[meshName] = lodInformation;
    161161    }
     
    171171    void Level::playerEntered(PlayerInfo* player)
    172172    {
    173         COUT(3) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << std::endl;
     173        orxout(internal_info) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl;
    174174        player->setGametype(this->getGametype());
    175175    }
     
    177177    void Level::playerLeft(PlayerInfo* player)
    178178    {
    179         COUT(3) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << std::endl;
     179        orxout(internal_info) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl;
    180180        player->setGametype(0);
    181181    }
  • code/trunk/src/orxonox/LevelInfo.cc

    r7652 r8858  
    125125        if(!this->validateTag(tag))
    126126        {
    127             COUT(2) << "Bad LevelInfo tag '" << tag << "' in " << this->getXMLFilename() << ". Ignoring..." << std::endl;
     127            orxout(internal_warning) << "Bad LevelInfo tag '" << tag << "' in " << this->getXMLFilename() << ". Ignoring..." << endl;
    128128            return false;
    129129        }
  • code/trunk/src/orxonox/LevelManager.cc

    r8706 r8858  
    251251
    252252        // Iterate over all the found *.oxw files
    253         COUT(3) << "Loading LevelInfos..." << std::endl;
     253        orxout(internal_info) << "Loading LevelInfos..." << endl;
    254254        std::set<std::string> names;
    255255        for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it)
     
    281281                // Warn about levels with the same name.
    282282                if(!names.insert(info->getName()).second)
    283                     COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with name '" << info->getName() << "' found!" << std::endl;
     283                    orxout(internal_warning) << "Multiple levels (" << info->getXMLFilename() << ") with name '" << info->getName() << "' found!" << endl;
    284284
    285285                // Warn about multiple items so that it gets fixed quickly
    286286                if(availableLevels_.find(info) != availableLevels_.end())
    287287                {
    288                     COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with same name '" << info->getName() << "' and filename found! Exluding..." << std::endl;
     288                    orxout(internal_warning) << "Multiple levels (" << info->getXMLFilename() << ") with same name '" << info->getName() << "' and filename found! Exluding..." << endl;
    289289                    // Delete LevelInfoItem to avoid a dangling pointer
    290290                    delete info;
  • code/trunk/src/orxonox/Main.cc

    r8729 r8858  
    6161    int main(const std::string& strCmdLine)
    6262    {
     63        orxout(internal_status) << "entering orxonox::main()" << endl;
     64        orxout(internal_info) << "command line: " << strCmdLine << endl;
     65
     66        orxout(internal_info) << "creating Game object:" << endl;
    6367        Game* game = new Game(strCmdLine);
     68        orxout(user_status) << "Finished initialization" << endl;
    6469
    6570        if (CommandLineParser::getValue("generateDoc").getString().empty())
    6671        {
     72            orxout(internal_info) << "preparing game states" << endl;
     73
    6774            /* TODO make this clear */
    6875            game->setStateHierarchy(
     
    98105            }
    99106
     107            orxout(internal_info) << "starting game" << endl;
    100108            game->run();
    101109        }
  • code/trunk/src/orxonox/MoodManager.cc

    r8706 r8858  
    5454        {
    5555            // TODO: Non-fatal error handling (non-critical resource missing)
    56             COUT(2) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << std::endl;
     56            orxout(internal_warning) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << endl;
    5757        }
    5858       
     
    8282        if (!Resource::exists(path))
    8383        {
    84             COUT(3) << "Mood " << mood_ << " does not exist. Will not change." << std::endl;
     84            orxout(internal_warning) << "Mood " << mood_ << " does not exist. Will not change." << endl;
    8585            this->setMood(oldMood_);
    8686        }
    8787        else
    8888        {
    89             COUT(3) << "Mood changed to " << mood_ << std::endl;
     89            orxout(internal_info) << "Mood changed to " << mood_ << endl;
    9090            MoodListener::changedMood(mood_);
    9191        }
  • code/trunk/src/orxonox/OrxonoxPrereqs.h

    r8351 r8858  
    7777    class Radar;
    7878    class Scene;
     79
     80    // chat
     81    class ChatHistory;
     82    class ChatInputHandler;
     83    class ChatListener;
     84    class ChatManager;
    7985
    8086    // collisionshapes
  • code/trunk/src/orxonox/PlayerManager.cc

    r8327 r8858  
    5757        {
    5858            if (clientID != 0)
    59                 COUT(3) << "client connected" << std::endl;
     59                orxout(internal_info) << "client connected" << endl;
    6060
    6161            // create new HumanPlayer instance
     
    7777        {
    7878            if (clientID != 0)
    79                 COUT(3) << "client disconnected" << std::endl;
     79                orxout(internal_info) << "client disconnected" << endl;
    8080
    8181            // remove from clients-map
  • code/trunk/src/orxonox/Radar.cc

    r7284 r8858  
    195195    void Radar::listObjects() const
    196196    {
    197         COUT(3) << "List of RadarObjects:\n";
     197        orxout(debug_output) << "List of RadarObjects:" << endl;
    198198        // iterate through all Radar Objects
    199199        unsigned int i = 0;
    200200        for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
    201201        {
    202             COUT(3) << i++ << ": " << (*it)->getRVWorldPosition() << std::endl;
     202            orxout(debug_output) << i++ << ": " << (*it)->getRVWorldPosition() << endl;
    203203        }
    204204    }
  • code/trunk/src/orxonox/Scene.cc

    r7163 r8858  
    141141        if (range.length() < 10.0f)
    142142        {
    143             CCOUT(2) << "Warning: Setting the negative world range to a very small value: "
    144                      << multi_cast<std::string>(range) << std::endl;
    145         }
    146         if (this->hasPhysics())
    147         {
    148             CCOUT(2) << "Warning: Attempting to set the physical world range at run time. "
    149                      << "This causes a complete physical reload which might take some time." << std::endl;
     143            orxout(internal_warning) << "Setting the negative world range to a very small value: "
     144                                     << multi_cast<std::string>(range) << endl;
     145        }
     146        if (this->hasPhysics())
     147        {
     148            orxout(internal_warning) << "Attempting to set the physical world range at run time. "
     149                                     << "This causes a complete physical reload which might take some time." << endl;
    150150            this->setPhysicalWorld(false);
    151151            this->negativeWorldRange_ = range;
     
    160160        if (range.length() < 10.0f)
    161161        {
    162             CCOUT(2) << "Warning: Setting the positive world range to a very small value: "
    163                      << multi_cast<std::string>(range) << std::endl;
    164         }
    165         if (this->hasPhysics())
    166         {
    167             CCOUT(2) << "Warning: Attempting to set the physical world range at run time. "
    168                      << "This causes a complete physical reload which might take some time." << std::endl;
     162            orxout(internal_warning) << "Setting the positive world range to a very small value: "
     163                                     << multi_cast<std::string>(range) << endl;
     164        }
     165        if (this->hasPhysics())
     166        {
     167            orxout(internal_warning) << "Attempting to set the physical world range at run time. "
     168                                     << "This causes a complete physical reload which might take some time." << endl;
    169169            this->setPhysicalWorld(false);
    170170            this->positiveWorldRange_ = range;
  • code/trunk/src/orxonox/Test.cc

    r7284 r8858  
    127127    //     mt2.importData( temp );
    128128    //     assert( temp-mem == mt1.getNetworkSize() );
    129     //     COUT(0) << mt2 << endl;
     129    //     orxout() << mt2 << endl;
    130130    //     if(!Core::isMaster())
    131131    //       call2(0, "bal", "a", "n", "ce");
     
    135135    void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5)
    136136    {
    137         COUT(0) << s1 << s2 << s3 << s4 << s5 << endl;
     137        orxout() << s1 << s2 << s3 << s4 << s5 << endl;
    138138    }
    139139
    140     void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
    141     void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
    142     void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; }
    143     void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; }
     140    void Test::checkU1(){ orxout() << "U1 changed: " << u1 << endl; }
     141    void Test::checkU2(){ orxout() << "U2 changed: " << u2 << endl; }
     142    void Test::checkU3(){ orxout() << "U3 changed: " << u3 << endl; }
     143    void Test::checkU4(){ orxout() << "U4 changed: " << u4 << endl; }
    144144
    145     void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; }
    146     void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; }
    147     void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
    148     void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
     145    void Test::checkS1(){ orxout() << "S1 changed: " << s1 << endl; }
     146    void Test::checkS2(){ orxout() << "S2 changed: " << s2 << endl; }
     147    void Test::checkS3(){ orxout() << "S3 changed: " << s3 << endl; }
     148    void Test::checkS4(){ orxout() << "S4 changed: " << s4 << endl; }
    149149
    150     void Test::printPointer(){ CCOUT(1) << "pointer: " << this->pointer_ << endl; }
     150    void Test::printPointer(){ orxout() << "pointer: " << this->pointer_ << endl; }
    151151
    152152}
  • code/trunk/src/orxonox/Test.h

    r7163 r8858  
    108108     
    109109      void blub2()
    110       { for( std::set<uint32_t>::iterator it=mySet_.begin(); it!=mySet_.end(); ++it ) COUT(0) << *it << endl; }
     110      { for( std::set<uint32_t>::iterator it=mySet_.begin(); it!=mySet_.end(); ++it ) orxout() << *it << endl; }
    111111  };
    112112}
  • code/trunk/src/orxonox/collisionshapes/CollisionShape.cc

    r8706 r8858  
    203203        if(scale_.crossProduct(scale).squaredLength() != 0.0f)
    204204        {
    205             CCOUT(2) << "Warning: Non-uniform scaling is not yet supported." << endl;
     205            orxout(internal_warning) << "Non-uniform scaling is not yet supported." << endl;
    206206            return;
    207207        }
  • code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r8706 r8858  
    9898        if (this->attachedShapes_.find(shape) != this->attachedShapes_.end())
    9999        {
    100             CCOUT(2) << "Warning: Attaching a CollisionShape twice is not yet supported." << std::endl;
     100            orxout(internal_warning) << "Attaching a CollisionShape twice is not yet supported." << endl;
    101101            return;
    102102        }
     
    139139        }
    140140        else
    141             CCOUT(2) << "Warning: Cannot detach non child collision shape" << std::endl;
     141            orxout(internal_warning) << "Cannot detach non child collision shape" << endl;
    142142    }
    143143
     
    168168        if (it == this->attachedShapes_.end())
    169169        {
    170             CCOUT(2) << "Warning: Cannot update child shape: Instance not a child." << std::endl;
     170            orxout(internal_warning) << "Cannot update child shape: Instance not a child." << endl;
    171171            return;
    172172        }
  • code/trunk/src/orxonox/controllers/ArtificialController.cc

    r8706 r8858  
    9898                    if (it->myMaster_ == this)
    9999                    {
    100                         COUT(1) << "error: " << this << " is still master in " << (*it) << std::endl;
     100                        orxout(internal_error) << this << " is still master in " << (*it) << endl;
    101101                        it->myMaster_ = 0;
    102102                    }
     
    107107                        if (it2 != it->slaves_.end())
    108108                        {
    109                             COUT(1) << "error: " << this << " is still slave in " << (*it) << std::endl;
     109                            orxout(internal_error) << this << " is still slave in " << (*it) << endl;
    110110                            it->slaves_.erase(it2);
    111111                        }
     
    737737        float speedDiv = this->getControllableEntity()->getVelocity().squaredLength() - this->target_->getVelocity().squaredLength();
    738738
    739 COUT(0) << "~follow distance: " << distance << "SpeedCounter: " << this->speedCounter_ << "~speedDiv: " << speedDiv << std::endl;
     739orxout() << "~follow distance: " << distance << "SpeedCounter: " << this->speedCounter_ << "~speedDiv: " << speedDiv << endl;
    740740        if (distance < 800)
    741741        {
  • code/trunk/src/orxonox/controllers/HumanController.cc

    r8706 r8858  
    9393            Camera* camera = HumanController::localController_s->controllableEntity_->getCamera();
    9494            if (!camera)
    95                 COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
     95                orxout(internal_warning) << "HumanController, Warning: Using a ControllableEntity without Camera" << endl;
    9696        }
    9797    }
     
    197197           
    198198            this->controllableEntity_->boost(this->boosting_);
    199             COUT(4) << "Start boosting" << endl;
     199//            orxout() << "Start boosting" << endl;
    200200        }
    201201    }
     
    211211
    212212        this->controllableEntity_->boost(this->boosting_);
    213         COUT(4) << "Stop boosting" << endl;
     213//        orxout() << "Stop boosting" << endl;
    214214    }
    215215
     
    257257            const Quaternion& orientation = HumanController::localController_s->controllableEntity_->getOrientation();
    258258
    259             COUT(0) << "position=\"" << position.x << ", " << position.y << ", " << position.z << "\" ";
    260             COUT(0) << "orientation=\"" << orientation.w << ", " << orientation.x << ", " << orientation.y << ", " << orientation.z << "\"" << std::endl;
     259            orxout(message) << "position=\"" << position.x << ", " << position.y << ", " << position.z << "\" "
     260                            << "orientation=\"" << orientation.w << ", " << orientation.x << ", " << orientation.y << ", " << orientation.z << "\"" << endl;
    261261        }
    262262    }
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r8436 r8858  
    388388        for (itr = result.begin(); itr != result.end(); ++itr)
    389389        {
    390 //             CCOUT(0) << "testing object as target" << endl;
     390//             orxout() << "testing object as target" << endl;
    391391            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 200)
    392392            {
  • code/trunk/src/orxonox/gamestates/GSClient.cc

    r7163 r8858  
    2929#include "GSClient.h"
    3030
    31 #include "util/Debug.h"
    3231#include "util/Exception.h"
    3332#include "core/CommandLineParser.h"
     
    5352    void GSClient::activate()
    5453    {
     54        orxout(user_status) << "Starting client" << endl;
     55
    5556        GameMode::setIsClient(true);
    5657
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r8729 r8858  
    7474    void GSLevel::activate()
    7575    {
     76        orxout(user_status) << "Loading level" << endl;
     77
    7678        if (GameMode::showsGraphics())
    7779        {
     
    155157
    156158        // call the loader
    157         COUT(0) << "Loading level..." << std::endl;
    158159        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
    159160        bool loaded = Loader::open(startFile_);
     
    169170        delete startFile_;
    170171
    171         COUT(3) << "Unloaded level. Remaining objects:" << std::endl;
     172        orxout(internal_info) << "Remaining objects:" << endl;
    172173        unsigned int i = 0;
    173174        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
     
    176177            if (find == this->staticObjects_.end())
    177178            {
    178                 COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << std::endl;
     179                orxout(internal_info) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
    179180            }
    180181        }
    181         COUT(3) << i << " objects remaining.";
     182        orxout(internal_info) << i << " objects remaining.";
    182183        if (i == 0)
    183             COUT(3) << " Well done!" << std::endl;
     184            orxout(internal_info) << " Well done!" << endl;
    184185        else
    185             COUT(3) << " Try harder!" << std::endl;
     186            orxout(internal_info) << " Try harder!" << endl;
    186187    }
    187188
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r8079 r8858  
    9595    void GSMainMenu::activate()
    9696    {
     97        orxout(user_status) << "Loading main menu" << endl;
     98
    9799        // show main menu
    98100        GraphicsManager::getInstance().setCamera(this->camera_);
  • code/trunk/src/orxonox/gamestates/GSMasterServer.cc

    r7801 r8858  
    3030#include "GSMasterServer.h"
    3131
    32 #include "util/Debug.h"
     32#include "util/Output.h"
    3333#include "core/Game.h"
    3434#include "core/GameMode.h"
     
    5050  void GSMasterServer::activate()
    5151  {
     52    orxout(user_status) << "Starting masterserver" << endl;
     53
    5254    /* TODO make this work for masterserver as well */
    5355    //GameMode::setIsServer(true);
    5456
    5557    this->mserver = new MasterServer();
    56     COUT(0) << "Loading masterserver mode" << std::endl;
    57 
    5858    this->mserver->run();
    5959  }
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r8706 r8858  
    7777        {
    7878            if (dynamic_cast<Synchronisable*>(*it))
    79                 COUT(0) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << std::endl;
     79                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << endl;
    8080            else
    81                 COUT(0) << "object: " << it->getIdentifier()->getName() << std::endl;
     81                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
    8282            nr++;
    8383        }
    84         COUT(0) << "currently got " << nr << " objects" << std::endl;
     84        orxout(debug_output) << "currently got " << nr << " objects" << endl;
    8585    }
    8686
  • code/trunk/src/orxonox/gamestates/GSServer.cc

    r7801 r8858  
    2929#include "GSServer.h"
    3030
    31 #include "util/Debug.h"
     31#include "util/Output.h"
    3232#include "core/CommandLineParser.h"
    3333#include "core/Game.h"
     
    5454    void GSServer::activate()
    5555    {
     56        orxout(user_status) << "Starting server" << endl;
     57
    5658        GameMode::setIsServer(true);
    5759
    5860        this->server_ = new Server(CommandLineParser::getValue("port"));
    59         COUT(0) << "Loading scene in server mode" << std::endl;
     61        orxout(user_status) << "Loading scene in server mode" << endl;
    6062
    6163        server_->open();
  • code/trunk/src/orxonox/gametypes/Asteroids.cc

    r7655 r8858  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "network/Host.h"
     32#include "chat/ChatManager.h"
    3333#include "worldentities/pawns/Pawn.h"
    3434
     
    7474
    7575        std::string message("The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around...");
    76         COUT(0) << message << std::endl;
    77         Host::Broadcast(message);
     76        ChatManager::message(message);
    7877
    7978    }
     
    8483
    8584        std::string message("The match has ended.");
    86         COUT(0) << message << std::endl;
    87         Host::Broadcast(message);
     85        ChatManager::message(message);
    8886    }
    8987}
  • code/trunk/src/orxonox/gametypes/Deathmatch.cc

    r6417 r8858  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "network/Host.h"
     32#include "chat/ChatManager.h"
    3333#include "infos/PlayerInfo.h"
    3434#include "worldentities/pawns/Pawn.h"
     
    4848
    4949        std::string message("The match has started!");
    50         COUT(0) << message << std::endl;
    51         Host::Broadcast(message);
     50        ChatManager::message(message);
    5251    }
    5352
     
    5756
    5857        std::string message("The match has ended.");
    59         COUT(0) << message << std::endl;
    60         Host::Broadcast(message);
     58        ChatManager::message(message);
    6159    }
    6260
     
    6664
    6765        const std::string& message = player->getName() + " entered the game";
    68         COUT(0) << message << std::endl;
    69         Host::Broadcast(message);
     66        ChatManager::message(message);
    7067    }
    7168
     
    7774        {
    7875            const std::string& message = player->getName() + " left the game";
    79             COUT(0) << message << std::endl;
    80             Host::Broadcast(message);
     76            ChatManager::message(message);
    8177        }
    8278
     
    9187        {
    9288            const std::string& message = player->getOldName() + " changed name to " + player->getName();
    93             COUT(0) << message << std::endl;
    94             Host::Broadcast(message);
     89            ChatManager::message(message);
    9590        }
    9691
     
    113108                message = victim->getPlayer()->getName() + " died";
    114109
    115             COUT(0) << message << std::endl;
    116             Host::Broadcast(message);
     110            ChatManager::message(message);
    117111        }
    118112
     
    127121        {
    128122            const std::string& message = player->getName() + " scores!";
    129             COUT(0) << message << std::endl;
    130             Host::Broadcast(message);
     123            ChatManager::message(message);
    131124        }
    132125    }
  • code/trunk/src/orxonox/gametypes/Dynamicmatch.cc

    r8729 r8858  
    4949#include "core/CoreIncludes.h"
    5050#include "core/command/Executor.h"
    51 #include "network/Host.h"
     51#include "chat/ChatManager.h"
    5252#include "infos/PlayerInfo.h"
    5353#include "worldentities/pawns/Pawn.h"
     
    342342        numberOf[chaser]++;
    343343        Gametype::playerEntered(player);
    344         const std::string& message6 = player->getName() + " entered the game";
    345         COUT(0) << message6 << std::endl;
    346         Host::Broadcast(message6);
     344        const std::string& message = player->getName() + " entered the game";
     345        ChatManager::message(message);
    347346    }
    348347
     
    359358            }
    360359            const std::string& message = player->getName() + " left the game";
    361             COUT(0) << message << std::endl;
    362             Host::Broadcast(message);
     360            ChatManager::message(message);
    363361            //remove player from map
    364362            playerParty_.erase (player);
     
    617615        {
    618616            const std::string& message = player->getOldName() + " changed name to " + player->getName();
    619             COUT(0) << message << std::endl;
    620             Host::Broadcast(message);
     617            ChatManager::message(message);
    621618        }
    622619
     
    630627        {
    631628            std::string message("Dynamicmatch started!");
    632             COUT(0) << message << std::endl;
    633             Host::Broadcast(message);
     629            ChatManager::message(message);
    634630        }
    635631        else if(tutorial) // Announce selectionphase
     
    647643    {
    648644        std::string message("Earn points:\n\n\n\tIf you're red: Chase the blue player!\n\n\tIf you're blue shoot at a red player or hide.\n\n\tIf you're green: You've got the licence to kill red players!");
    649         COUT(0) << message << std::endl;
    650         Host::Broadcast(message);
     645        ChatManager::message(message);
    651646        callInstructions_.setTimer(10, false, createExecutor(createFunctor(&Dynamicmatch::furtherInstructions, this)));
    652647    }
     
    655650    {
    656651        std::string message("After 3 Minutes the game is over.");
    657         COUT(0) << message << std::endl;
    658         Host::Broadcast(message);
     652        ChatManager::message(message);
    659653    }*/
    660654    void Dynamicmatch::end()
     
    663657
    664658        std::string message("Time out. Press F2 to see the points you scored.");
    665         COUT(0) << message << std::endl;
    666         Host::Broadcast(message);
     659        ChatManager::message(message);
    667660    }
    668661    SpawnPoint* Dynamicmatch::getBestSpawnPoint(PlayerInfo* player) const
  • code/trunk/src/orxonox/gametypes/Gametype.cc

    r8706 r8858  
    297297            }
    298298            else
    299                 COUT(2) << "Warning: Killed Pawn was not in the playerlist" << std::endl;
     299                orxout(internal_warning) << "Killed Pawn was not in the playerlist" << endl;
    300300        }
    301301    }
     
    344344            }
    345345
    346             COUT(2) << "Warning: Fallback SpawnPoint was used, because there were no active SpawnPoints." << endl;
     346            orxout(internal_warning) << "Fallback SpawnPoint was used because there were no active SpawnPoints." << endl;
    347347            return fallbackSpawnPoint;
    348348        }
     
    444444        else
    445445        {
    446             COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
     446            orxout(user_error) << "No SpawnPoints in current Gametype" << endl;
    447447            abort();
    448448        }
     
    461461        else
    462462        {
    463             COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
     463            orxout(user_error) << "No SpawnPoints in current Gametype" << endl;
    464464            abort();
    465465        }
  • code/trunk/src/orxonox/gametypes/LastManStanding.cc

    r8327 r8858  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "network/Host.h"
     32#include "chat/ChatManager.h"
    3333#include "infos/PlayerInfo.h"
    3434#include "worldentities/pawns/Pawn.h"
     
    9090                const std::string& message = ""; // resets Camper-Warning-message
    9191                this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    92             }   
     92            }
    9393        }
    9494        return true;
     
    105105            this->playersAlive--;
    106106            const std::string& message = victim->getPlayer()->getName() + " has lost all lives";
    107             COUT(0) << message << std::endl;
    108             Host::Broadcast(message);
     107            ChatManager::message(message);
    109108        }
    110109
     
    128127    {
    129128        Gametype::end();
    130        
     129
    131130        for (std::map<PlayerInfo*, int>::iterator it = this->playerLives_.begin(); it != this->playerLives_.end(); ++it)
    132131        {
     
    148147            return 0;
    149148    }
    150    
     149
    151150    int LastManStanding::getNumPlayersAlive() const
    152151    {
     
    190189        this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
    191190        this->playerDelayTime_[player]=respawnDelay;
    192        
     191
    193192        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
    194193        if (it != this->players_.end())
     
    198197            const std::string& message = ""; // resets Camper-Warning-message
    199198            this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    200         } 
     199        }
    201200    }
    202201
     
    239238            }
    240239            for (std::map<PlayerInfo*, float>::iterator it = this->timeToAct_.begin(); it != this->timeToAct_.end(); ++it)
    241             {   
     240            {
    242241                if (playerGetLives(it->first)<=0)//Players without lives shouldn't be affected by time.
    243                     continue;     
     242                    continue;
    244243                it->second-=dt;//Decreases punishment time.
    245                 if (!inGame_[it->first])//Manages respawn delay - player is forced to respawn after the delaytime is used up. 
     244                if (!inGame_[it->first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
    246245                {
    247246                    playerDelayTime_[it->first]-=dt;
  • code/trunk/src/orxonox/gametypes/LastTeamStanding.cc

    r8706 r8858  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "network/NetworkPrereqs.h"
    33 #include "network/Host.h"
     32#include "chat/ChatManager.h"
    3433#include "infos/PlayerInfo.h"
    3534#include "worldentities/pawns/Pawn.h"
     
    119118                this->teamsAlive--;
    120119            const std::string& message = victim->getPlayer()->getName() + " has lost all lives";
    121             COUT(0) << message << std::endl;
    122             Host::Broadcast(message);
     120            ChatManager::message(message);
    123121        }
    124122        return allow;
  • code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc

    r8327 r8858  
    141141            return;
    142142
    143         COUT(0) << "Points standing:" << std::endl << "Team 1: "<< pointsTeam1_ << std::endl << "Team 2: " << pointsTeam2_ << std::endl;
    144         if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) COUT(0) << "Team 1 is near victory!" << std::endl;
    145         if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) COUT(0) << "Team 2 is near victory!" << std::endl;
     143        orxout(message) << "Points standing:" << '\n' << "Team 1: "<< pointsTeam1_ << '\n' << "Team 2: " << pointsTeam2_ << endl;
     144        if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) orxout(message) << "Team 1 is near victory!" << endl;
     145        if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) orxout(message) << "Team 2 is near victory!" << endl;
    146146    }
    147147
     
    179179            if (this->pointsTeam1_ > this->pointsTeam2_)
    180180            {
    181                 COUT(0) << "Team 1 has won the match" << std::endl;
     181                orxout(message) << "Team 1 has won the match" << endl;
    182182                winningteam = 0;
    183183            }
    184184            else
    185185            {
    186                 COUT(0) << "Team 2 has won the match" << std::endl;
     186                orxout(message) << "Team 2 has won the match" << endl;
    187187                winningteam = 1;
    188188            }
  • code/trunk/src/orxonox/gametypes/UnderAttack.cc

    r8327 r8858  
    3232#include "core/CoreIncludes.h"
    3333#include "core/ConfigValueIncludes.h"
    34 #include "network/Host.h"
     34#include "chat/ChatManager.h"
    3535#include "worldentities/pawns/Destroyer.h"
    3636#include "infos/PlayerInfo.h"
     
    7070        this->end(); //end gametype
    7171        std::string message("Ship destroyed! Team 0 has won!");
    72         COUT(0) << message << std::endl;
    73         Host::Broadcast(message);
     72        ChatManager::message(message);
    7473        this->gameEnded_ = true;
    7574
     
    153152                this->end();
    154153                std::string message("Time is up! Team 1 has won!");
    155                 COUT(0) << message << std::endl;
    156                 Host::Broadcast(message);
     154                ChatManager::message(message);
    157155
    158156                for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
     
    173171                const std::string& message = multi_cast<std::string>(timesequence_) + " seconds left!";
    174172/*
    175                 COUT(0) << message << std::endl;
    176                 Host::Broadcast(message);
     173                ChatManager::message(message);
    177174*/
    178175                this->gtinfo_->sendAnnounceMessage(message);
  • code/trunk/src/orxonox/graphics/AnimatedModel.cc

    r7163 r8858  
    2222 *   Author:
    2323 *      Benjamin de Capitani
    24  *
     24 *   Co-authors:
     25 *      ...
    2526 *
    2627 */
  • code/trunk/src/orxonox/graphics/AnimatedModel.h

    r7163 r8858  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Benjamin de Capitani
    2424 *   Co-authors:
    2525 *      ...
  • code/trunk/src/orxonox/graphics/Model.cc

    r8079 r8858  
    142142            if( this->numLodLevels_>10 )
    143143            {
    144                 CCOUT(2) << "More than 10 LoD levels requested. Creating only 10." << endl;
     144                orxout(internal_warning, context::lod) << "More than 10 LoD levels requested. Creating only 10." << endl;
    145145                this->numLodLevels_ = 10;
    146146            }
     
    158158                    creatorPtr = creatorPtr->getCreator();
    159159                }
    160                 COUT(0) << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
     160                orxout() << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
    161161*/
    162                 COUT(4) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << std::endl;
     162                orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
    163163
    164164#if OGRE_VERSION >= 0x010700
     
    173173                    float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_;
    174174
    175                     COUT(4) << "LodLevel set with factor: " << factor << endl;
     175                    orxout(verbose, context::lod) << "LodLevel set with factor: " << factor << endl;
    176176
    177177                    distList.push_back(70.0f*factor);
     
    200200                        what = "<0";
    201201
    202                     COUT(4)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was "<<what<<"." << endl;
     202                    orxout(verbose, context::lod) << "LodLevel not set because lodLevel(" << lodLevel_ << ") was " << what << "." << endl;
    203203                }
    204204            }
    205205            else
    206                 COUT(4) << "LodLevel for " << this->meshSrc_ << " not set because is disabled." << endl;
     206                orxout(verbose, context::lod) << "LodLevel for " << this->meshSrc_ << " not set because is disabled." << endl;
    207207        }
    208208    }
  • code/trunk/src/orxonox/graphics/ParticleEmitter.cc

    r7174 r8858  
    116116            catch (const std::exception& ex)
    117117            {
    118                 COUT(1) << "Error: Couln't load particle effect \"" << this->source_ << "\" because:" << std::endl
    119                         << ex.what() << std::endl;
     118                orxout(internal_error) << "Couldn't load particle effect \"" << this->source_ << "\" because:" << endl
     119                                       << ex.what() << endl;
    120120            }
    121121        }
  • code/trunk/src/orxonox/infos/GametypeInfo.cc

    r8706 r8858  
    196196        this->startCountdown_ = countdown;
    197197        // Set the counter to the ceiling of the current countdown.
    198         this->counter_ = std::ceil(countdown);
     198        this->counter_ = static_cast<unsigned int>(std::ceil(countdown));
    199199        this->changedCountdownCounter();
    200200    }
  • code/trunk/src/orxonox/interfaces/PickupCarrier.cc

    r8351 r8858  
    7575            if(it != this->pickups_.end() && temp == *it) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
    7676            {
    77                 COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << temp << ") didn't unregister itself as it should have." << std::endl;;
     77                orxout(internal_warning, context::pickups) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << temp << ") didn't unregister itself as it should have." << endl;;
    7878                it++;
    7979            }
     
    158158    bool PickupCarrier::addPickup(Pickupable* pickup)
    159159    {
    160         COUT(4) << "Adding Pickupable (&" << pickup << ") to PickupCarrier (&" << this << ")" << std::endl;
     160        orxout(verbose, context::pickups) << "Adding Pickupable (&" << pickup << ") to PickupCarrier (&" << this << ")" << endl;
    161161        return this->pickups_.insert(pickup).second;
    162162    }
     
    172172    bool PickupCarrier::removePickup(Pickupable* pickup)
    173173    {
    174         COUT(4) << "Removing Pickupable (&" << pickup << ") from PickupCarrier (&" << this << ")" << std::endl;
     174        orxout(verbose, context::pickups) << "Removing Pickupable (&" << pickup << ") from PickupCarrier (&" << this << ")" << endl;
    175175        return this->pickups_.erase(pickup) == 1;
    176176    }
  • code/trunk/src/orxonox/interfaces/Pickupable.cc

    r8464 r8858  
    7171        if(this->pickupIdentifier_ != NULL)
    7272        {
    73             COUT(4) << "Pickupable (&" << this << ") destroyed." << std::endl;
     73            orxout(verbose, context::pickups) << "Pickupable (&" << this << ") destroyed." << endl;
    7474            this->pickupIdentifier_->destroy();
    7575        }
     
    107107            this->OrxonoxClass::destroy();
    108108        else
    109             COUT(2) << this->getIdentifier()->getName() << " may be unsafe. " << std::endl;
     109            orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl;
    110110    }
    111111
     
    126126            return false;
    127127
    128         COUT(4) << "Pickupable (&" << this << ") set to used " << used << "." << std::endl;
     128        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") set to used " << used << "." << endl;
    129129
    130130        this->used_ = used;
     
    201201            return false;
    202202
    203         COUT(4) << "Target " << target->getName() << " added to Pickupable (" << this->getIdentifier()->getName() << ") (&" << this << ")." << std::endl;
     203        orxout(verbose, context::pickups) << "Target " << target->getName() << " added to Pickupable (" << this->getIdentifier()->getName() << ") (&" << this << ")." << endl;
    204204        this->targets_.push_back(target);
    205205        return true;
     
    221221        if(!this->setCarrier(carrier))
    222222        {
    223             COUT(3) << "A Pickupable (&" << this << ") was trying to be added to a PickupCarrier, but was already present." << std::endl;
     223            orxout(internal_warning, context::pickups) << "A Pickupable (&" << this << ") was trying to be added to a PickupCarrier, but was already present." << endl;
    224224            return false;
    225225        }
    226226
    227227        this->setPickedUp(true);
    228         COUT(4) << "Pickupable (&" << this << ") got picked up by a PickupCarrier (&" << carrier << ")." << std::endl;
     228        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") got picked up by a PickupCarrier (&" << carrier << ")." << endl;
    229229        return true;
    230230    }
     
    245245        assert(this->getCarrier()); // The Carrier cannot be NULL at this point.
    246246        if(!this->getCarrier()->removePickup(this)) //TODO Shouldn't this be a little later?
    247             COUT(2) << "Pickupable (&" << this << ", " << this->getIdentifier()->getName() << ") is being dropped, but it was not present in the PickupCarriers list of pickups." << std::endl;
    248 
    249         COUT(4) << "Pickupable (&" << this << ") got dropped up by a PickupCarrier (&" << this->getCarrier() << ")." << std::endl;
     247            orxout(internal_warning, context::pickups) << "Pickupable (&" << this << ", " << this->getIdentifier()->getName() << ") is being dropped, but it was not present in the PickupCarriers list of pickups." << endl;
     248
     249        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") got dropped up by a PickupCarrier (&" << this->getCarrier() << ")." << endl;
    250250        this->setUsed(false);
    251251        this->setPickedUp(false);
     
    276276            return false;
    277277
    278         COUT(4) << "Pickupable (&" << this << ") set to pickedUp " << pickedUp << "." << std::endl;
     278        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") set to pickedUp " << pickedUp << "." << endl;
    279279
    280280        this->pickedUp_ = pickedUp;
     
    305305            return false;
    306306
    307         COUT(4) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << std::endl;
     307        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << endl;
    308308
    309309        if(carrier != NULL && tell)
     
    340340        Pickupable* pickup = dynamic_cast<Pickupable*>(item);
    341341
    342         COUT(4) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << std::endl;
     342        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << endl;
    343343        return pickup;
    344344    }
  • code/trunk/src/orxonox/interfaces/RadarViewable.cc

    r8738 r8858  
    8383//         else
    8484//         {
    85 //             CCOUT(2) << "Attempting to access the radar, but the radar is non existent." << std::endl;
     85//             orxout(internal_warning) << "Attempting to access the radar, but the radar is non existent." << endl;
    8686//         }
    8787//         this->radarObjectDescription_ = str;
     
    106106        if (!object)
    107107        {
    108             COUT(1) << "Assertion: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl;
     108            orxout(user_error) << "Assertion: Every RadarViewable has to be assigned a WorldEntity pointer!" << endl;
    109109            assert(0);
    110110        }
  • code/trunk/src/orxonox/items/Engine.cc

    r8727 r8858  
    261261        if(!this->engineTemplate_.empty())
    262262        {
    263             COUT(4)<<"Loading an engine template: "<<this->engineTemplate_<<"\n";
     263            orxout(verbose, context::templates) << "Loading an engine template: " << this->engineTemplate_ << endl;
    264264            Template *temp = Template::getTemplate(this->engineTemplate_);
    265265            if(temp)
  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r8729 r8858  
    4646#include "util/DisplayStringConversions.h"
    4747#include "util/ScopedSingletonManager.h"
     48#include "util/output/MemoryWriter.h"
    4849#include "core/CoreIncludes.h"
    4950#include "core/ConfigValueIncludes.h"
     
    5859{
    5960    const int LINES = 30;
    60     const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
     61    const float CHAR_WIDTH = 8.0f; // fix this please - determine the char-width dynamically
    6162
    6263    SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole);
     
    9495        // Output buffering is not anymore needed. Not the best solution to do
    9596        // this here, but there isn't much of another way.
    96         OutputHandler::getInstance().disableMemoryLog();
     97        MemoryWriter::getInstance().disable();
    9798    }
    9899
     
    262263        this->consoleOverlayContainer_->setTop(-1.3f * this->relativeHeight);
    263264
    264         COUT(4) << "Info: InGameConsole initialized" << std::endl;
     265        orxout(internal_info) << "InGameConsole initialized" << endl;
    265266    }
    266267
     
    288289
    289290        for (int i = LINES - 1; i > max; --i)
    290             this->print("", Shell::None, i, true);
     291            this->print("", Shell::DebugOutput, i, true);
    291292
    292293        for (int i = max; i >= 1; --i)
     
    298299
    299300    /**
    300         @brief Called if only the last output-line has changed.
    301     */
    302     void InGameConsole::onlyLastLineChanged()
    303     {
     301        @brief Called if a new output-line was added.
     302    */
     303    void InGameConsole::lineAdded()
     304    {
     305        this->numLinesShifted_ = 0;
     306        this->shiftLines();
    304307        if (LINES > 1)
    305308            this->print(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second, 1);
    306     }
    307 
    308     /**
    309         @brief Called if a new output-line was added.
    310     */
    311     void InGameConsole::lineAdded()
    312     {
    313         this->numLinesShifted_ = 0;
    314         this->shiftLines();
    315         this->onlyLastLineChanged();
    316309    }
    317310
     
    346339    void InGameConsole::executed()
    347340    {
    348         this->shell_->addOutput(this->shell_->getInput() + '\n', Shell::Command);
     341        this->shell_->addOutput(this->shell_->getInput(), Shell::Command);
    349342    }
    350343
     
    437430
    438431        // now adjust the text lines...
    439         this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 12;
     432        this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 24;
    440433
    441434        if (LINES > 0)
     
    566559        switch (type)
    567560        {
    568         case Shell::Error:   colourTop = ColourValue(0.95f, 0.25f, 0.25f, 1.00f);
    569                           colourBottom = ColourValue(1.00f, 0.50f, 0.50f, 1.00f); break;
    570 
    571         case Shell::Warning: colourTop = ColourValue(0.95f, 0.50f, 0.20f, 1.00f);
    572                           colourBottom = ColourValue(1.00f, 0.70f, 0.50f, 1.00f); break;
    573 
    574         case Shell::Info:    colourTop = ColourValue(0.50f, 0.50f, 0.95f, 1.00f);
    575                           colourBottom = ColourValue(0.80f, 0.80f, 1.00f, 1.00f); break;
    576 
    577         case Shell::Debug:   colourTop = ColourValue(0.65f, 0.48f, 0.44f, 1.00f);
    578                           colourBottom = ColourValue(1.00f, 0.90f, 0.90f, 1.00f); break;
    579 
    580         case Shell::Verbose: colourTop = ColourValue(0.40f, 0.20f, 0.40f, 1.00f);
    581                           colourBottom = ColourValue(0.80f, 0.60f, 0.80f, 1.00f); break;
    582 
    583         case Shell::Ultra:   colourTop = ColourValue(0.21f, 0.69f, 0.21f, 1.00f);
    584                           colourBottom = ColourValue(0.80f, 1.00f, 0.80f, 1.00f); break;
    585 
    586         case Shell::Command: colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f);
    587                           colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 0.90f); break;
    588 
    589         case Shell::Hint:    colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f);
    590                           colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); break;
    591 
    592         case Shell::TDebug:  colourTop = ColourValue(0.90f, 0.00f, 0.90f, 1.00f);
    593                           colourBottom = ColourValue(1.00f, 0.00f, 1.00f, 1.00f); break;
    594 
    595         default:             colourTop = ColourValue(0.90f, 0.90f, 0.90f, 1.00f);
    596                           colourBottom = ColourValue(1.00f, 1.00f, 1.00f, 1.00f); break;
    597         }
     561            case Shell::Message:
     562            case Shell::DebugOutput:     colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
     563
     564            case Shell::UserError:       colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;
     565            case Shell::UserWarning:     colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;
     566            case Shell::UserStatus:      colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;
     567            case Shell::UserInfo:        colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;
     568
     569            case Shell::InternalError:   colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;
     570            case Shell::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;
     571            case Shell::InternalStatus:  colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;
     572            case Shell::InternalInfo:    colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;
     573
     574            case Shell::Verbose:         colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;
     575            case Shell::VerboseMore:     colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;
     576            case Shell::VerboseUltra:    colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;
     577
     578            case Shell::Command:         colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;
     579            case Shell::Hint:            colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;
     580            case Shell::Input:           colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
     581
     582            default:                     colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;
     583        }
     584
     585        colourBottom = ColourValue(sqrt(colourTop.r), sqrt(colourTop.g), sqrt(colourTop.b));
    598586
    599587        this->consoleOverlayTextAreas_[index]->setColourTop   (colourTop);
  • code/trunk/src/orxonox/overlays/InGameConsole.h

    r7284 r8858  
    6464
    6565        void linesChanged();
    66         void onlyLastLineChanged();
    6766        void lineAdded();
    6867        void inputChanged();
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r8706 r8858  
    147147
    148148        if (OrxonoxOverlay::overlays_s.find(this->getName()) != OrxonoxOverlay::overlays_s.end())
    149             COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << '"' << std::endl;
     149            orxout(internal_warning) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << '"' << endl;
    150150
    151151        OrxonoxOverlay::overlays_s[this->getName()] = this;
     
    362362            {
    363363                overlay->hide();
    364                 COUT(4) << "HIDE " << name << std::endl;
     364                orxout(verbose, context::misc::overlays) << "HIDE " << name << endl;
    365365            }
    366366            else
    367367            {
    368368                overlay->show();
    369                 COUT(4) << "SHOW " << name << std::endl;
     369                orxout(verbose, context::misc::overlays) << "SHOW " << name << endl;
    370370            }
    371371        }
  • code/trunk/src/orxonox/pickup/PickupIdentifier.cc

    r7494 r8858  
    5151
    5252        if(pickup == NULL)
    53             COUT(1) << "Error, PickupIdentifier was created without a valid Pickupable." << std::endl;
     53            orxout(internal_error, context::pickups) << "PickupIdentifier was created without a valid Pickupable." << endl;
    5454
    5555        this->pickup_ = pickup;
     
    8383        if(!(this->parameters_.size() == identifier->parameters_.size()))
    8484        {
    85             COUT(1) << "Something went wrong in PickupIdentifier!" << std::endl;
     85            orxout(internal_error, context::pickups) << "Something went wrong in PickupIdentifier!" << endl;
    8686            return this->parameters_.size()-identifier->parameters_.size();
    8787        }
     
    9393            if(identifier->parameters_.find(it->first) == identifier->parameters_.end())
    9494            {
    95                 COUT(1) << "Something went wrong in PickupIdentifier!" << std::endl;
     95                orxout(internal_error, context::pickups) << "Something went wrong in PickupIdentifier!" << endl;
    9696                return -1;
    9797            }
     
    115115    bool PickupIdentifier::addParameter(std::string & name, std::string & value)
    116116    {
    117         COUT(4) << "PickupIdentifier " << name << ", " << value << std::endl;
     117        orxout(verbose, context::pickups) << "PickupIdentifier " << name << ", " << value << endl;
    118118
    119119        if(!(this->parameters_.find(name) == this->parameters_.end()))
    120120        {
    121             COUT(4) << "Request for adding a parameter that already exists for the PickupIdentififer was denied. name: '" << name << "', value: '" << value << "'."<<  std::endl;
     121            orxout(verbose, context::pickups) << "Request for adding a parameter that already exists for the PickupIdentififer was denied. name: '" << name << "', value: '" << value << "'."<<  endl;
    122122            return false;
    123123        }
  • code/trunk/src/orxonox/sound/AmbientSound.cc

    r8706 r8858  
    9494                this->setSource(path);
    9595            else
    96                 COUT(3) << "Sound: " << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << std::endl;
     96                orxout(internal_warning, context::sound) << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << endl;
    9797        }
    9898    }
  • code/trunk/src/orxonox/sound/BaseSound.cc

    r8729 r8858  
    9494            alSourcePlay(this->audioSource_);
    9595            if (int error = alGetError())
    96                 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;
     96                orxout(internal_error, context::sound) << "Error playing sound: " << SoundManager::getALErrorString(error) << endl;
    9797        }
    9898    }
     
    147147        alSource3f(this->audioSource_, AL_DIRECTION, 0, 0, 0);
    148148        if (ALint error = alGetError())
    149             COUT(2) << "Sound Warning: Setting source parameters to 0 failed: "
    150                     << SoundManager::getALErrorString(error) << std::endl;
     149            orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: "
     150                                                     << SoundManager::getALErrorString(error) << endl;
    151151        assert(this->soundBuffer_ != NULL);
    152152        alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());
    153153        if (ALuint error = alGetError())
    154             COUT(1) << "Sound Error: Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << std::endl;
     154            orxout(internal_error, context::sound) << "Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << endl;
    155155    }
    156156
     
    159159        this->volume_ = clamp(vol, 0.0f, 1.0f);
    160160        if (this->volume_ != vol)
    161             COUT(2) << "Sound warning: volume out of range, clamping value." << std::endl;
     161            orxout(internal_warning, context::sound) << "Volume out of range, clamping value." << endl;
    162162        this->updateVolume();
    163163    }
     
    170170            alSourcef(this->audioSource_, AL_GAIN, volume);
    171171            if (int error = alGetError())
    172                 COUT(2) << "Sound: Error setting volume to " << volume
    173                         << ": " << SoundManager::getALErrorString(error) << std::endl;
     172                orxout(internal_error, context::sound) << "Error setting volume to " << volume
     173                                                       << ": " << SoundManager::getALErrorString(error) << endl;
    174174        }
    175175    }
     
    186186        if (pitch > 2 || pitch < 0.5f)
    187187        {
    188             COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl;
     188            orxout(internal_warning, context::sound) << "Pitch out of range, cropping value." << endl;
    189189            pitch = pitch > 2.0f ? 2.0f : pitch;
    190190            pitch = pitch < 0.5f ? 0.5f : pitch;
     
    195195            alSourcef(this->audioSource_, AL_PITCH, pitch);
    196196            if (int error = alGetError())
    197                 COUT(2) << "Sound: Error setting pitch: " << SoundManager::getALErrorString(error) << std::endl;
     197                orxout(internal_error, context::sound) << "Error setting pitch: " << SoundManager::getALErrorString(error) << endl;
    198198        }
    199199    }
     
    240240            if (ALuint error = alGetError())
    241241            {
    242                 COUT(1) << "Sound Error: Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << std::endl;
     242                orxout(internal_error, context::sound) << "Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << endl;
    243243                return;
    244244            }
     
    248248            alSourcePlay(this->audioSource_);
    249249            if (int error = alGetError())
    250                 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;
     250                orxout(internal_error, context::sound) << "Error playing sound: " << SoundManager::getALErrorString(error) << endl;
    251251            if (this->isPaused())
    252252                alSourcePause(this->audioSource_);
  • code/trunk/src/orxonox/sound/SoundBuffer.cc

    r8351 r8858  
    5151        if (fileInfo == NULL)
    5252        {
    53             COUT(2) << "Sound: Warning: Sound file '" << filename << "' not found" << std::endl;
     53            orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl;
    5454            return;
    5555        }
     
    144144        if (ret < 0)
    145145        {
    146             COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
     146            orxout(internal_error, context::sound) << "libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << endl;
    147147            ov_clear(&vf);
    148148            ThrowException(General, "Sound Error: Ogg file loader failed when opening the bitstream");
     
    160160            else if (ret < 0)
    161161            {
    162                 COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
     162                orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl;
    163163                ov_clear(&vf);
    164164                ThrowException(General, "Sound Error: Ogg file loader failed when decoding the file");
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r8521 r8858  
    7171        RegisterRootObject(SoundManager);
    7272
     73        orxout(user_status) << "Loading sound" << endl;
     74
    7375        this->bDestructorCalled_ = false;
    7476         
     
    8991        std::string renderDevice;
    9092        SetConfigValue(renderDevice, std::string(device)).description("Sound device used for rendering");
    91         COUT(4) << "Sound: Available devices: ";
     93        orxout(verbose, context::sound) << "Sound: Available devices: ";
    9294        while (true)
    9395        {
    9496            this->deviceNames_.push_back(devices);
    95             COUT(4) << '"' << devices << "\", ";
     97            orxout(verbose, context::sound) << '"' << devices << "\", ";
    9698            devices += strlen(devices) + 1;
    9799            if (*devices == '\0')
    98100                break;
    99101        }
    100         COUT(4) << std::endl;
     102        orxout(verbose, context::sound) << endl;
    101103
    102104        // Open the selected device
    103         COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl;
     105        orxout(internal_info, context::sound) << "Sound: Opening device \"" << renderDevice << '\' << endl;
    104106        this->device_ = alcOpenDevice(renderDevice.c_str());
    105107*/
     
    122124        // Get some information about the sound
    123125        if (const char* version = alGetString(AL_VERSION))
    124             COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;
     126            orxout(internal_info, context::sound) << "Sound: --- OpenAL Version: " << version << endl;
    125127        if (const char* vendor = alGetString(AL_VENDOR))
    126             COUT(4) << "Sound: --- OpenAL Vendor : " << vendor << std::endl;
     128            orxout(internal_info, context::sound) << "Sound: --- OpenAL Vendor : " << vendor << endl;
    127129        if (const char* types = alutGetMIMETypes(ALUT_LOADER_BUFFER))
    128             COUT(4) << "Sound: --- Supported MIME Types: " << types << std::endl;
     130            orxout(internal_info, context::sound) << "Sound: --- Supported MIME Types: " << types << endl;
    129131        else
    130             COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
     132            orxout(internal_warning, context::sound) << "MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << endl;
    131133
    132134        this->mute_[SoundType::All]     = 1.0f;
     
    152154        resetPlaysSoundGuard.Dismiss();
    153155
    154         COUT(4) << "Sound: Initialisation complete" << std::endl;
     156        orxout(internal_status, context::sound) << "Sound: Initialisation complete" << endl;
    155157    }
    156158
     
    164166        // If there are still used buffers around, well, that's just very bad...
    165167        if (this->soundBuffers_.size() != this->effectsPool_.size())
    166             COUT(1) << "Sound Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     168            orxout(internal_error, context::sound) << "Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << endl;
    167169        // Empty buffer pool and buffer list
    168170        this->effectsPool_.clear();
     
    171173        // There should not be any sources in use anymore
    172174        if (!this->usedSoundSources_.empty())
    173             COUT(1) << "Sound Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     175            orxout(internal_error, context::sound) << "Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << endl;
    174176        while (!this->availableSoundSources_.empty())
    175177        {
     
    182184        // Relieve context to destroy it
    183185        if (!alcMakeContextCurrent(NULL))
    184             COUT(1) << "Sound Error: Could not unset ALC context" << std::endl;
     186            orxout(internal_error, context::sound) << "Could not unset ALC context" << endl;
    185187        alcDestroyContext(this->context_);
    186188        if (ALCenum error = alcGetError(this->device_))
    187189        {
    188190            if (error == AL_INVALID_OPERATION)
    189                 COUT(1) << "Sound Error: Could not destroy ALC context because it is the current one" << std::endl;
     191                orxout(internal_error, context::sound) << "Could not destroy ALC context because it is the current one" << endl;
    190192            else
    191                 COUT(1) << "Sound Error: Could not destroy ALC context because it is invalid" << std::endl;
     193                orxout(internal_error, context::sound) << "Could not destroy ALC context because it is invalid" << endl;
    192194        }
    193195#ifdef AL_VERSION_1_1
    194196        if (!alcCloseDevice(this->device_))
    195             COUT(1) << "Sound Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;
     197            orxout(internal_error, context::sound) << "Could not destroy ALC device. This might be because there are still buffers in use!" << endl;
    196198#else
    197199        alcCloseDevice(this->device_);
    198200#endif
    199201        if (!alutExit())
    200             COUT(1) << "Sound Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;
     202            orxout(internal_error, context::sound) << "Closing ALUT failed: " << alutGetErrorString(alutGetError()) << endl;
    201203    }
    202204
     
    244246        if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 )
    245247        {
    246             COUT(2) << "Sound warning: fade step out of range, ignoring change." << std::endl;
     248            orxout(internal_warning, context::sound) << "Fade step out of range, ignoring change." << endl;
    247249            ResetConfigValue(crossFadeStep_);
    248250        }
     
    253255        float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f);
    254256        if (clampedVolume != this->volume_[type])
    255             COUT(2) << "Sound warning: Volume setting (" << type << ") out of range, clamping." << std::endl;
     257            orxout(internal_warning, context::sound) << "Volume setting (" << type << ") out of range, clamping." << endl;
    256258        this->updateVolume(type);
    257259    }
     
    321323        if (error == AL_INVALID_VALUE)
    322324            // @TODO: Follow this constantly appearing, nerve-racking warning
    323             COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
     325            orxout(internal_error, context::sound) << "OpenAL: Invalid listener position" << endl;
    324326    }
    325327
     
    335337        ALenum error = alGetError();
    336338        if (error == AL_INVALID_VALUE)
    337             COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl;
     339            orxout(internal_error, context::sound) << "OpenAL: Invalid listener orientation" << endl;
    338340    }
    339341
     
    346348                if (it->first == newAmbient)
    347349                {
    348                     COUT(2) << "Sound warning: Will not play an AmbientSound twice." << std::endl;
     350                    orxout(internal_warning, context::sound) << "Will not play an AmbientSound twice." << endl;
    349351                    return;
    350352                }
     
    520522            catch (const std::exception& ex)
    521523            {
    522                 COUT(1) << ex.what() << std::endl;
     524                orxout(internal_error, context::sound) << ex.what() << endl;
    523525                return buffer;
    524526            }
     
    614616            alDeleteSources(1, &this->availableSoundSources_.back());
    615617            if (alGetError())
    616                 COUT(1) << "Sound Error: Failed to delete a source --> lost forever" << std::endl;
     618                orxout(internal_error, context::sound) << "Failed to delete a source --> lost forever" << endl;
    617619            this->availableSoundSources_.pop_back();
    618620        }
  • code/trunk/src/orxonox/sound/SoundStreamer.cc

    r7163 r8858  
    5151        if (ret < 0)
    5252        {
    53             COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
     53            orxout(internal_error, context::sound) << "libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << endl;
    5454            ov_clear(&vf);
    5555            return;
     
    7777            else if (ret < 0)
    7878            {
    79                 COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
     79                orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl;
    8080                ov_clear(&vf);
    8181                return;
     
    9191            alGetSourcei(audioSource, AL_BUFFERS_PROCESSED, &processed);
    9292            if (ALint error = alGetError())
    93             COUT(2) << "Sound Warning: Couldn't get number of processed buffers: "
    94                     << SoundManager::getALErrorString(error) << std::endl;
     93            orxout(internal_warning, context::sound) << "Couldn't get number of processed buffers: "
     94                                                     << SoundManager::getALErrorString(error) << endl;
    9595
    9696            if(processed > 0)
     
    9999                alSourceUnqueueBuffers(audioSource, processed, buffers);
    100100                if (ALint error = alGetError())
    101                     COUT(2) << "Sound Warning: Couldn't unqueue buffers: "
    102                     << SoundManager::getALErrorString(error) << std::endl;
     101                    orxout(internal_warning, context::sound) << "Couldn't unqueue buffers: "
     102                                                             << SoundManager::getALErrorString(error) << endl;
    103103
    104104                for(int i = 0; i < processed; i++)
     
    111111                    else if (ret < 0)
    112112                    {
    113                         COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
     113                        orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl;
    114114                        ov_clear(&vf);
    115115                        return;
     
    121121                alSourceQueueBuffers(audioSource, processed, buffers);
    122122                if (ALint error = alGetError())
    123                     COUT(2) << "Sound Warning: Couldn't queue buffers: "
    124                     << SoundManager::getALErrorString(error) << std::endl;
     123                    orxout(internal_warning, context::sound) << "Couldn't queue buffers: "
     124                                                             << SoundManager::getALErrorString(error) << endl;
    125125            }
    126126        }
  • code/trunk/src/orxonox/sound/WorldSound.cc

    r8351 r8858  
    9494            ALenum error = alGetError();
    9595            if (error == AL_INVALID_VALUE)
    96                 COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;
     96                orxout(internal_error, context::sound) << "OpenAL: Invalid sound position" << endl;
    9797
    9898            const Vector3& vel = this->getVelocity();
     
    100100            error = alGetError();
    101101            if (error == AL_INVALID_VALUE)
    102                 COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;
     102                orxout(internal_error, context::sound) << "OpenAL: Invalid sound velocity" << endl;
    103103
    104104            const Vector3& direction = -this->getWorldOrientation().zAxis();
     
    106106            error = alGetError();
    107107            if (error == AL_INVALID_VALUE)
    108                 COUT(2) << "Sound: OpenAL: Invalid sound direction" << std::endl;
     108                orxout(internal_error, context::sound) << "OpenAL: Invalid sound direction" << endl;
    109109        }
    110110    }
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.cc

    r8706 r8858  
    188188            this->munitiontype_ = identifier;
    189189        else
    190             COUT(2) << "Warning: No munition class defined in WeaponMode " << this->getName() << std::endl;
     190            orxout(internal_warning) << "No munition class defined in WeaponMode " << this->getName() << endl;
    191191        this->updateMunition();
    192192    }
     
    249249            Vector3 muzzleDirection;
    250250            muzzleDirection = target - this->muzzlePosition_;
    251 //             COUT(0) << "muzzleDirection " << muzzleDirection << endl;
    252251            this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation();
    253252        }
  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r7284 r8858  
    6161            catch (const std::exception& ex)
    6262            {
    63                 COUT(1) << "Error: Couln't load particle effect in BigExplosion: " << ex.what() << std::endl;
     63                orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
    6464                this->initZero();
    6565            }
  • code/trunk/src/orxonox/worldentities/ControllableEntity.cc

    r8706 r8858  
    457457        }
    458458        else
    459             COUT(2) << "Warning: ControllableEntity \"" << this->getName() << "\" already has a Controller." << std::endl;
     459            orxout(internal_warning) << "ControllableEntity \"" << this->getName() << "\" already has a Controller." << endl;
    460460    }
    461461
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.cc

    r7284 r8858  
    6161            catch (const std::exception& ex)
    6262            {
    63                 COUT(1) << "Error: Couln't load particle effect in ExplosionChunk: " << ex.what() << std::endl;
     63                orxout(internal_error) << "Couldn't load particle effect in ExplosionChunk: " << ex.what() << endl;
    6464                this->fire_ = 0;
    6565                this->smoke_ = 0;
  • code/trunk/src/orxonox/worldentities/MobileEntity.cc

    r8727 r8858  
    189189        if (type == WorldEntity::Static)
    190190        {
    191             CCOUT(1) << "Error: Cannot tell a MobileEntity to have static collision type! Ignoring." << std::endl;
     191            orxout(internal_warning) << "Cannot tell a MobileEntity to have static collision type! Ignoring." << endl;
    192192            assert(false); // Only in debug mode
    193193            return false;
  • code/trunk/src/orxonox/worldentities/SpawnPoint.cc

    r8706 r8858  
    4848            this->getGametype()->registerSpawnPoint(this);
    4949        else
    50             COUT(1) << "Error: SpawnPoint has no Gametype" << std::endl;
     50            orxout(internal_error) << "SpawnPoint has no Gametype" << endl;
    5151
    5252        this->setSyncMode(ObjectDirection::None);
  • code/trunk/src/orxonox/worldentities/StaticEntity.cc

    r6417 r8858  
    6363        if (this->addedToPhysicalWorld())
    6464        {
    65             CCOUT(2) << "Warning: Attempting to change the position of a StaticEntity at physics run time. Ignoring change." << std::endl;
     65            orxout(internal_warning) << "Attempting to change the position of a StaticEntity at physics run time. Ignoring change." << endl;
    6666            return;
    6767        }
     
    8080        if (this->addedToPhysicalWorld())
    8181        {
    82             CCOUT(2) << "Warning: Attempting to change the orientation of a StaticEntity at physics run time. Ignoring change." << std::endl;
     82            orxout(internal_warning) << "Attempting to change the orientation of a StaticEntity at physics run time. Ignoring change." << endl;
    8383            return;
    8484        }
     
    9797        if (type == WorldEntity::Kinematic || type == WorldEntity::Dynamic)
    9898        {
    99             CCOUT(1) << "Error: Cannot tell a StaticEntity to have kinematic or dynamic collision type! Ignoring." << std::endl;
     99            orxout(internal_warning) << "Cannot tell a StaticEntity to have kinematic or dynamic collision type! Ignoring." << endl;
    100100            assert(false); // Only in debug mode
    101101            return false;
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r8706 r8858  
    9595        this->collisionType_             = None;
    9696        this->collisionTypeSynchronised_ = None;
    97         this->mass_           = 0;
     97        this->mass_           = 1.0f;
    9898        this->childrenMass_   = 0;
    9999        // Using bullet default values
     
    311311            this->collisionTypeSynchronised_ != None)
    312312        {
    313             CCOUT(1) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << std::endl;
     313            orxout(internal_error) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << endl;
    314314        }
    315315        else if (this->collisionTypeSynchronised_ != collisionType_)
    316316        {
    317317            if (this->parent_)
    318                 CCOUT(2) << "Warning: Network connection tried to set the collision type of an attached WE. Ignoring." << std::endl;
     318                orxout(internal_warning) << "Network connection tried to set the collision type of an attached WE. Ignoring." << endl;
    319319            else
    320320                this->setCollisionType(this->collisionTypeSynchronised_);
     
    373373        if (object == this)
    374374        {
    375             COUT(2) << "Warning: Can't attach a WorldEntity to itself." << std::endl;
     375            orxout(internal_warning) << "Can't attach a WorldEntity to itself." << endl;
    376376            return;
    377377        }
     
    406406            if (!newParent->hasPhysics())
    407407            {
    408                 COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl;
     408                orxout(internal_warning) << " Cannot attach a physical object to a non physical one." << endl;
    409409                return false;
    410410            }
    411411            else if (this->isDynamic())
    412412            {
    413                 COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl;
     413                orxout(internal_warning) << "Cannot attach a dynamic object to a WorldEntity." << endl;
    414414                return false;
    415415            }
    416416            else if (this->isKinematic() && newParent->isDynamic())
    417417            {
    418                 COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl;
     418                orxout(internal_warning) << "Cannot attach a kinematic object to a dynamic one." << endl;
    419419                return false;
    420420            }
    421421            else if (this->isKinematic())
    422422            {
    423                 COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl;
     423                orxout(internal_warning) << "Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << endl;
    424424                return false;
    425425            }
     
    455455        if (it == this->children_.end())
    456456        {
    457             CCOUT(2) << "Warning: Cannot detach an object that is not a child." << std::endl;
     457            orxout(internal_warning) << "Cannot detach an object that is not a child." << endl;
    458458            return;
    459459        }
     
    799799        if (this->parent_)
    800800        {
    801             CCOUT(2) << "Warning: Cannot set the collision type of a WorldEntity with a parent." << std::endl;
     801            orxout(internal_warning) << "Cannot set the collision type of a WorldEntity with a parent." << endl;
    802802            return;
    803803        }
     
    822822            if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001))
    823823            {
    824                 CCOUT(2) << "Warning: Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << std::endl;
     824                orxout(internal_warning) << "Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << endl;
    825825                return;
    826826            }
     
    968968                this->physicalBody_->setMassProps(0.0f, btVector3(0, 0, 0));
    969969            }
    970             else if ((this->mass_ + this->childrenMass_) == 0.0f)
     970            else if (totalMass == 0.0f)
    971971            {
    972972                // Use default values to avoid very large or very small values
    973                 CCOUT(4) << "Warning: Setting the internal physical mass to 1.0 because mass_ is 0.0" << std::endl;
     973                orxout(internal_warning) << "Setting the internal physical mass to 1.0 because mass_ is 0.0" << endl;
    974974                btVector3 inertia(0, 0, 0);
    975975                this->collisionShape_->calculateLocalInertia(1.0f, inertia);
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r7184 r8858  
    132132        if (type != WorldEntity::Dynamic)
    133133        {
    134             CCOUT(1) << "Error: Cannot tell a FpsPlayer not to be dynamic! Ignoring." << std::endl;
     134            orxout(internal_warning) << "Cannot tell a FpsPlayer not to be dynamic! Ignoring." << endl;
    135135            assert(false); // Only in debug mode
    136136            return false;
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r8727 r8858  
    145145        if (type != WorldEntity::Dynamic)
    146146        {
    147             CCOUT(1) << "Error: Cannot tell a SpaceShip not to be dynamic! Ignoring." << std::endl;
     147            orxout(internal_warning) << "Cannot tell a SpaceShip not to be dynamic! Ignoring." << endl;
    148148            assert(false); // Only in debug mode
    149149            return false;
     
    507507        if (camera == 0)
    508508        {
    509             COUT(2) << "Failed to reset camera!";
     509            orxout(internal_warning) << "Failed to reset camera!" << endl;
    510510            return;
    511511        }
Note: See TracChangeset for help on using the changeset viewer.