Orxonox: src/util/Debug.h File Reference

# Debug.h File Reference

Handles different output-levels of errors, warnings, infos and debug informations. More...

`#include "UtilPrereqs.h"`
`#include "OutputHandler.h"`

## Namespaces

namespace | orxonox

## Defines

#define | CCOUT(x) CCOUT ## x
#define | CCOUT0 (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : CCOUT_EXEC(0)
#define | CCOUT1 (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : CCOUT_EXEC(1)
#define | CCOUT2 (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : CCOUT_EXEC(2)
#define | CCOUT3 (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : CCOUT_EXEC(3)
#define | CCOUT4 (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : CCOUT_EXEC(4)
#define | CCOUT5 (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : CCOUT_EXEC(5)
#define | CCOUT6 false ? COUT_EXEC(6) : CCOUT_EXEC(6)
#define | CCOUT_EXEC(x)
#define | CCOUTORX_DEBUG CCOUT4
#define | CCOUTORX_ERROR CCOUT1
#define | CCOUTORX_INFO CCOUT3
#define | CCOUTORX_NONE CCOUT0
#define | CCOUTORX_ULTRA CCOUT6
#define | CCOUTORX_VERBOSE CCOUT5
#define | CCOUTORX_WARNING CCOUT2
#define | COUT(x) COUT ## x
#define | COUT0 (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : COUT_EXEC(0)
#define | COUT1 (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : COUT_EXEC(1)
#define | COUT2 (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : COUT_EXEC(2)
#define | COUT3 (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : COUT_EXEC(3)
#define | COUT4 (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : COUT_EXEC(4)
#define | COUT5 (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : COUT_EXEC(5)
#define | COUT6 false ? COUT_EXEC(6) : COUT_EXEC(6)
#define | COUT_EXEC(x) orxonox::OutputHandler::getOutStream().setOutputLevel(x)
#define | COUTORX_DEBUG COUT4
#define | COUTORX_ERROR COUT1
#define | COUTORX_INFO COUT3
#define | COUTORX_NONE COUT0
#define | COUTORX_ULTRA COUT6
#define | COUTORX_VERBOSE COUT5
#define | COUTORX_WARNING COUT2
#define | ORX_DEBUG 4
#define | ORX_ERROR 1
#define | ORX_HARD_DEBUG_LEVEL ORX_VERBOSE
#define | ORX_INFO 3
#define | ORX_NONE 0
#define | ORX_PRINT_DEBUG_OUTPUT 1
#define | ORX_ULTRA 6
#define | ORX_VERBOSE 5
#define | ORX_WARNING 2

## Functions

int | orxonox::getSoftDebugLevel ()
| Returns the soft debug level, stored in the only existing instance of the OutputHandler class, configured in the config-file.

## Detailed Description

Handles different output-levels of errors, warnings, infos and debug informations.

The COUT(level) macro acts like std::cout, but the output is only performed if the given level is <= the soft debug level.

There are two used values in this file:

- The hard debug level is used during compiletime. It describes the highest allowed output level.
- The soft debug level is used during runtime and is the maximum of the three configurable output-levels for console, logfile and ingame shell.

The separation between the three devices is done by the OutputHandler.

Possible levels are: 0: Very important output 1: Errors 2: Warnings 3: Informations 4: Debug information 5: More debug information 6: Crazy debug informations

## Define Documentation

#define CCOUT | ( | x |  | ) | CCOUT ## x

