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/libraries/core/command/CommandEvaluation.cc

    r7401 r8858  
    131131
    132132            if (!this->execCommand_)
    133                 *error = CommandExecutor::Error;
     133                *error = CommandExecutor::Inexistent;
    134134            else if (!this->execCommand_->isActive())
    135135                *error = CommandExecutor::Deactivated;
     
    151151            if (this->bEvaluatedArguments_)
    152152            {
    153                 COUT(6) << "CE_execute (evaluation): " << this->execCommand_->getName() << " with " << this->numberOfEvaluatedArguments_ << " arguments: " << this->arguments_[0] << ' ' << this->arguments_[1] << ' ' << this->arguments_[2] << ' ' << this->arguments_[3] << ' ' << this->arguments_[4] << std::endl;
     153                orxout(verbose, context::commands) << "CE_execute (evaluation): " << this->execCommand_->getName() << " with " << this->numberOfEvaluatedArguments_ << " arguments: " << this->arguments_[0] << ' ' << this->arguments_[1] << ' ' << this->arguments_[2] << ' ' << this->arguments_[3] << ' ' << this->arguments_[4] << endl;
    154154
    155155                // pass as many arguments to the executor as were evaluated (thus the executor can still use additional default values)
     
    186186        {
    187187            if (bPrintError)
    188                 COUT(1) << "Error: Can't evaluate arguments, no console command assigned." << std::endl;
    189             return CommandExecutor::Error;
     188                orxout(internal_error, context::commands) << "Can't evaluate arguments, no console command assigned." << endl;
     189            return CommandExecutor::Inexistent;
    190190        }
    191191
     
    200200            this->bEvaluatedArguments_ = true;
    201201        else if (bPrintError)
    202             COUT(1) << "Error: Can't evaluate arguments, not enough arguments given." << std::endl;
     202            orxout(internal_error, context::commands) << "Can't evaluate arguments, not enough arguments given." << endl;
    203203
    204204        return error;
Note: See TracChangeset for help on using the changeset viewer.