[Orxonox-commit 4135] r8806 - in code/branches/output/src/libraries: core core/command core/input util util/output
landauf at orxonox.net
landauf at orxonox.net
Sun Jul 31 17:15:13 CEST 2011
Author: landauf
Date: 2011-07-31 17:15:13 +0200 (Sun, 31 Jul 2011)
New Revision: 8806
Modified:
code/branches/output/src/libraries/core/BaseObject.cc
code/branches/output/src/libraries/core/ClassFactory.h
code/branches/output/src/libraries/core/CommandLineParser.cc
code/branches/output/src/libraries/core/CommandLineParser.h
code/branches/output/src/libraries/core/ConfigFileManager.cc
code/branches/output/src/libraries/core/ConfigValueContainer.cc
code/branches/output/src/libraries/core/ConfigValueIncludes.h
code/branches/output/src/libraries/core/Core.cc
code/branches/output/src/libraries/core/DynLib.cc
code/branches/output/src/libraries/core/Event.cc
code/branches/output/src/libraries/core/GUIManager.cc
code/branches/output/src/libraries/core/Game.cc
code/branches/output/src/libraries/core/Game.h
code/branches/output/src/libraries/core/GraphicsManager.cc
code/branches/output/src/libraries/core/Identifier.cc
code/branches/output/src/libraries/core/Identifier.h
code/branches/output/src/libraries/core/Language.cc
code/branches/output/src/libraries/core/Language.h
code/branches/output/src/libraries/core/Loader.cc
code/branches/output/src/libraries/core/LuaState.cc
code/branches/output/src/libraries/core/MetaObjectList.cc
code/branches/output/src/libraries/core/NamespaceNode.cc
code/branches/output/src/libraries/core/OrxonoxClass.cc
code/branches/output/src/libraries/core/PathConfig.cc
code/branches/output/src/libraries/core/SubclassIdentifier.h
code/branches/output/src/libraries/core/Super.h
code/branches/output/src/libraries/core/Template.cc
code/branches/output/src/libraries/core/WeakPtr.h
code/branches/output/src/libraries/core/XMLPort.cc
code/branches/output/src/libraries/core/XMLPort.h
code/branches/output/src/libraries/core/command/CommandEvaluation.cc
code/branches/output/src/libraries/core/command/CommandExecutor.cc
code/branches/output/src/libraries/core/command/ConsoleCommand.cc
code/branches/output/src/libraries/core/command/ConsoleCommand.h
code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.cc
code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.h
code/branches/output/src/libraries/core/command/Executor.cc
code/branches/output/src/libraries/core/command/Executor.h
code/branches/output/src/libraries/core/command/Functor.h
code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
code/branches/output/src/libraries/core/command/IRC.cc
code/branches/output/src/libraries/core/command/TclBind.cc
code/branches/output/src/libraries/core/command/TclThreadManager.cc
code/branches/output/src/libraries/core/input/Button.cc
code/branches/output/src/libraries/core/input/InputDevice.h
code/branches/output/src/libraries/core/input/InputManager.cc
code/branches/output/src/libraries/core/input/JoyStick.cc
code/branches/output/src/libraries/core/input/KeyBinder.cc
code/branches/output/src/libraries/core/input/KeyBinderManager.cc
code/branches/output/src/libraries/util/Sleep.cc
code/branches/output/src/libraries/util/SubString.cc
code/branches/output/src/libraries/util/output/OutputDefinitions.h
Log:
Replaced COUT with orxout in core. Tried to set levels and contexts in a more or less useful way, but not really optimized.
Modified: code/branches/output/src/libraries/core/BaseObject.cc
===================================================================
--- code/branches/output/src/libraries/core/BaseObject.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/BaseObject.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -108,7 +108,7 @@
/** @brief Adds an object which listens to the events of this object. */
void BaseObject::registerEventListener(BaseObject* object)
{
- COUT(4) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << std::endl;
+ orxout(verbose, context::events) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << endl;
this->eventListeners_.insert(object);
}
@@ -185,7 +185,7 @@
if (temp)
this->addTemplate(temp);
else
- COUT(1) << "Error: \"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << std::endl;
+ orxout(internal_error) << "\"" << name << "\" is not a valid Template name (in class: " << this->getIdentifier()->getName() << ", name: " << this->getName() << ")." << endl;
}
/**
@@ -311,7 +311,7 @@
std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(name);
if (it != this->eventStates_.end())
{
- COUT(2) << "Warning: Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << std::endl;
+ orxout(internal_warning, context::events) << "Overwriting EventState in class " << this->getIdentifier()->getName() << '.' << endl;
delete (it->second);
}
@@ -378,15 +378,15 @@
{
this->registerEventStates();
- 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;
+ 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;
std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(event.statename_);
if (it != this->eventStates_.end())
it->second->process(event, this);
else if (!event.statename_.empty())
- COUT(2) << "Warning: \"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
+ orxout(internal_warning, context::events) << "\"" << event.statename_ << "\" is not a valid state in object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
else
- COUT(2) << "Warning: Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << std::endl;
+ orxout(internal_warning, context::events) << "Event with invalid source sent to object \"" << this->getName() << "\" of class " << this->getIdentifier()->getName() << "." << endl;
}
/**
@@ -411,7 +411,7 @@
}
}
else
- COUT(2) << "Warning: No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << std::endl;
+ orxout(internal_warning, context::events) << "No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << endl;
}
/**
@@ -431,10 +431,10 @@
if (it->second->getFunctor()->getParamCount() <= 1)
this->mainStateFunctor_ = it->second->getFunctor();
else
- COUT(2) << "Warning: Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << std::endl;
+ orxout(internal_warning, context::events) << "Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << endl;
}
else
- COUT(2) << "Warning: \"" << this->mainStateName_ << "\" is not a valid MainState." << std::endl;
+ orxout(internal_warning, context::events) << "\"" << this->mainStateName_ << "\" is not a valid MainState." << endl;
}
}
Modified: code/branches/output/src/libraries/core/ClassFactory.h
===================================================================
--- code/branches/output/src/libraries/core/ClassFactory.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/ClassFactory.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -72,7 +72,7 @@
*/
ClassFactory(const std::string& name, bool bLoadable = true)
{
- COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
+ orxout(verbose, context::identifier) << "Create entry for " << name << " in Factory." << endl;
ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);
}
Modified: code/branches/output/src/libraries/core/CommandLineParser.cc
===================================================================
--- code/branches/output/src/libraries/core/CommandLineParser.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/CommandLineParser.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -228,8 +228,8 @@
}
catch (const ArgumentException& ex)
{
- COUT(0) << "Could not parse command line: " << ex.what() << std::endl;
- COUT(0) << CommandLineParser::getUsageInformation() << std::endl;
+ orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
+ orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
throw GeneralException("");
}
}
@@ -285,9 +285,9 @@
maxNameSize = std::max(it->second->getName().size(), maxNameSize);
}
- infoStr << std::endl;
- infoStr << "Usage: orxonox [options]" << std::endl;
- infoStr << "Available options:" << std::endl;
+ infoStr << endl;
+ infoStr << "Usage: orxonox [options]" << endl;
+ infoStr << "Available options:" << endl;
for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
it != inst.cmdLineArgs_.end(); ++it)
@@ -304,7 +304,7 @@
// fill with the necessary amount of blanks
infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
infoStr << ": " << it->second->getInformation();
- infoStr << std::endl;
+ infoStr << endl;
}
return infoStr.str();
}
Modified: code/branches/output/src/libraries/core/CommandLineParser.h
===================================================================
--- code/branches/output/src/libraries/core/CommandLineParser.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/CommandLineParser.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -217,7 +217,7 @@
OrxAssert(!_getInstance().existsArgument(name),
"Cannot add a command line argument with name '" + name + "' twice.");
OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
- "Boolean command line arguments with positive default values are not supported." << std::endl
+ "Boolean command line arguments with positive default values are not supported." << endl
<< "Please use SetCommandLineSwitch and adjust your argument: " << name);
return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
Modified: code/branches/output/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/branches/output/src/libraries/core/ConfigFileManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/ConfigFileManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -273,10 +273,10 @@
try
{
boost::filesystem::copy_file(defaultFilepath, filepath);
- COUT(3) << "Copied " << this->filename_ << " from the default config folder." << std::endl;
+ orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl;
}
catch (const boost::filesystem::filesystem_error& ex)
- { COUT(1) << "Error in ConfigFile: " << ex.what() << std::endl; }
+ { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; }
}
}
}
@@ -374,7 +374,7 @@
file.close();
- COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
+ orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl;
// DO NOT save the file --> we can open supposedly read only config files
} // end file.is_open()
@@ -403,23 +403,23 @@
if (!file.is_open())
{
- COUT(1) << "Error: Couldn't open config-file \"" << filename << "\"." << std::endl;
+ orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl;
return;
}
for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
{
- file << (*it)->getFileEntry() << std::endl;
+ file << (*it)->getFileEntry() << endl;
for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
- file << (*it_entries)->getFileEntry() << std::endl;
+ file << (*it_entries)->getFileEntry() << endl;
- file << std::endl;
+ file << endl;
}
file.close();
- COUT(4) << "Saved config file \"" << filename << "\"." << std::endl;
+ orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl;
}
/**
@@ -668,7 +668,7 @@
void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
{
if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
- COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
+ orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
}
/**
@@ -681,7 +681,7 @@
void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
{
if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
- COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
+ orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
}
/**
Modified: code/branches/output/src/libraries/core/ConfigValueContainer.cc
===================================================================
--- code/branches/output/src/libraries/core/ConfigValueContainer.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/ConfigValueContainer.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -142,7 +142,7 @@
}
else
{
- COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+ orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
}
return false;
}
@@ -181,7 +181,7 @@
{
if (index > MAX_VECTOR_INDEX)
{
- COUT(1) << "Error: Index " << index << " is too large." << std::endl;
+ orxout(user_error, context::config) << "Index " << index << " is too large." << endl;
return false;
}
@@ -202,7 +202,7 @@
}
else
{
- COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+ orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
return false;
}
}
@@ -217,7 +217,7 @@
if (this->bIsVector_)
return this->set(this->valueVector_.size(), input);
- COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+ orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
return false;
}
@@ -240,10 +240,10 @@
return true;
}
- COUT(1) << "Error: Invalid vector-index." << std::endl;
+ orxout(user_error, context::config) << "Invalid vector-index." << endl;
}
- COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+ orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
return false;
}
@@ -311,11 +311,11 @@
{
if (!success)
{
- COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << std::endl;
+ orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << endl;
}
else
{
- COUT(1) << "Error: Invalid vector-index." << std::endl;
+ orxout(user_error, context::config) << "Invalid vector-index." << endl;
}
return false;
}
Modified: code/branches/output/src/libraries/core/ConfigValueIncludes.h
===================================================================
--- code/branches/output/src/libraries/core/ConfigValueIncludes.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/ConfigValueIncludes.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -86,8 +86,8 @@
Some other code:
@code
MyObject orxonoxobject;
- std::cout << "Name: " << orxonoxobject.getName() << std::endl;
- std::cout << "Version: " << orxonoxobject.getVersion() << std::endl;
+ orxout() << "Name: " << orxonoxobject.getName() << endl;
+ orxout() << "Version: " << orxonoxobject.getVersion() << endl;
@endcode
Output:
@@ -199,8 +199,8 @@
}
else
{
- COUT(2) << "Warning: Couldn't reset config-value '" << entryName << "' in class '"
- << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << std::endl;
+ orxout(user_warning, context::config) << "Couldn't reset config-value '" << entryName << "' in class '"
+ << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << endl;
}
}
}
@@ -237,8 +237,8 @@
} \
else \
{ \
- COUT(2) << "Warning: Couln't modify config-value '" << entryName << "' in class '" \
- << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << std::endl; \
+ orxout(user_warning, context::config) << "Couldn't modify config-value '" << entryName << "' in class '" \
+ << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << endl; \
}
/** Modifies a runtime configurable value by using a modifier and some arguments.
Modified: code/branches/output/src/libraries/core/Core.cc
===================================================================
--- code/branches/output/src/libraries/core/Core.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Core.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -127,7 +127,7 @@
}
catch (...)
{
- COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;
+ orxout(user_error) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << endl;
}
}
@@ -202,7 +202,7 @@
docFile.close();
}
else
- COUT(0) << "Error: Could not open file for documentation writing" << endl;
+ orxout(internal_error) << "Could not open file for documentation writing" << endl;
}
}
@@ -320,7 +320,7 @@
catch (const InitialisationFailedException&)
{
// Exit the application if the Ogre config dialog was canceled
- COUT(1) << Exception::handleMessage() << std::endl;
+ orxout(user_error) << Exception::handleMessage() << endl;
exit(EXIT_FAILURE);
}
catch (...)
@@ -331,9 +331,9 @@
// throws an exception and the graphics engine then gets destroyed
// and reloaded between throw and catch (access violation in MSVC).
// That's why we abort completely and only display the exception.
- COUT(1) << "An exception occurred during upgrade to graphics. "
- << "That is unrecoverable. The message was:" << endl
- << Exception::handleMessage() << endl;
+ orxout(user_error) << "An exception occurred during upgrade to graphics. "
+ << "That is unrecoverable. The message was:" << endl
+ << Exception::handleMessage() << endl;
abort();
}
@@ -367,9 +367,9 @@
{ this->graphicsManager_ = new GraphicsManager(false); }
catch (...)
{
- COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl
- << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl
- << "Terminating the program." << std::endl;
+ orxout(user_error) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << endl
+ << "Another exception might be being handled which may lead to undefined behaviour!" << endl
+ << "Terminating the program." << endl;
abort();
}
Modified: code/branches/output/src/libraries/core/DynLib.cc
===================================================================
--- code/branches/output/src/libraries/core/DynLib.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/DynLib.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -67,7 +67,7 @@
void DynLib::load()
{
// Log library load
- COUT(2) << "Loading module " << mName << std::endl;
+ orxout(internal_info) << "Loading module " << mName << endl;
std::string name = mName;
#ifdef ORXONOX_PLATFORM_LINUX
@@ -98,7 +98,7 @@
void DynLib::unload()
{
// Log library unload
- COUT(4) << "Unloading module " << mName << std::endl;
+ orxout(internal_info) << "Unloading module " << mName << endl;
if (DYNLIB_UNLOAD( m_hInst ))
{
Modified: code/branches/output/src/libraries/core/Event.cc
===================================================================
--- code/branches/output/src/libraries/core/Event.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Event.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -48,13 +48,13 @@
{
if (this->bProcessingEvent_)
{
- COUT(2) << "Warning: Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << std::endl;
+ orxout(internal_warning, context::events) << "Detected Event loop in section \"" << event.statename_ << "\" of object \"" << object->getName() << "\" and fired by \"" << event.originator_->getName() << '"' << endl;
return;
}
this->bProcessingEvent_ = true;
- 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;
+ 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;
// check if the originator is an instance of the requested class
if (event.originator_->isA(this->subclass_))
Modified: code/branches/output/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/output/src/libraries/core/GUIManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/GUIManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -260,7 +260,7 @@
using namespace CEGUI;
- COUT(3) << "Initialising CEGUI." << std::endl;
+ orxout(internal_info) << "Initialising CEGUI." << endl;
this->oldCEGUI_ = false;
@@ -675,7 +675,7 @@
catch (CEGUI::ScriptException& ex)
{
// Display the error and proceed. See @remarks why this can be dangerous.
- COUT(1) << ex.getMessage() << std::endl;
+ orxout(internal_error) << ex.getMessage() << endl;
return true;
}
}
Modified: code/branches/output/src/libraries/core/Game.cc
===================================================================
--- code/branches/output/src/libraries/core/Game.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Game.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -59,10 +59,10 @@
{ Game::getInstance().stop(); }
SetConsoleCommand("exit", &stop_game);
static void printFPS()
- { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
+ { orxout(message) << Game::getInstance().getAvgFPS() << endl; }
SetConsoleCommand("Stats", "printFPS", &printFPS);
static void printTickTime()
- { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }
+ { orxout(message) << Game::getInstance().getAvgTickTime() << endl; }
SetConsoleCommand("Stats", "printTickTime", &printTickTime);
std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s;
@@ -162,7 +162,7 @@
void Game::run()
{
if (this->requestedStateNodes_.empty())
- COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl;
+ orxout(user_error) << "Starting game without requesting GameState. This automatically terminates the program." << endl;
// START GAME
// first delta time should be about 0 seconds
@@ -188,8 +188,8 @@
{ this->core_->preUpdate(*this->gameClock_); }
catch (...)
{
- COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl;
- COUT(0) << "This should really never happen! Closing the program." << std::endl;
+ orxout(user_error) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << endl;
+ orxout(user_error) << "This should really never happen! Closing the program." << endl;
this->stop();
break;
}
@@ -202,8 +202,8 @@
{ this->core_->postUpdate(*this->gameClock_); }
catch (...)
{
- COUT(0) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << std::endl;
- COUT(0) << "This should really never happen! Closing the program." << std::endl;
+ orxout(user_error) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << endl;
+ orxout(user_error) << "This should really never happen! Closing the program." << endl;
this->stop();
break;
}
@@ -240,10 +240,10 @@
}
catch (...)
{
- COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl;
+ orxout(user_error) << "Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << endl;
// All scheduled operations have now been rendered inert --> flush them and issue a warning
if (this->requestedStateNodes_.size() > 1)
- COUT(4) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << std::endl;
+ orxout(internal_info) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << endl;
this->requestedStateNodes_.clear();
break;
}
@@ -271,9 +271,9 @@
}
catch (...)
{
- COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl;
- COUT(1) << "This should really never happen!" << std::endl;
- COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl;
+ orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl;
+ orxout(user_error) << "This should really never happen!" << endl;
+ orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
while (current->name_ != (*it)->getName() && current)
current = current->parent_.lock();
@@ -354,13 +354,13 @@
{
if (!this->checkState(name))
{
- COUT(2) << "Warning: GameState named '" << name << "' doesn't exist!" << std::endl;
+ orxout(user_warning) << "GameState named '" << name << "' doesn't exist!" << endl;
return;
}
if (this->bChangingState_)
{
- COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;
+ orxout(user_warning) << "Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << endl;
return;
}
@@ -371,7 +371,7 @@
lastRequestedNode = this->requestedStateNodes_.back();
if (name == lastRequestedNode->name_)
{
- COUT(2) << "Warning: Requesting the currently active state! Ignoring." << std::endl;
+ orxout(user_warning) << "Requesting the currently active state! Ignoring." << endl;
return;
}
@@ -402,7 +402,7 @@
}
if (requestedNodes.empty())
- COUT(1) << "Error: Requested GameState transition is not allowed. Ignoring." << std::endl;
+ orxout(user_error) << "Requested GameState transition is not allowed. Ignoring." << endl;
else
this->requestedStateNodes_.insert(requestedStateNodes_.end(), requestedNodes.begin(), requestedNodes.end());
}
@@ -424,7 +424,7 @@
if (lastRequestedNode != this->rootStateNode_)
this->requestState(lastRequestedNode->parent_.lock()->name_);
else
- COUT(2) << "Warning: Can't pop the internal dummy root GameState" << std::endl;
+ orxout(internal_warning) << "Can't pop the internal dummy root GameState" << endl;
}
shared_ptr<GameState> Game::getState(const std::string& name)
@@ -436,9 +436,9 @@
{
std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name);
if (it != gameStateDeclarations_s.end())
- COUT(1) << "Error: GameState '" << name << "' has not yet been loaded." << std::endl;
+ orxout(internal_error) << "GameState '" << name << "' has not yet been loaded." << endl;
else
- COUT(1) << "Error: Could not find GameState '" << name << "'." << std::endl;
+ orxout(internal_error) << "Could not find GameState '" << name << "'." << endl;
return shared_ptr<GameState>();
}
}
@@ -588,8 +588,8 @@
}
catch (...)
{
- COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl;
- COUT(2) << " There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl;
+ orxout(internal_warning) << "Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << endl;
+ orxout(internal_warning) << "There might be potential resource leaks involved! To avoid this, improve exception-safety." << endl;
}
// Check if graphics is still required
if (!bAbort_)
Modified: code/branches/output/src/libraries/core/Game.h
===================================================================
--- code/branches/output/src/libraries/core/Game.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Game.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -214,8 +214,8 @@
}
else
{
- COUT(0) << "Error: Cannot declare two GameStates with the same name." << std::endl;
- COUT(0) << " Ignoring second one ('" << stateName << "')." << std::endl;
+ orxout(internal_warning) << "Cannot declare two GameStates with the same name." << endl;
+ orxout(internal_warning) << "Ignoring second one ('" << stateName << "')." << endl;
}
// Create a factory to delay GameState creation
Modified: code/branches/output/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/output/src/libraries/core/GraphicsManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/GraphicsManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -190,16 +190,16 @@
*/
void GraphicsManager::loadOgreRoot()
{
- COUT(3) << "Setting up Ogre..." << std::endl;
+ orxout(internal_info) << "Setting up Ogre..." << endl;
if (ogreConfigFile_.empty())
{
- COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
+ orxout(internal_warning) << "Ogre config file set to \"\". Defaulting to config.cfg" << endl;
ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
}
if (ogreLogFile_.empty())
{
- COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
+ orxout(internal_warning) << "Ogre log file set to \"\". Defaulting to ogre.log" << endl;
ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
}
@@ -209,17 +209,17 @@
// create a new logManager
// Ogre::Root will detect that we've already created a Log
ogreLogger_ = new Ogre::LogManager();
- COUT(4) << "Ogre LogManager created" << std::endl;
+ orxout(internal_info) << "Ogre LogManager created" << endl;
// create our own log that we can listen to
Ogre::Log *myLog;
myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
- COUT(4) << "Ogre Log created" << std::endl;
+ orxout(internal_info) << "Ogre Log created" << endl;
myLog->setLogDetail(Ogre::LL_BOREME);
myLog->addListener(this);
- COUT(4) << "Creating Ogre Root..." << std::endl;
+ orxout(internal_info) << "Creating Ogre Root..." << endl;
// check for config file existence because Ogre displays (caught) exceptions if not
if (!boost::filesystem::exists(ogreConfigFilepath))
@@ -233,7 +233,7 @@
// Leave plugins file empty. We're going to do that part manually later
ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
- COUT(3) << "Ogre set up done." << std::endl;
+ orxout(internal_info) << "Ogre set up done." << endl;
}
void GraphicsManager::loadOgrePlugins()
@@ -270,11 +270,11 @@
void GraphicsManager::loadRenderer()
{
- CCOUT(4) << "Configuring Renderer" << std::endl;
+ orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl;
bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp();
if (updatedConfig)
- COUT(2) << "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << std::endl;
+ orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl;
if (!ogreRoot_->restoreConfig() || updatedConfig)
{
@@ -284,7 +284,7 @@
Core::getInstance().updateOgreConfigTimestamp();
}
- CCOUT(4) << "Creating render window" << std::endl;
+ orxout(internal_info) << "Creating render window" << endl;
this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox");
// Propagate the size of the new winodw
@@ -310,7 +310,7 @@
void GraphicsManager::loadDebugOverlay()
{
// Load debug overlay to show info about fps and tick time
- COUT(4) << "Loading Debug Overlay..." << std::endl;
+ orxout(internal_info) << "Loading Debug Overlay..." << endl;
debugOverlay_.reset(new XMLFile("debug.oxo"));
Loader::open(debugOverlay_.get());
}
Modified: code/branches/output/src/libraries/core/Identifier.cc
===================================================================
--- code/branches/output/src/libraries/core/Identifier.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Identifier.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -129,7 +129,7 @@
if (!this->bCreatedOneObject_ && Identifier::isCreatingHierarchy())
{
// If no: We have to store the information and initialize the Identifier
- COUT(4) << "*** ClassIdentifier: Register Class in " << this->getName() << "-Singleton -> Initialize Singleton." << std::endl;
+ orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;
if (bRootClass)
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.
else
@@ -143,7 +143,7 @@
*/
void Identifier::initialize(std::set<const Identifier*>* parents)
{
- COUT(4) << "*** Identifier: Initialize " << this->name_ << "-Singleton." << std::endl;
+ orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;
this->bCreatedOneObject_ = true;
if (parents)
@@ -190,7 +190,7 @@
*/
void Identifier::createClassHierarchy()
{
- COUT(3) << "*** Identifier: Create class-hierarchy" << std::endl;
+ orxout(internal_status) << "Create class-hierarchy" << endl;
Identifier::startCreatingHierarchy();
for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMap().begin(); it != Identifier::getStringIdentifierMap().end(); ++it)
{
@@ -202,7 +202,7 @@
}
}
Identifier::stopCreatingHierarchy();
- COUT(3) << "*** Identifier: Finished class-hierarchy creation" << std::endl;
+ orxout(internal_status) << "Finished class-hierarchy creation" << endl;
}
/**
@@ -241,9 +241,9 @@
}
else
{
- COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
- COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
- COUT(1) << "Aborting..." << std::endl;
+ orxout(user_error) << "An error occurred in Identifier.cc:" << endl;
+ orxout(user_error) << "Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << endl;
+ orxout(user_error) << "Aborting..." << endl;
abort();
return 0;
}
@@ -403,7 +403,7 @@
std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);
if (it != this->configValues_.end())
{
- COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << std::endl;
+ orxout(internal_warning) << "Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << endl;
delete (it->second);
}
@@ -449,7 +449,7 @@
std::map<std::string, XMLPortParamContainer*>::const_iterator it = this->xmlportParamContainers_.find(paramname);
if (it != this->xmlportParamContainers_.end())
{
- COUT(2) << "Warning: Overwriting XMLPortParamContainer in class " << this->getName() << '.' << std::endl;
+ orxout(internal_warning) << "Overwriting XMLPortParamContainer in class " << this->getName() << '.' << endl;
delete (it->second);
}
@@ -480,7 +480,7 @@
std::map<std::string, XMLPortObjectContainer*>::const_iterator it = this->xmlportObjectContainers_.find(sectionname);
if (it != this->xmlportObjectContainers_.end())
{
- COUT(2) << "Warning: Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << std::endl;
+ orxout(internal_warning) << "Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << endl;
delete (it->second);
}
Modified: code/branches/output/src/libraries/core/Identifier.h
===================================================================
--- code/branches/output/src/libraries/core/Identifier.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Identifier.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -63,7 +63,7 @@
int count;
for (Iterator<BaseObject> it = objects.begin(); it != objects.end(); ++it) // iterate through the objects
++count;
- COUT(0) << count << std::endl; // prints "2" because we created 2 instances of MyClass so far
+ orxout() << count << endl; // prints "2" because we created 2 instances of MyClass so far
// test the class hierarchy
@@ -404,11 +404,11 @@
if (ClassIdentifier<T>::classIdentifier_s == proposal)
{
- COUT(4) << "*** Identifier: Requested Identifier for " << name << " was not yet existing and got created." << std::endl;
+ orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was not yet existing and got created." << endl;
}
else
{
- COUT(4) << "*** Identifier: Requested Identifier for " << name << " was already existing and got assigned." << std::endl;
+ orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was already existing and got assigned." << endl;
}
}
@@ -422,9 +422,9 @@
bool ClassIdentifier<T>::initialiseObject(T* object, const std::string& className, bool bRootClass)
{
if (bRootClass)
- COUT(5) << "*** Register Root-Object: " << className << std::endl;
+ orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl;
else
- COUT(5) << "*** Register Object: " << className << std::endl;
+ orxout(verbose, context::object_list) << "Register Object: " << className << endl;
object->identifier_ = this;
if (Identifier::isCreatingHierarchy())
@@ -443,7 +443,7 @@
}
else
{
- COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
+ orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
// Add pointer of type T to the map in the OrxonoxClass instance that enables "dynamic_casts"
Modified: code/branches/output/src/libraries/core/Language.cc
===================================================================
--- code/branches/output/src/libraries/core/Language.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Language.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -130,7 +130,7 @@
return newEntry;
}
- COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << std::endl;
+ orxout(internal_warning, context::language) << "Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << endl;
return it->second;
}
@@ -141,7 +141,7 @@
*/
void Language::addEntry(const LanguageEntryLabel& label, const std::string& entry)
{
- COUT(5) << "Language: Called addEntry with\n label: " << label << "\n entry: " << entry << std::endl;
+ orxout(verbose, context::language) << "Called addEntry with" << '\n' << "label: " << label << '\n' << "entry: " << entry << endl;
std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(label);
if (it == this->languageEntries_.end())
{
@@ -178,7 +178,7 @@
else if (bError)
{
// Uh, oh, an undefined entry was requested: return the default string
- COUT(2) << "Warning: Language entry \"" << label << "\" not found!" << std::endl;
+ orxout(internal_warning, context::language) << "Language entry \"" << label << "\" not found!" << endl;
return this->defaultLocalisation_;
}
else
@@ -200,7 +200,7 @@
*/
void Language::readDefaultLanguageFile()
{
- COUT(4) << "Read default language file." << std::endl;
+ orxout(internal_status, context::language) << "Read default language file." << endl;
const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
@@ -215,8 +215,8 @@
if (!file.is_open())
{
- COUT(1) << "An error occurred in Language.cc:" << std::endl;
- COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
+ orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+ orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << endl;
return;
}
@@ -236,7 +236,7 @@
this->createEntry(lineString.substr(0, pos), lineString.substr(pos + 1));
else
{
- COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << std::endl;
+ orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << endl;
}
}
}
@@ -249,7 +249,7 @@
*/
void Language::readTranslatedLanguageFile()
{
- COUT(4) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << std::endl;
+ orxout(internal_status, context::language) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << endl;
const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getLanguage());
@@ -259,10 +259,10 @@
if (!file.is_open())
{
- COUT(1) << "An error occurred in Language.cc:" << std::endl;
- COUT(1) << "Error: Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << std::endl;
+ orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+ orxout(internal_error, context::language) << "Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << endl;
Core::getInstance().resetLanguage();
- COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << '.' << std::endl;
+ orxout(internal_status, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl;
return;
}
@@ -290,7 +290,7 @@
}
else
{
- COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << std::endl;
+ orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << endl;
}
}
}
@@ -303,7 +303,7 @@
*/
void Language::writeDefaultLanguageFile() const
{
- COUT(4) << "Language: Write default language file." << std::endl;
+ orxout(internal_status, context::language) << "Write default language file." << endl;
const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
@@ -313,15 +313,15 @@
if (!file.is_open())
{
- COUT(1) << "An error occurred in Language.cc:" << std::endl;
- COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
+ orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl;
+ orxout(internal_error, context::language) << "Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << endl;
return;
}
// Iterate through the list an write the lines into the file
for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
{
- file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl;
+ file << it->second->getLabel() << '=' << it->second->getDefault() << endl;
}
file.close();
Modified: code/branches/output/src/libraries/core/Language.h
===================================================================
--- code/branches/output/src/libraries/core/Language.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Language.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -50,14 +50,14 @@
- Get the localisation of the entry in the configured language:
@code
- std::cout << Language::getInstance()->getLocalisation("name of the entry") << std::endl;
+ orxout() << Language::getInstance()->getLocalisation("name of the entry") << endl;
@endcode
Example:
@code
int age = 20;
AddLanguageEntry("user_age", "Age");
- std::cout << GetLocalisation("user_age") << ": " << age << std::endl;
+ orxout() << GetLocalisation("user_age") << ": " << age << endl;
@endcode
Resulting output:
Modified: code/branches/output/src/libraries/core/Loader.cc
===================================================================
--- code/branches/output/src/libraries/core/Loader.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Loader.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -169,7 +169,7 @@
shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename());
if (info == NULL)
{
- COUT(1) << "Error: Could not find XML file '" << file->getFilename() << "'." << std::endl;
+ orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl;
return false;
}
xmlInput = Resource::open(file->getFilename())->getAsString();
@@ -188,13 +188,13 @@
{
if(verbose)
{
- COUT(0) << "Start loading " << file->getFilename() << "..." << std::endl;
- COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
+ orxout(user_status, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
+ orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s << endl;
}
else
{
- COUT(4) << "Start loading " << file->getFilename() << "..." << std::endl;
- COUT(4) << "Mask: " << Loader::currentMask_s << std::endl;
+ orxout(verbose, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
+ orxout(verbose_more, context::loader) << "Mask: " << Loader::currentMask_s << endl;
}
ticpp::Document xmlfile(file->getFilename());
@@ -207,7 +207,7 @@
for (ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++)
rootElement.InsertEndChild(*child);
- COUT(4) << " creating root-namespace..." << std::endl;
+ orxout(verbose, context::loader) << " creating root-namespace..." << endl;
Namespace* rootNamespace = new Namespace(0);
rootNamespace->setLoaderIndentation(" ");
rootNamespace->setFile(file);
@@ -216,36 +216,36 @@
rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
if(verbose)
- COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
+ orxout(user_status, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
else
- COUT(4) << "Finished loading " << file->getFilename() << '.' << std::endl;
+ orxout(verbose, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
- COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString(" ") << std::endl;
+ orxout(verbose, context::loader) << "Namespace-tree:" << '\n' << rootNamespace->toString(" ") << endl;
return true;
}
catch (ticpp::Exception& ex)
{
- COUT(1) << std::endl;
- COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
- COUT(1) << ex.what() << std::endl;
- COUT(1) << "Loading aborted." << std::endl;
+ orxout(user_error, context::loader) << endl;
+ orxout(user_error, context::loader) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+ orxout(user_error, context::loader) << ex.what() << endl;
+ orxout(user_error, context::loader) << "Loading aborted." << endl;
return false;
}
catch (Exception& ex)
{
- COUT(1) << std::endl;
- COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
- COUT(1) << ex.what() << std::endl;
- COUT(1) << "Loading aborted." << std::endl;
+ orxout(user_error, context::loader) << endl;
+ orxout(user_error, context::loader) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+ orxout(user_error, context::loader) << ex.what() << endl;
+ orxout(user_error, context::loader) << "Loading aborted." << endl;
return false;
}
catch (...)
{
- COUT(1) << std::endl;
- COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
- COUT(1) << Exception::handleMessage() << std::endl;
- COUT(1) << "Loading aborted." << std::endl;
+ orxout(user_error, context::loader) << endl;
+ orxout(user_error, context::loader) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
+ orxout(user_error, context::loader) << Exception::handleMessage() << endl;
+ orxout(user_error, context::loader) << "Loading aborted." << endl;
return false;
}
}
@@ -336,7 +336,7 @@
}
if (!expectedValue)
{
- COUT(2) << "Warning: Error in level file" << std::endl;
+ orxout(internal_error, context::loader) << "Error in level file" << endl;
// TODO: error handling
return false;
}
Modified: code/branches/output/src/libraries/core/LuaState.cc
===================================================================
--- code/branches/output/src/libraries/core/LuaState.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/LuaState.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -96,7 +96,7 @@
return this->includeString(Resource::open(sourceInfo)->getAsString(), sourceInfo);
else
{
- COUT(2) << "LuaState: Cannot include file '" << filename << "' (not found)." << std::endl;
+ orxout(internal_warning, context::lua) << "LuaState: Cannot include file '" << filename << "' (not found)." << endl;
return false;
}
}
@@ -136,7 +136,7 @@
return this->doString(Resource::open(sourceInfo)->getAsString(), sourceInfo);
else
{
- COUT(2) << "LuaState: Cannot do file '" << filename << "' (not found)." << std::endl;
+ orxout(internal_warning, context::lua) << "LuaState: Cannot do file '" << filename << "' (not found)." << endl;
return false;
}
}
@@ -176,10 +176,10 @@
switch (error)
{
case LUA_ERRSYNTAX: // Syntax error
- COUT(1) << "Lua syntax error: " << lua_tostring(luaState_, -1) << std::endl;
+ orxout(internal_error, context::lua) << "Lua syntax error: " << lua_tostring(luaState_, -1) << endl;
break;
case LUA_ERRMEM: // Memory allocation error
- COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
+ orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
break;
}
@@ -200,14 +200,14 @@
{
std::string errorString = lua_tostring(this->luaState_, -1);
if (errorString.find("Error propagation") == std::string::npos)
- COUT(1) << "Lua runtime error: " << errorString << std::endl;
+ orxout(internal_error, context::lua) << "Lua runtime error: " << errorString << endl;
}
break;
case LUA_ERRERR: // Error in the error handler
- COUT(1) << "Lua error in error handler. No message available." << std::endl;
+ orxout(internal_error, context::lua) << "Lua error in error handler. No message available." << endl;
break;
case LUA_ERRMEM: // Memory allocation error
- COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
+ orxout(internal_error, context::lua) << "Lua memory allocation error: Consult your dentist immediately!" << endl;
break;
}
}
@@ -289,7 +289,7 @@
{
if (it->first == name || it->second == function)
{
- COUT(2) << "Warning: Trying to add a Tolua interface with the same name or function." << std::endl;
+ orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl;
return true;
}
}
@@ -308,7 +308,7 @@
ToluaInterfaceMap::iterator it = getToluaInterfaces().find(name);
if (it == getToluaInterfaces().end())
{
- COUT(2) << "Warning: Cannot remove Tolua interface '" << name << "': Not found" << std::endl;
+ orxout(internal_warning, context::lua) << "Cannot remove Tolua interface '" << name << "': Not found" << endl;
return true;
}
Modified: code/branches/output/src/libraries/core/MetaObjectList.cc
===================================================================
--- code/branches/output/src/libraries/core/MetaObjectList.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/MetaObjectList.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -47,7 +47,7 @@
*/
MetaObjectListElement::~MetaObjectListElement()
{
- COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl;
+ orxout(verbose, context::object_list) << "Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << endl;
this->list_->notifyIterators(this->element_->objectBase_);
if (this->element_->next_)
Modified: code/branches/output/src/libraries/core/NamespaceNode.cc
===================================================================
--- code/branches/output/src/libraries/core/NamespaceNode.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/NamespaceNode.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -69,12 +69,12 @@
{
if (this->bRoot_)
{
- COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << std::endl;
+ orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << endl;
nodes = this->getNodeRelative(secondPart);
}
else if (!this->parent_)
{
- COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << std::endl;
+ orxout(internal_warning) << "Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << endl;
nodes = this->getNodeRelative(secondPart);
}
else
@@ -90,7 +90,7 @@
if (it->second->isHidden())
{
- COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl;
+ orxout(internal_warning) << "Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << endl;
nodes.insert(this);
}
else
@@ -114,7 +114,7 @@
if (!bFoundMatchingNamespace)
{
- 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;
+ 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;
nodes = this->getNodeRelative(secondPart);
}
}
Modified: code/branches/output/src/libraries/core/OrxonoxClass.cc
===================================================================
--- code/branches/output/src/libraries/core/OrxonoxClass.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/OrxonoxClass.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -59,7 +59,7 @@
OrxonoxClass::~OrxonoxClass()
{
// if (!this->requestedDestruction_)
-// COUT(2) << "Warning: Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << std::endl;
+// orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;
assert(this->referenceCount_ <= 0);
Modified: code/branches/output/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/output/src/libraries/core/PathConfig.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/PathConfig.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -136,7 +136,7 @@
if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
{
- COUT(1) << "Running from the build tree." << std::endl;
+ orxout(internal_info) << "Running from the build tree." << endl;
PathConfig::bBuildDirectoryRun_ = true;
modulePath_ = specialConfig::moduleDevDirectory;
}
@@ -246,7 +246,7 @@
}
if (bf::create_directories(it->first)) // function may not return true at all (bug?)
{
- COUT(4) << "Created " << it->second << " directory" << std::endl;
+ orxout(internal_info) << "Created " << it->second << " directory" << endl;
}
}
}
Modified: code/branches/output/src/libraries/core/SubclassIdentifier.h
===================================================================
--- code/branches/output/src/libraries/core/SubclassIdentifier.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/SubclassIdentifier.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -118,15 +118,15 @@
{
if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
{
- COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
+ orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
if (identifier)
{
- COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
- COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
+ orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+ orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
}
else
{
- COUT(1) << "Error: Can't assign NULL identifier" << std::endl;
+ orxout(internal_error) << "Can't assign NULL identifier" << endl;
}
}
else
@@ -176,17 +176,17 @@
// Something went terribly wrong
if (this->identifier_)
{
- COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
- COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
- COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
+ orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+ orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+ orxout(user_error) << "Couldn't fabricate a new Object." << endl;
}
else
{
- COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
- COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
+ orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+ orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
}
- COUT(1) << "Aborting..." << std::endl;
+ orxout(user_error) << "Aborting..." << endl;
abort();
return 0;
}
Modified: code/branches/output/src/libraries/core/Super.h
===================================================================
--- code/branches/output/src/libraries/core/Super.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Super.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -113,7 +113,7 @@
\
if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
{ \
- COUT(5) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl; \
+ orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
} \
} \
@@ -183,7 +183,7 @@
if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
{
// Add the SuperFunctionCaller
- COUT(5) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
+ orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
}
}
Modified: code/branches/output/src/libraries/core/Template.cc
===================================================================
--- code/branches/output/src/libraries/core/Template.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/Template.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -87,7 +87,7 @@
it = Template::getTemplateMap().find(this->getName());
if (it != Template::getTemplateMap().end())
- COUT(2) << "Warning: Template with name \"" << this->getName() << "\" already exists." << std::endl;
+ orxout(internal_warning, context::templates) << "Template with name \"" << this->getName() << "\" already exists." << endl;
else
Template::getTemplateMap()[this->getName()] = this;
}
@@ -116,12 +116,12 @@
}
else
{
- COUT(2) << "Warning: Linking from " << this->getName() << " to " << this->link_ << " leads to an infinite loop. Returning own element." << std::endl;
+ orxout(internal_warning, context::templates) << "Linking from \"" << this->getName() << "\" to \"" << this->link_ << "\" leads to an infinite loop. Returning own element." << endl;
}
}
else
{
- COUT(2) << "Warning: " << this->link_ << " is not an existing Template name. Returning own element." << std::endl;
+ orxout(internal_warning, context::templates) << '"' << this->link_ << "\" is not an existing Template name. Returning own element." << endl;
}
}
@@ -141,12 +141,12 @@
{
if (!object->isA(this->baseclassIdentifier_))
{
- 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;
+ 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;
return;
}
}
- COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl;
+ orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
@@ -169,7 +169,7 @@
return it->second;
else
{
- COUT(2) << "Warning: Template with name " << name << " doesn't exist." << std::endl;
+ orxout(internal_warning, context::templates) << "Template with name " << name << " doesn't exist." << endl;
return 0;
}
}
Modified: code/branches/output/src/libraries/core/WeakPtr.h
===================================================================
--- code/branches/output/src/libraries/core/WeakPtr.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/WeakPtr.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -64,7 +64,7 @@
@code
void myCallback() // definition of the callback function
{
- COUT(0) << "Object destroyed" << std::endl;
+ orxout() << "Object destroyed" << endl;
}
MyClass* object = new MyClass(); // create an instance of MyClass
Modified: code/branches/output/src/libraries/core/XMLPort.cc
===================================================================
--- code/branches/output/src/libraries/core/XMLPort.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/XMLPort.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -63,7 +63,7 @@
{
if (!this->sectionname_.empty())
{
- COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a valid classname." << std::endl;
+ orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a valid classname." << endl;
}
else
{
@@ -73,12 +73,12 @@
}
if (!identifier->isA(objectIdentifier_))
{
- COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << std::endl;
+ orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << endl;
continue;
}
if (!identifier->isLoadable())
{
- COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl;
+ orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not loadable." << endl;
continue;
}
if (!this->identifierIsIncludedInLoaderMask(identifier))
@@ -86,7 +86,7 @@
try
{
- COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
+ orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
BaseObject* newObject = identifier->fabricate(object);
newObject->setLoaderIndentation(object->getLoaderIndentation() + " ");
@@ -94,39 +94,37 @@
if (this->bLoadBefore_)
{
newObject->XMLPort(*child, XMLPort::LoadObject);
- COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
+ orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
}
else
{
- COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
+ orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
}
- COUT(5) << object->getLoaderIndentation();
-
this->callLoadExecutor(object, newObject);
if (!this->bLoadBefore_)
newObject->XMLPort(*child, XMLPort::LoadObject);
- COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
+ orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << endl;
}
catch (AbortLoadingException& ex)
{
- COUT(1) << "An error occurred while loading object, abort loading..." << std::endl;
+ orxout(internal_error, context::xml) << "An error occurred while loading object, abort loading..." << endl;
throw ex;
}
catch (...)
{
- COUT(1) << "An error occurred while loading object:" << std::endl;
- COUT(1) << Exception::handleMessage() << std::endl;
+ orxout(internal_error, context::xml) << "An error occurred while loading object:" << endl;
+ orxout(internal_error, context::xml) << Exception::handleMessage() << endl;
}
}
}
catch (ticpp::Exception& ex)
{
- COUT(1) << std::endl;
- 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;
- COUT(1) << ex.what() << std::endl;
+ orxout(internal_error, context::xml) << endl;
+ 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;
+ orxout(internal_error, context::xml) << ex.what() << endl;
}
}
else if (mode == XMLPort::SaveObject)
Modified: code/branches/output/src/libraries/core/XMLPort.h
===================================================================
--- code/branches/output/src/libraries/core/XMLPort.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/XMLPort.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -414,7 +414,7 @@
// Unfortunately this does not seem to work with the Executor parser yet.
if ((!attributeValue.empty()) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
{
- COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
+ orxout(verbose_more, context::xml) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << endl;
int error;
this->loadexecutor_->parse(object, attributeValue, &error, ",");
if (!error || (mode == XMLPort::ExpandObject))
@@ -429,9 +429,9 @@
}
catch (ticpp::Exception& ex)
{
- COUT(1) << std::endl;
- 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;
- COUT(1) << ex.what() << std::endl;
+ orxout(internal_error, context::xml) << endl;
+ 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;
+ orxout(internal_error, context::xml) << ex.what() << endl;
}
}
else if (mode == XMLPort::SaveObject)
Modified: code/branches/output/src/libraries/core/command/CommandEvaluation.cc
===================================================================
--- code/branches/output/src/libraries/core/command/CommandEvaluation.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/CommandEvaluation.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -150,7 +150,7 @@
// check if the argument evaluation succeded
if (this->bEvaluatedArguments_)
{
- 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;
+ 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;
// pass as many arguments to the executor as were evaluated (thus the executor can still use additional default values)
switch (this->numberOfEvaluatedArguments_)
@@ -185,7 +185,7 @@
if (!this->execCommand_)
{
if (bPrintError)
- COUT(1) << "Error: Can't evaluate arguments, no console command assigned." << std::endl;
+ orxout(internal_error, context::commands) << "Can't evaluate arguments, no console command assigned." << endl;
return CommandExecutor::Error;
}
@@ -199,7 +199,7 @@
if (!error)
this->bEvaluatedArguments_ = true;
else if (bPrintError)
- COUT(1) << "Error: Can't evaluate arguments, not enough arguments given." << std::endl;
+ orxout(internal_error, context::commands) << "Can't evaluate arguments, not enough arguments given." << endl;
return error;
}
Modified: code/branches/output/src/libraries/core/command/CommandExecutor.cc
===================================================================
--- code/branches/output/src/libraries/core/command/CommandExecutor.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/CommandExecutor.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -260,7 +260,7 @@
// check if the alias already exists - print an error and return if it does
if ((tokens.size() == 1 && ConsoleCommand::getCommand(tokens[0])) || (tokens.size() == 2 && ConsoleCommand::getCommand(tokens[0], tokens[1])))
{
- COUT(1) << "Error: A command with name \"" << alias << "\" already exists." << std::endl;
+ orxout(user_error) << "A command with name \"" << alias << "\" already exists." << endl;
return;
}
@@ -270,9 +270,9 @@
else if (tokens.size() == 2)
createConsoleCommand(tokens[0], tokens[1], executor);
else
- COUT(1) << "Error: \"" << alias << "\" is not a valid alias name (must have one or two words)." << std::endl;
+ orxout(user_error) << "\"" << alias << "\" is not a valid alias name (must have one or two words)." << endl;
}
else
- COUT(1) << "Error: \"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << std::endl;
+ orxout(user_error) << "\"" << command << "\" is not a valid command (did you mean \"" << evaluation.getCommandSuggestion() << "\"?)." << endl;
}
}
Modified: code/branches/output/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/branches/output/src/libraries/core/command/ConsoleCommand.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/ConsoleCommand.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -171,7 +171,7 @@
{
if (!this->executor_->defaultValueSet(i))
{
- COUT(2) << "Default value " << i << " is missing" << std::endl;
+ orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
return false;
}
}
@@ -201,7 +201,7 @@
{
if (!executor->defaultValueSet(i))
{
- COUT(2) << "Default value " << i << " is missing" << std::endl;
+ orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
return false;
}
}
@@ -228,7 +228,7 @@
}
else
{
- COUT(1) << "Error: Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
return false;
}
}
@@ -255,7 +255,7 @@
}
else
{
- COUT(1) << "Error: Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
return false;
}
}
@@ -306,7 +306,7 @@
if (this->executor_)
this->pushFunction(new Executor(*this->executor_.get()));
else
- COUT(1) << "Error: Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << endl;
}
/**
@@ -366,10 +366,10 @@
return true;
}
else if (object)
- COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << endl;
}
else if (object)
- COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << endl;
return false;
}
@@ -417,7 +417,7 @@
if (this->executor_)
this->executor_->setDefaultValues(arg1);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -430,7 +430,7 @@
if (this->executor_)
this->executor_->setDefaultValues(arg1, arg2);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -443,7 +443,7 @@
if (this->executor_)
this->executor_->setDefaultValues(arg1, arg2, arg3);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -456,7 +456,7 @@
if (this->executor_)
this->executor_->setDefaultValues(arg1, arg2, arg3, arg4);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -469,7 +469,7 @@
if (this->executor_)
this->executor_->setDefaultValues(arg1, arg2, arg3, arg4, arg5);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -484,7 +484,7 @@
if (this->executor_)
this->executor_->setDefaultValue(index, arg);
else
- COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
+ orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
return *this;
}
@@ -499,7 +499,7 @@
if (index < 5)
this->argumentCompleter_[index] = completer;
else
- COUT(2) << "Warning: Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << std::endl;
+ orxout(internal_warning, context::commands) << "Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << endl;
return *this;
}
@@ -610,9 +610,9 @@
if (bPrintError)
{
if (group == "")
- COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
else
- COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
}
return 0;
}
@@ -643,9 +643,9 @@
if (bPrintError)
{
if (group == "")
- COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
else
- COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
+ orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
}
return 0;
}
@@ -680,9 +680,9 @@
if (ConsoleCommand::getCommand(group, name) != 0)
{
if (group == "")
- COUT(2) << "Warning: A console command with shortcut \"" << name << "\" already exists." << std::endl;
+ orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
else
- COUT(2) << "Warning: A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << std::endl;
+ orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
}
else
{
Modified: code/branches/output/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/branches/output/src/libraries/core/command/ConsoleCommand.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/ConsoleCommand.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -52,7 +52,7 @@
@code
void myCoutFunction(const std::string& text) // Define a static function
{
- COUT(0) << "Text: " << text << std::endl; // Print the text to the console
+ orxout() << "Text: " << text << endl; // Print the text to the console
}
SetConsoleCommand("cout", &myCoutFunction); // Register the function as command with name "cout"
@@ -124,7 +124,7 @@
@code
void myOtherCoutFunction(const std::string& text) // Define a new static function
{
- COUT(0) << "Uppercase: " << getUppercase(text) << std::endl; // Print the text in uppercase to the console
+ orxout() << "Uppercase: " << getUppercase(text) << endl; // Print the text in uppercase to the console
}
{
Modified: code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.cc
===================================================================
--- code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -47,7 +47,6 @@
{
// SetConsoleCommand("source", source).argumentCompleter(0, autocompletion::files()); // disabled because we use the implementation in Tcl
SetConsoleCommand("echo", echo);
-// SetConsoleCommand("puts", puts); // disabled because we use the implementation in Tcl
// SetConsoleCommand("read", read).argumentCompleter(0, autocompletion::files()); // disabled because we use the implementation in Tcl
// SetConsoleCommand("append", append).argumentCompleter(0, autocompletion::files()); // disabled because we use the implementation in Tcl
@@ -65,7 +64,7 @@
std::set<std::string>::const_iterator it = executingFiles.find(filename);
if (it != executingFiles.end())
{
- COUT(1) << "Error: Recurring source command in \"" << filename << "\". Stopped execution." << std::endl;
+ orxout(user_error) << "Recurring source command in \"" << filename << "\". Stopped execution." << endl;
return;
}
@@ -75,7 +74,7 @@
if (!file.is_open())
{
- COUT(1) << "Error: Couldn't open file \"" << filename << "\"." << std::endl;
+ orxout(user_error) << "Couldn't open file \"" << filename << "\"." << endl;
return;
}
@@ -102,21 +101,6 @@
}
/**
- @brief Writes text to the console, depending on the first argument with or without a line-break after it.
- */
- void puts(bool newline, const std::string& text)
- {
- if (newline)
- {
- COUT(0) << stripEnclosingBraces(text) << std::endl;
- }
- else
- {
- COUT(0) << stripEnclosingBraces(text);
- }
- }
-
- /**
@brief Writes text to a file.
*/
void write(const std::string& filename, const std::string& text)
@@ -126,11 +110,11 @@
if (!file.is_open())
{
- COUT(1) << "Error: Couldn't write to file \"" << filename << "\"." << std::endl;
+ orxout(user_error) << "Couldn't write to file \"" << filename << "\"." << endl;
return;
}
- file << text << std::endl;
+ file << text << endl;
file.close();
}
@@ -144,11 +128,11 @@
if (!file.is_open())
{
- COUT(1) << "Error: Couldn't append to file \"" << filename << "\"." << std::endl;
+ orxout(user_error) << "Couldn't append to file \"" << filename << "\"." << endl;
return;
}
- file << text << std::endl;
+ file << text << endl;
file.close();
}
@@ -162,7 +146,7 @@
if (!file.is_open())
{
- COUT(1) << "Error: Couldn't read from file \"" << filename << "\"." << std::endl;
+ orxout(user_error) << "Couldn't read from file \"" << filename << "\"." << endl;
return "";
}
@@ -191,17 +175,17 @@
{
if (expr.getResult() == 42.0)
{
- COUT(3) << "Greetings from the restaurant at the end of the universe." << std::endl;
+ orxout(user_info) << "Greetings from the restaurant at the end of the universe." << endl;
}
if (!expr.getRemains().empty())
{
- COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
+ orxout(user_warning) << "Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << endl;
}
return static_cast<float>(expr.getResult());
}
else
{
- COUT(1) << "Error: Cannot calculate expression: Parse error." << std::endl;
+ orxout(user_error) << "Cannot calculate expression: Parse error." << endl;
return 0;
}
}
Modified: code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.h
===================================================================
--- code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/ConsoleCommandCompilation.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -41,7 +41,6 @@
{
_CoreExport void source(const std::string& filename);
_CoreExport std::string echo(const std::string& text);
- _CoreExport void puts(bool newline, const std::string& test);
_CoreExport void write(const std::string& filename, const std::string& text);
_CoreExport void append(const std::string& filename, const std::string& text);
Modified: code/branches/output/src/libraries/core/command/Executor.cc
===================================================================
--- code/branches/output/src/libraries/core/command/Executor.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/Executor.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -103,11 +103,11 @@
if (error && *error)
{
if (bPrintError)
- COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << std::endl;
+ orxout(internal_warning) << "Can't call executor " << this->name_ << " through parser: Not enough arguments or default values given (input: " << arguments.join() << ")." << endl;
return MT_Type::Null;
}
- COUT(5) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << std::endl;
+ orxout(verbose, context::executor) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << argCount << " arguments: " << arg[0] << " / " << arg[1] << " / " << arg[2] << " / " << arg[3] << " / " << arg[4] << endl;
// execute the function with the evaluated arguments (the default values of the executor are also included in these arguments)
switch (argCount)
Modified: code/branches/output/src/libraries/core/command/Executor.h
===================================================================
--- code/branches/output/src/libraries/core/command/Executor.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/Executor.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -56,7 +56,7 @@
@code
void myFunction(int a, int b) // declare a static function
{
- COUT(0) << "The sum is " << (a + b) << std::endl; // print the sum of a and b to the console
+ orxout() << "The sum is " << (a + b) << endl; // print the sum of a and b to the console
}
FunctorPtr functor = createFunctor(&myFunction); // create a functor that wraps the function-pointer
Modified: code/branches/output/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/output/src/libraries/core/command/Functor.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/Functor.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -255,7 +255,7 @@
return (*this)(this->object_, param1, param2, param3, param4, param5);
else
{
- COUT(1) << "Error: Can't execute FunctorMember, no object set." << std::endl;
+ orxout(internal_error) << "Can't execute FunctorMember, no object set." << endl;
return MT_Type::Null;
}
}
@@ -338,7 +338,7 @@
// see Functor::setRawObjectPointer()
inline void setRawObjectPointer(void*)
- { COUT(2) << "Warning: Can't assign an object pointer to a static functor" << std::endl; }
+ { orxout(internal_warning) << "Can't assign an object pointer to a static functor" << endl; }
// see Functor::getRawObjectPointer()
inline void* getRawObjectPointer() const
{ return 0; }
Modified: code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsoleWindows.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/IOConsoleWindows.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -249,7 +249,7 @@
|| !GetConsoleMode(this->stdInHandle_, &this->originalTerminalSettings_)
|| !SetConsoleMode(this->stdInHandle_, 0))
{
- orxout(user_error) << "Error: Could not set Windows console settings" << endl;
+ orxout(user_error) << "Could not set Windows console settings" << endl;
return;
}
FlushConsoleInputBuffer(this->stdInHandle_);
Modified: code/branches/output/src/libraries/core/command/IRC.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IRC.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/IRC.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -84,7 +84,7 @@
this->interpreter_->def("::orxonox::irc::info", IRC::tcl_info, Tcl::variadic());
}
catch (Tcl::tcl_error const &e)
- { COUT(1) << "Tcl (IRC) error: " << e.what(); }
+ { orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl; }
this->nickname_ = "orx" + multi_cast<std::string>(static_cast<unsigned int>(rand()));
TclThreadManager::execute(threadID, "set nickname " + this->nickname_);
@@ -99,7 +99,7 @@
if (!IRC::getInstance().interpreter_)
{
IRC::getInstance().initialize();
- COUT(1) << "Error: IRC client wasn't yet initialized, please try again." << std::endl;
+ orxout(user_error) << "IRC client wasn't yet initialized, please try again." << endl;
return false;
}
@@ -109,7 +109,7 @@
return true;
}
catch (Tcl::tcl_error const &e)
- { COUT(1) << "Tcl (IRC) error: " << e.what(); }
+ { orxout(user_error, context::tcl) << "Tcl (IRC) error: " << e.what() << endl; }
return false;
}
@@ -138,24 +138,24 @@
/// Tcl-callback: Prints a message that was received from the current IRC channel to the console.
void IRC::tcl_say(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
{
- COUT(0) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
+ orxout(message) << "IRC> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
}
/// Tcl-callback: Prints a private message that was received from a user to the console.
void IRC::tcl_privmsg(Tcl::object const &query, Tcl::object const &nick, Tcl::object const &args)
{
- COUT(0) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << std::endl;
+ orxout(message) << "IRC (" << query.get() << ")> " << nick.get() << ": " << stripEnclosingBraces(args.get()) << endl;
}
/// Tcl-callback: Prints an action-message (usually /me ...) that was received from the current IRC channel to the console.
void IRC::tcl_action(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
{
- COUT(0) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << std::endl;
+ orxout(message) << "IRC> * " << nick.get() << ' ' << stripEnclosingBraces(args.get()) << endl;
}
/// Tcl-callback: Prints all kinds of information that were received from the IRC server or channel (connection info, join, part, modes, ...) to the console.
void IRC::tcl_info(Tcl::object const &channel, Tcl::object const &args)
{
- COUT(0) << "IRC> --> " << stripEnclosingBraces(args.get()) << std::endl;
+ orxout(message) << "IRC> --> " << stripEnclosingBraces(args.get()) << endl;
}
}
Modified: code/branches/output/src/libraries/core/command/TclBind.cc
===================================================================
--- code/branches/output/src/libraries/core/command/TclBind.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/TclBind.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -105,7 +105,7 @@
this->interpreter_->eval("rename exit ::tcl::exit; proc exit {} { execute exit }");
}
catch (Tcl::tcl_error const &e)
- { COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl; }
+ { orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl; }
}
}
@@ -128,7 +128,10 @@
interpreter->eval("source \"" + TclBind::getInstance().tclDataPath_ + "/init.tcl\"");
}
catch (Tcl::tcl_error const &e)
- { 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; }
+ {
+ orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;
+ orxout(user_error, context::tcl) << "Tcl isn't properly initialized. Orxonox might possibly not work like that." << endl;
+ }
return interpreter;
}
@@ -153,7 +156,7 @@
*/
std::string TclBind::tcl_query(Tcl::object const &args)
{
- COUT(4) << "Tcl_query: " << args.get() << std::endl;
+ orxout(verbose, context::commands) << "Tcl_query: " << args.get() << endl;
return TclBind::tcl_helper(args, true);
}
@@ -162,7 +165,7 @@
*/
void TclBind::tcl_execute(Tcl::object const &args)
{
- COUT(4) << "Tcl_execute: " << args.get() << std::endl;
+ orxout(verbose, context::commands) << "Tcl_execute: " << args.get() << endl;
TclBind::tcl_helper(args, false);
}
@@ -185,14 +188,14 @@
switch (error)
{
- case CommandExecutor::Error: COUT(1) << "Error: Can't execute command \"" << command << "\", command doesn't exist. (B)" << std::endl; break;
- case CommandExecutor::Incomplete: COUT(1) << "Error: Can't execute command \"" << command << "\", not enough arguments given. (B)" << std::endl; break;
- case CommandExecutor::Deactivated: COUT(1) << "Error: Can't execute command \"" << command << "\", command is not active. (B)" << std::endl; break;
- case CommandExecutor::Denied: COUT(1) << "Error: Can't execute command \"" << command << "\", access denied. (B)" << std::endl; break;
+ case CommandExecutor::Error: orxout(user_error) << "Can't execute command \"" << command << "\", command doesn't exist. (B)" << endl; break;
+ case CommandExecutor::Incomplete: orxout(user_error) << "Can't execute command \"" << command << "\", not enough arguments given. (B)" << endl; break;
+ case CommandExecutor::Deactivated: orxout(user_error) << "Can't execute command \"" << command << "\", command is not active. (B)" << endl; break;
+ case CommandExecutor::Denied: orxout(user_error) << "Can't execute command \"" << command << "\", access denied. (B)" << endl; break;
}
if (error == CommandExecutor::Error)
- COUT(3) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << std::endl;
+ orxout(user_info) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << endl;
return result;
}
@@ -210,7 +213,7 @@
return TclBind::getInstance().interpreter_->eval("uplevel #0 " + tclcode);
}
catch (Tcl::tcl_error const &e)
- { COUT(1) << "Tcl error: " << e.what() << std::endl; }
+ { orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl; }
}
return "";
@@ -222,7 +225,7 @@
*/
void TclBind::bgerror(const std::string& error)
{
- COUT(1) << "Tcl background error: " << stripEnclosingBraces(error) << std::endl;
+ orxout(user_error, context::tcl) << "Tcl background error: " << stripEnclosingBraces(error) << endl;
}
/**
@@ -242,7 +245,7 @@
return TclBind::getInstance().interpreter_->eval(tclcode);
}
catch (Tcl::tcl_error const &e)
- { COUT(1) << "Tcl error: " << e.what() << std::endl; }
+ { orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl; }
if (error)
*error = CommandExecutor::Error;
Modified: code/branches/output/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/branches/output/src/libraries/core/command/TclThreadManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/command/TclThreadManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -224,7 +224,7 @@
{
TclThreadManager::getInstance().numInterpreterBundles_++;
TclThreadManager::createWithId(TclThreadManager::getInstance().numInterpreterBundles_);
- COUT(0) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << std::endl;
+ orxout(user_info) << "Created new Tcl-interpreter with ID " << TclThreadManager::getInstance().numInterpreterBundles_ << endl;
return TclThreadManager::getInstance().numInterpreterBundles_;
}
@@ -287,7 +287,10 @@
bundle->interpreter_->eval("rename ::orxonox::for for");
}
catch (const Tcl::tcl_error& e)
- { bundle->interpreter_ = 0; COUT(1) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << std::endl; }
+ {
+ bundle->interpreter_ = 0;
+ orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl;
+ }
}
/**
@@ -406,7 +409,7 @@
if ((source_bundle->id_ == target_bundle->id_) || source_bundle->queriers_.is_in(target_bundle->id_))
{
// This query would lead to a deadlock - return with an error
- TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
+ TclThreadManager::error("Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
+ " -> " + multi_cast<std::string>(target_bundle->id_) \
+ "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \
+ " from other interpreter with ID " + multi_cast<std::string>(source_bundle->id_) + '.');
@@ -447,10 +450,10 @@
output = CommandExecutor::query(command, &error, false);
switch (error)
{
- case CommandExecutor::Error: TclThreadManager::error("Error: Can't execute command \"" + command + "\", command doesn't exist. (T)"); break;
- case CommandExecutor::Incomplete: TclThreadManager::error("Error: Can't execute command \"" + command + "\", not enough arguments given. (T)"); break;
- case CommandExecutor::Deactivated: TclThreadManager::error("Error: Can't execute command \"" + command + "\", command is not active. (T)"); break;
- case CommandExecutor::Denied: TclThreadManager::error("Error: Can't execute command \"" + command + "\", access denied. (T)"); break;
+ case CommandExecutor::Error: TclThreadManager::error("Can't execute command \"" + command + "\", command doesn't exist. (T)"); break;
+ case CommandExecutor::Incomplete: TclThreadManager::error("Can't execute command \"" + command + "\", not enough arguments given. (T)"); break;
+ case CommandExecutor::Deactivated: TclThreadManager::error("Can't execute command \"" + command + "\", command is not active. (T)"); break;
+ case CommandExecutor::Denied: TclThreadManager::error("Can't execute command \"" + command + "\", access denied. (T)"); break;
}
}
else
@@ -475,7 +478,7 @@
{
// This happens if the main thread tries to query a busy interpreter
// To avoid a lock of the main thread, we simply don't proceed with the query in this case
- TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
+ TclThreadManager::error("Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
}
}
@@ -521,7 +524,7 @@
}
else
{
- TclThreadManager::error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
+ TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
return 0;
}
}
Modified: code/branches/output/src/libraries/core/input/Button.cc
===================================================================
--- code/branches/output/src/libraries/core/input/Button.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/Button.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -254,13 +254,13 @@
{
if (serious)
{
- COUT(2) << "Error while parsing binding for button/axis " << this->name_ << ". "
- << message << std::endl;
+ orxout(internal_error, context::input) << "Error while parsing binding for button/axis " << this->name_ << ". "
+ << message << endl;
}
else
{
- COUT(3) << "Warning while parsing binding for button/axis " << this->name_ << ". "
- << message << std::endl;
+ orxout(internal_warning, context::input) << "Warning while parsing binding for button/axis " << this->name_ << ". "
+ << message << endl;
}
}
}
Modified: code/branches/output/src/libraries/core/input/InputDevice.h
===================================================================
--- code/branches/output/src/libraries/core/input/InputDevice.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/InputDevice.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -134,7 +134,7 @@
// Note: after the static_cast here, the cast this pointer becomes
// invalid right until the subclass has been constructed!
oisDevice_->setEventCallback(static_cast<DeviceClass*>(this));
- COUT(4) << "Instantiated a " << this->getClassName() << std::endl;
+ orxout(verbose, context::input) << "Instantiated a " << this->getClassName() << endl;
}
//! Destroys the OIS device
@@ -146,8 +146,8 @@
}
catch (const OIS::Exception& ex)
{
- COUT(1) << this->getClassName() << " destruction failed: " << ex.eText << std::endl
- << " Potential resource leak!" << std::endl;
+ orxout(internal_error, context::input) << this->getClassName() << " destruction failed: " << ex.eText << '\n'
+ << "Potential resource leak!" << endl;
}
}
Modified: code/branches/output/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/output/src/libraries/core/input/InputManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/InputManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -99,7 +99,7 @@
{
RegisterRootObject(InputManager);
- CCOUT(4) << "Constructing..." << std::endl;
+ orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
// Allocate space for the function call buffer
this->callBuffer_.reserve(16);
@@ -127,7 +127,7 @@
ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(this);
ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
- CCOUT(4) << "Construction complete." << std::endl;
+ orxout(internal_status, context::input) << "InputManager: Construction complete." << endl;
internalState_ = Nothing;
}
@@ -142,7 +142,7 @@
*/
void InputManager::loadDevices()
{
- CCOUT(4) << "Loading input devices..." << std::endl;
+ orxout(internal_info, context::input) << "InputManager: Loading input devices..." << endl;
// When loading the devices they should not already be loaded
assert(internalState_ & Bad);
@@ -195,7 +195,7 @@
oisInputManager_ = OIS::InputManager::createInputSystem(paramList);
// Exception-safety
Loki::ScopeGuard guard = Loki::MakeGuard(OIS::InputManager::destroyInputSystem, oisInputManager_);
- CCOUT(4) << "Created OIS input manager." << std::endl;
+ orxout(internal_info, context::input) << "Created OIS input manager." << endl;
if (oisInputManager_->getNumberOfDevices(OIS::OISKeyboard) > 0)
devices_[InputDeviceEnumerator::Keyboard] = new Keyboard(InputDeviceEnumerator::Keyboard, oisInputManager_);
@@ -218,7 +218,7 @@
// Reorder states in case some joy sticks were added/removed
this->updateActiveStates();
- CCOUT(4) << "Input devices loaded." << std::endl;
+ orxout(internal_info, context::input) << "Input devices loaded." << endl;
}
//! Creates a new orxonox::Mouse
@@ -232,12 +232,12 @@
}
catch (const std::exception& ex)
{
- CCOUT(2) << "Warning: Failed to create Mouse:" << ex.what() << std::endl
- << "Proceeding without mouse support." << std::endl;
+ orxout(user_warning, context::input) << "Failed to create Mouse:" << ex.what() << '\n'
+ << "Proceeding without mouse support." << endl;
}
}
else
- CCOUT(2) << "Warning: No mouse found! Proceeding without mouse support." << std::endl;
+ orxout(user_warning, context::input) << "No mouse found! Proceeding without mouse support." << endl;
}
//! Creates as many joy sticks as are available.
@@ -251,7 +251,7 @@
}
catch (const std::exception& ex)
{
- CCOUT(2) << "Warning: Failed to create joy stick: " << ex.what() << std::endl;
+ orxout(user_warning, context::input) << "Failed to create joy stick: " << ex.what() << endl;
}
}
@@ -269,7 +269,7 @@
InputManager::~InputManager()
{
- CCOUT(3) << "Destroying..." << std::endl;
+ orxout(internal_status, context::input) << "InputManager: Destroying..." << endl;
// Leave all active InputStates (except "empty")
while (this->activeStates_.size() > 1)
@@ -294,7 +294,7 @@
ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(0);
ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
- CCOUT(3) << "Destruction complete." << std::endl;
+ orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl;
}
/**
@@ -305,7 +305,7 @@
*/
void InputManager::destroyDevices()
{
- CCOUT(4) << "Destroying devices..." << std::endl;
+ orxout(internal_info, context::input) << "InputManager: Destroying devices..." << endl;
BOOST_FOREACH(InputDevice*& device, devices_)
{
@@ -314,7 +314,7 @@
const std::string& className = device->getClassName();
delete device;
device = 0;
- CCOUT(4) << className << " destroyed." << std::endl;
+ orxout(internal_info, context::input) << className << " destroyed." << endl;
}
devices_.resize(InputDeviceEnumerator::FirstJoyStick);
@@ -325,13 +325,13 @@
}
catch (const OIS::Exception& ex)
{
- COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl
- << " Potential resource leak!" << std::endl;
+ orxout(internal_error, context::input) << "OIS::InputManager destruction failed" << ex.eText << '\n'
+ << "Potential resource leak!" << endl;
}
oisInputManager_ = NULL;
internalState_ |= Bad;
- CCOUT(4) << "Destroyed devices." << std::endl;
+ orxout(internal_info, context::input) << "Destroyed devices." << endl;
}
// ############################################################
@@ -342,7 +342,7 @@
void InputManager::reload()
{
if (internalState_ & Calibrating)
- CCOUT(2) << "Warning: Cannot reload input system. Joy sticks are currently being calibrated." << std::endl;
+ orxout(internal_warning, context::input) << "Cannot reload input system. Joy sticks are currently being calibrated." << endl;
else
reloadInternal();
}
@@ -350,13 +350,13 @@
//! Internal reload method. Destroys the OIS devices and loads them again.
void InputManager::reloadInternal()
{
- CCOUT(4) << "Reloading ..." << std::endl;
+ orxout(internal_info, context::input) << "InputManager: Reloading ..." << endl;
this->destroyDevices();
this->loadDevices();
internalState_ &= ~Bad;
- CCOUT(4) << "Reloading complete." << std::endl;
+ orxout(internal_info, context::input) << "InputManager: Reloading complete." << endl;
}
// ############################################################
@@ -470,8 +470,8 @@
void InputManager::calibrate()
{
- COUT(0) << "Move all joy stick axes fully in all directions." << std::endl
- << "When done, put the axex in the middle position and press enter." << std::endl;
+ orxout(message) << "Move all joy stick axes fully in all directions." << '\n'
+ << "When done, put the axex in the middle position and press enter." << endl;
BOOST_FOREACH(InputDevice* device, devices_)
if (device != NULL)
@@ -494,7 +494,7 @@
// Clear buffers to prevent button hold events
this->clearBuffers();
- COUT(0) << "Calibration has been stored." << std::endl;
+ orxout(message) << "Calibration has been stored." << endl;
}
//! Gets called by WindowEventListener upon focus change --> clear buffers
@@ -534,8 +534,8 @@
{
if (it->second->getPriority() == priority)
{
- COUT(2) << "Warning: Could not add an InputState with the same priority '"
- << static_cast<int>(priority) << "' != 0." << std::endl;
+ orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '"
+ << static_cast<int>(priority) << "' != 0." << endl;
return 0;
}
}
@@ -547,7 +547,7 @@
}
else
{
- COUT(2) << "Warning: Could not add an InputState with the same name '" << name << "'." << std::endl;
+ orxout(internal_warning, context::input) << "Could not add an InputState with the same name '" << name << "'." << endl;
return 0;
}
}
@@ -597,7 +597,7 @@
{
if (name == "empty")
{
- COUT(2) << "InputManager: Leaving the empty state is not allowed!" << std::endl;
+ orxout(internal_warning, context::input) << "InputManager: Leaving the empty state is not allowed!" << endl;
return false;
}
// get pointer from the map with all stored handlers
@@ -622,7 +622,7 @@
{
if (name == "empty")
{
- COUT(2) << "InputManager: Removing the empty state is not allowed!" << std::endl;
+ orxout(internal_warning, context::input) << "InputManager: Removing the empty state is not allowed!" << endl;
return false;
}
std::map<std::string, InputState*>::iterator it = statesByName_.find(name);
@@ -648,7 +648,7 @@
{
if (name == "empty")
{
- COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl;
+ orxout(internal_warning, context::input) << "InputManager: Changing the empty state is not allowed!" << endl;
return false;
}
std::map<std::string, InputState*>::iterator it = statesByName_.find(name);
Modified: code/branches/output/src/libraries/core/input/JoyStick.cc
===================================================================
--- code/branches/output/src/libraries/core/input/JoyStick.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/JoyStick.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -79,7 +79,7 @@
}
}
- COUT(4) << "Created OIS joy stick with ID " << deviceName_ << std::endl;
+ orxout(verbose, context::input) << "Created OIS joy stick with ID " << deviceName_ << endl;
// Load calibration
size_t axes = sliderAxes_s + static_cast<size_t>(oisDevice_->getNumberOfComponents(OIS::OIS_Axis));
Modified: code/branches/output/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/output/src/libraries/core/input/KeyBinder.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/KeyBinder.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -250,7 +250,7 @@
*/
void KeyBinder::loadBindings()
{
- COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
+ orxout(internal_info, context::input) << "KeyBinder: Loading key bindings..." << endl;
this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun());
this->configFile_->load();
@@ -276,7 +276,7 @@
addButtonToCommand(it->second->bindingString_, it->second);
}
- COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
+ orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl;
}
bool KeyBinder::setBinding(const std::string& binding, const std::string& name, bool bTemporary)
@@ -293,7 +293,7 @@
}
else
{
- COUT(2) << "Could not find key/button/axis with name '" << name << "'." << std::endl;
+ orxout(internal_warning, context::input) << "Could not find key/button/axis with name '" << name << "'." << endl;
return false;
}
}
Modified: code/branches/output/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/branches/output/src/libraries/core/input/KeyBinderManager.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/core/input/KeyBinderManager.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -167,7 +167,7 @@
{
if (!this->bBinding_)
{
- COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
+ orxout(message) << "Press any button/key or move a mouse/joystick axis" << endl;
KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this));
InputManager::getInstance().enterState("detector");
this->command_ = command;
@@ -184,11 +184,11 @@
{
if (keyName == "Keys.KeyEscape")
{
- COUT(0) << "Keybinding aborted." << std::endl;
+ orxout(message) << "Keybinding aborted." << endl;
}
else
{
- COUT(0) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << std::endl;
+ orxout(message) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << endl;
this->currentBinder_->setBinding(command_, keyName, bTemporary_);
}
InputManager::getInstance().leaveState("detector");
Modified: code/branches/output/src/libraries/util/Sleep.cc
===================================================================
--- code/branches/output/src/libraries/util/Sleep.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/util/Sleep.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -48,7 +48,7 @@
void usleep(unsigned long microseconds)
{
//if (microseconds < 1000)
- // orxout(internal_warning) << "Warning: Windows cannot sleep less than 1ms, ignoring" << endl;
+ // orxout(internal_warning) << "Windows cannot sleep less than 1ms, ignoring" << endl;
Sleep(microseconds / 1000);
}
Modified: code/branches/output/src/libraries/util/SubString.cc
===================================================================
--- code/branches/output/src/libraries/util/SubString.cc 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/util/SubString.cc 2011-07-31 15:15:13 UTC (rev 8806)
@@ -512,9 +512,9 @@
*/
void SubString::debug() const
{
- orxout() << "Substring-information::count=" << this->tokens_.size() << " ::";
+ orxout(debug_output) << "Substring-information::count=" << this->tokens_.size() << " ::";
for (unsigned int i = 0; i < this->tokens_.size(); ++i)
- orxout() << "s" << i << "='" << this->tokens_[i].c_str() << "'::";
- orxout() << endl;
+ orxout(debug_output) << "s" << i << "='" << this->tokens_[i].c_str() << "'::";
+ orxout(debug_output) << endl;
}
}
Modified: code/branches/output/src/libraries/util/output/OutputDefinitions.h
===================================================================
--- code/branches/output/src/libraries/util/output/OutputDefinitions.h 2011-07-31 09:45:56 UTC (rev 8805)
+++ code/branches/output/src/libraries/util/output/OutputDefinitions.h 2011-07-31 15:15:13 UTC (rev 8806)
@@ -87,6 +87,9 @@
REGISTER_OUTPUT_CONTEXT(input);
REGISTER_OUTPUT_CONTEXT(events);
REGISTER_OUTPUT_CONTEXT(config);
+ REGISTER_OUTPUT_CONTEXT(templates);
+ REGISTER_OUTPUT_CONTEXT(loader);
+ REGISTER_OUTPUT_CONTEXT(xml);
}
}
}
More information about the Orxonox-commit
mailing list