Referenced by orxonox::InputManager::_destroyJoySticks(), orxonox::InputManager::_destroyKeyboard(), orxonox::InputManager::_destroyMouse(), orxonox::InputManager::_initialiseJoySticks(), orxonox::InputManager::_initialiseKeyboard(), orxonox::InputManager::_initialiseMouse(), orxonox::InputManager::_reload(), orxonox::CompoundCollisionShape::attach(), orxonox::WorldEntity::collisionTypeChanged(), orxonox::GraphicsManager::declareResources(), orxonox::WorldEntity::detach(), orxonox::CompoundCollisionShape::detach(), orxonox::HUDRadar::displayObject(), orxonox::InputManager::initialise(), orxonox::GraphicsManager::initialiseResources(), orxonox::StaticEntity::isCollisionTypeLegal(), orxonox::SpaceShip::isCollisionTypeLegal(), orxonox::MobileEntity::isCollisionTypeLegal(), orxonox::GraphicsManager::loadRenderer(), orxonox::WorldEntity::recalculateMassProps(), orxonox::InputManager::reloadInputSystem(), orxonox::WorldEntity::setCollisionType(), orxonox::Scene::setNegativeWorldRange(), orxonox::StaticEntity::setOrientation(), orxonox::StaticEntity::setPosition(), orxonox::Scene::setPositiveWorldRange(), orxonox::RadarViewable::setRadarObjectDescription(), orxonox::CollisionShape::setScale(), orxonox::CollisionShape::setScale3D(), orxonox::CompoundCollisionShape::updateAttachedShape(), and orxonox::InputManager::~InputManager().

#define CCOUT0 (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : CCOUT_EXEC(0)

#define CCOUT1 (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : CCOUT_EXEC(1)

#define CCOUT2 (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : CCOUT_EXEC(2)

#define CCOUT3 (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : CCOUT_EXEC(3)

#define CCOUT4 (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : CCOUT_EXEC(4)

#define CCOUT5 (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : CCOUT_EXEC(5)

#define CCOUT6 false ? COUT_EXEC(6) : CCOUT_EXEC(6)

#define CCOUT_EXEC | ( | x |  | ) |

Value:

    orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
      << this->getIdentifier()->getName() << ": "

#define CCOUTORX_DEBUG CCOUT4

#define CCOUTORX_ERROR CCOUT1

#define CCOUTORX_INFO CCOUT3

#define CCOUTORX_NONE CCOUT0

CCOUT: Prints output with std::cout and adds the classname ///

#define CCOUTORX_ULTRA CCOUT6

#define CCOUTORX_VERBOSE CCOUT5

#define CCOUTORX_WARNING CCOUT2

#define COUT | ( | x |  | ) | COUT ## x

