Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 23, 2011, 12:45:53 AM (14 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/SubclassIdentifier.h

    r7401 r8858  
    6969
    7070#include <cstdlib>
    71 #include "util/Debug.h"
     71#include "util/Output.h"
    7272#include "Identifier.h"
    7373
     
    119119                if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
    120120                {
    121                     COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
     121                    orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
    122122                    if (identifier)
    123123                    {
    124                         COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
    125                         COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
     124                        orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
     125                        orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
    126126                    }
    127127                    else
    128128                    {
    129                         COUT(1) << "Error: Can't assign NULL identifier" << std::endl;
     129                        orxout(internal_error) << "Can't assign NULL identifier" << endl;
    130130                    }
    131131                }
     
    177177                    if (this->identifier_)
    178178                    {
    179                         COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    180                         COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << std::endl;
    181                         COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
     179                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
     180                        orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
     181                        orxout(user_error) << "Couldn't fabricate a new Object." << endl;
    182182                    }
    183183                    else
    184184                    {
    185                         COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    186                         COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
    187                     }
    188 
    189                     COUT(1) << "Aborting..." << std::endl;
     185                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
     186                        orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
     187                    }
     188
     189                    orxout(user_error) << "Aborting..." << endl;
    190190                    abort();
    191191                    return 0;
Note: See TracChangeset for help on using the changeset viewer.