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/pickup/PickupSpawner.cc

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