Referenced by orxonox::InputManager::_configureInputState(), orxonox::CommandLine::_parse(), orxonox::GamestateManager::ack(), orxonox::GSGraphics::activate(), orxonox::GSDedicated::activate(), orxonox::ConfigValueContainer::add(), orxonox::Server::addClient(), orxonox::Quest::addCompleteEffect(), orxonox::Identifier::addConfigValueContainer(), orxonox::Identifier::addConsoleCommand(), orxonox::CommandExecutor::addConsoleCommandShortcut(), orxonox::QuestEffectBeacon::addEffect(), orxonox::Language::addEntry(), orxonox::BaseObject::addEventContainer(), orxonox::Quest::addFailEffect(), orxonox::Quest::addHint(), orxonox::Quest::addListener(), orxonox::RadarViewable::addMapEntity(), orxonox::ServerConnection::addPacket(), orxonox::GlobalQuest::addRewardEffect(), orxonox::QuestManager::addSubQuest(), orxonox::Quest::addSubQuest(), orxonox::DistanceTrigger::addTargets(), orxonox::BaseObject::addTemplate(), orxonox::BaseItem::addTo(), orxonox::Identifier::addXMLPortEventContainer(), orxonox::Identifier::addXMLPortObjectContainer(), orxonox::Identifier::addXMLPortParamContainer(), orxonox::append(), orxonox::Template::applyOn(), orxonox::ConsoleCommand::argumentCompleter(), orxonox::WorldEntity::attach(), orxonox::TclBind::bgerror(), orxonox::BigExplosion::BigExplosion(), orxonox::packet::blub(), orxonox::calculate(), orxonox::InputManager::calibrate(), orxonox::ConfigValueContainer::callFunctionWithIndex(), orxonox::Shader::changedCompositor(), orxonox::OrxonoxOverlay::changedName(), orxonox::Template::changedName(), orxonox::Core::checkDevBuild(), orxonox::Test::checkS1(), orxonox::Test::checkS2(), orxonox::Test::checkS3(), orxonox::Test::checkS4(), orxonox::Test::checkU1(), orxonox::Test::checkU2(), orxonox::Test::checkU3(), orxonox::Test::checkU4(), orxonox::packet::ClassID::ClassID(), orxonox::PlayerManager::clientConnected(), orxonox::PlayerManager::clientDisconnected(), orxonox::Server::close(), orxonox::ClientConnection::closeConnection(), orxonox::packet::Gamestate::collectData(), orxonox::Quest::complete(), orxonox::LocalQuest::complete(), orxonox::GlobalQuest::complete(), orxonox::packet::Gamestate::compressData(), orxonox::ConverterFallback< FromType, ToType >::convert(), orxonox::Core::Core(), orxonox::TclThreadManager::create(), orxonox::ClassFactory< T >::create(), orxonox::Factory::createClassHierarchy(), orxonox::Server::createClient(), orxonox::DroppedItem::createDefaultDrop(), orxonox::Core::createDirectories(), orxonox::Language::createEntry(), orxonox::TclThreadManager::createNewTclInterpreter(), orxonox::packet::Packet::createPacket(), orxonox::TclBind::createTclInterpreter(), orxonox::GSDedicated::deactivate(), orxonox::Game::declareGameState(), orxonox::GraphicsManager::declareResources(), orxonox::packet::Gamestate::decompressData(), orxonox::packet::Packet::deletePacket(), orxonox::TclThreadManager::destroy(), orxonox::UnderAttack::destroyedPawn(), orxonox::ServerConnection::disconnectPeer(), orxonox::ClientConnection::disconnectPeer(), orxonox::TclThreadManager::dump(), orxonox::Deathmatch::end(), orxonox::Asteroids::end(), orxonox::TeamBaseMatch::endGame(), orxonox::ClientConnection::establishConnection(), orxonox::TclBind::eval(), orxonox::IRC::eval(), orxonox::exceptionThrowerHelper(), orxonox::QuestEffectBeacon::execute(), orxonox::CommandEvaluation::execute(), orxonox::GUIManager::executeCode(), orxonox::ExplosionChunk::ExplosionChunk(), orxonox::Synchronisable::fabricate(), orxonox::Identifier::fabricate(), orxonox::Quest::fail(), orxonox::LocalQuest::fail(), orxonox::GlobalQuest::fail(), orxonox::packet::DeleteObjects::fetchIDs(), orxonox::QuestManager::findHint(), orxonox::QuestManager::findQuest(), orxonox::TclThreadManager::flush(), orxonox::packet::FunctionIDs::FunctionIDs(), orxonox::Game::Game(), orxonox::GamestateClient::GamestateClient(), orxonox::Synchronisable::getData(), orxonox::ConfigFileManager::getFile(), orxonox::Language::getLocalisation(), orxonox::BaseObject::getMainState(), orxonox::QuestListener::getMode(), orxonox::NamespaceNode::getNodeRelative(), orxonox::Shader::getParameterPointer(), orxonox::QuestManager::getQuestTree(), orxonox::Game::getState(), orxonox::NotificationQueue::getTargets(), orxonox::Template::getTemplate(), orxonox::Template::getXMLElement(), orxonox::ChatOverlay::incomingChat(), orxonox::InGameConsole::initialise(), orxonox::GUIManager::initialise(), orxonox::IRC::initialize(), orxonox::Identifier::initialize(), orxonox::Identifier::initializeClassHierarchy(), orxonox::FailQuest::invoke(), orxonox::CompleteQuest::invoke(), orxonox::AddReward::invoke(), orxonox::AddQuestHint::invoke(), orxonox::AddQuest::invoke(), orxonox::QuestEffect::invokeEffects(), orxonox::GSLevel::keybindInternal(), orxonox::Radar::listObjects(), orxonox::Loader::load(), orxonox::ConfigFile::load(), orxonox::KeyBinder::loadBindings(), orxonox::SoundBase::loadFile(), orxonox::LuaBind::loadFile(), orxonox::GSLevel::loadLevel(), orxonox::SoundBase::loadOggFile(), orxonox::LuaBind::luaPrint(), main(), orxonox::GUIManager::mouseButtonPressed(), orxonox::GUIManager::mouseButtonReleased(), orxonox::Level::networkcallback_applyXMLFile(), orxonox::QuestDescription::notificationHelper(), orxonox::WorldEntity::notifyBeingAttached(), orxonox::Server::open(), orxonox::FunctorMember< T >::operator()(), orxonox::Button::parseError(), orxonox::ParticleInterface::ParticleInterface(), orxonox::Gametype::pawnKilled(), orxonox::Deathmatch::pawnKilled(), orxonox::SoundBase::play(), orxonox::Deathmatch::playerChangedName(), orxonox::Level::playerEntered(), orxonox::Deathmatch::playerEntered(), orxonox::Level::playerLeft(), orxonox::Deathmatch::playerLeft(), orxonox::Deathmatch::playerScored(), orxonox::Game::popState(), orxonox::XMLPortClassObjectContainer< T, O >::port(), orxonox::XMLPortClassParamContainer< T >::port(), orxonox::Test::printBlaBla(), orxonox::GamestateClient::printGamestateMap(), orxonox::TrafficControl::printList(), orxonox::packet::Welcome::process(), orxonox::packet::FunctionIDs::process(), orxonox::packet::DeleteObjects::process(), orxonox::packet::ClassID::process(), orxonox::packet::Acknowledgement::process(), orxonox::EventContainer::process(), orxonox::Server::processChat(), orxonox::EventListener::processEvent(), orxonox::GamestateClient::processGamestate(), orxonox::puts(), orxonox::read(), orxonox::Language::readDefaultLanguageFile(), orxonox::Language::readTranslatedLanguageFile(), orxonox::QuestManager::registerHint(), orxonox::NotificationManager::registerNotification(), orxonox::QuestManager::registerQuest(), orxonox::NotificationManager::registerQueue(), orxonox::ConfigValueContainer::remove(), orxonox::BaseItem::removeFrom(), orxonox::DistanceTrigger::removeTarget(), orxonox::LuaBind::replaceLuaTags(), orxonox::InputManager::requestDestroyState(), orxonox::InputManager::requestLeaveState(), orxonox::Game::requestState(), orxonox::PickupSpawner::respawnTimerCallback(), orxonox::LuaBind::run(), orxonox::Game::run(), orxonox::ConfigFile::save(), orxonox::Notification::send(), orxonox::GamestateClient::sendAck(), orxonox::Server::sendChat(), orxonox::GamestateManager::sendGamestates(), orxonox::Server::sendObjectDeletes(), orxonox::ConfigValueContainer::set(), orxonox::QuestHint::setActive(), orxonox::BillboardSet::setBillboardSet(), orxonox::KeyBinder::setBinding(), orxonox::Level::setGametypeString(), orxonox::AddQuestHint::setHintId(), orxonox::QuestItem::setId(), orxonox::BaseObject::setMainState(), orxonox::BaseObject::setMainStateName(), orxonox::Mesh::setMeshSource(), orxonox::QuestListener::setMode(), orxonox::Quest::setParentQuest(), orxonox::QuestHint::setQuest(), orxonox::ChangeQuestStatus::setQuestId(), orxonox::GSDedicated::setTerminalMode(), orxonox::GraphicsManager::setupOgre(), orxonox::ControllableEntity::setXMLController(), orxonox::GUIManager::showGUI(), orxonox::TeamBaseMatch::showPoints(), orxonox::SoundManager::SoundManager(), orxonox::source(), orxonox::ParticleEmitter::sourceChanged(), orxonox::Gametype::spawnPlayer(), orxonox::Gametype::spawnPlayerAsDefaultPawn(), orxonox::SpawnPoint::SpawnPoint(), orxonox::packet::Gamestate::spreadData(), orxonox::Quest::start(), orxonox::Pong::start(), orxonox::Deathmatch::start(), orxonox::Asteroids::start(), orxonox::Identifier::startCreatingHierarchy(), orxonox::TclThreadManager::status(), orxonox::Identifier::stopCreatingHierarchy(), orxonox::Server::syncClassid(), orxonox::TclBind::tcl(), orxonox::IRC::tcl_action(), orxonox::TclBind::tcl_execute(), orxonox::IRC::tcl_info(), orxonox::IRC::tcl_privmsg(), orxonox::TclBind::tcl_query(), orxonox::IRC::tcl_say(), orxonox::SoundManager::tick(), orxonox::UnderAttack::tick(), orxonox::ModifierPickup::timerCallback(), orxonox::DroppedItem::timerCallback(), orxonox::PickupSpawner::trigger(), orxonox::DroppedItem::trigger(), orxonox::ConfigValueContainer::tset(), orxonox::Game::unloadState(), orxonox::SoundBase::update(), orxonox::NotificationQueue::update(), orxonox::Client::update(), orxonox::Synchronisable::updateData(), orxonox::Server::updateGamestate(), orxonox::RadarViewable::validate(), orxonox::write(), orxonox::Language::writeDefaultLanguageFile(), orxonox::NotificationQueue::XMLPort(), orxonox::QuestListener::XMLPort(), orxonox::QuestHint::XMLPort(), orxonox::QuestEffectBeacon::XMLPort(), orxonox::QuestDescription::XMLPort(), orxonox::LocalQuest::XMLPort(), orxonox::GlobalQuest::XMLPort(), orxonox::FailQuest::XMLPort(), orxonox::CompleteQuest::XMLPort(), orxonox::AddReward::XMLPort(), orxonox::AddQuestHint::XMLPort(), orxonox::AddQuest::XMLPort(), and orxonox::MetaObjectListElement::~MetaObjectListElement().

