Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

merged output branch back to trunk.

Changes:

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

Output levels:

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

Guidelines:

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

Usage in C++:

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

Usage in Lua:

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

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

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/questsystem/Quest.cc

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