#define COUT0 (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : COUT_EXEC(0)

#define COUT1 (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : COUT_EXEC(1)

#define COUT2 (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : COUT_EXEC(2)

#define COUT3 (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : COUT_EXEC(3)

#define COUT4 (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : COUT_EXEC(4)

#define COUT5 (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : COUT_EXEC(5)

#define COUT6 false ? COUT_EXEC(6) : COUT_EXEC(6)

#define COUT_EXEC | ( | x |  | ) | orxonox::OutputHandler::getOutStream().setOutputLevel(x)

#define COUTORX_DEBUG COUT4

#define COUTORX_ERROR COUT1

#define COUTORX_INFO COUT3

#define COUTORX_NONE COUT0

COUT: just prints output as is with std::cout ///

#define COUTORX_ULTRA COUT6

#define COUTORX_VERBOSE COUT5

#define COUTORX_WARNING COUT2

#define ORX_DEBUG 4

Referenced by orxonox::InputManager::_initialiseJoySticks(), orxonox::InputManager::_initialiseKeyboard(), orxonox::InputManager::_initialiseMouse(), and orxonox::InputManager::initialise().

#define ORX_ERROR 1

#define ORX_HARD_DEBUG_LEVEL ORX_VERBOSE

#define ORX_INFO 3

#define ORX_NONE 0

#define ORX_PRINT_DEBUG_OUTPUT 1

#define ORX_ULTRA 6

#define ORX_VERBOSE 5

#define ORX_WARNING 2

Referenced by orxonox::InputManager::_initialiseJoySticks(), and orxonox::InputManager::_initialiseMouse().