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:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/tools/BillboardSet.cc

    r6417 r8858  
    8080        catch (...)
    8181        {
    82             COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
     82            orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl;
    8383            this->billboardSet_ = 0;
    8484        }
     
    103103        catch (...)
    104104        {
    105             COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
     105            orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl;
    106106            this->billboardSet_ = 0;
    107107        }
  • code/trunk/src/libraries/tools/Mesh.cc

    r8351 r8858  
    7272            catch (...)
    7373            {
    74                 COUT(1) << "Error: Couln't load mesh \"" << meshsource << '"' << std::endl;
     74                orxout(internal_error) << "Couldn't load mesh \"" << meshsource << '"' << endl;
    7575                this->entity_ = 0;
    7676            }
  • code/trunk/src/libraries/tools/ParticleInterface.cc

    r7166 r8858  
    7878            catch (...)
    7979            {
    80                 COUT(1) << "Error: Couln't load particle system \"" << templateName << '"' << std::endl;
     80                orxout(internal_error) << "Couldn't load particle system \"" << templateName << '"' << endl;
    8181                this->particleSystem_ = 0;
    8282            }
  • code/trunk/src/libraries/tools/ResourceCollection.cc

    r8351 r8858  
    6262        if (resourceGroup.empty())
    6363        {
    64             COUT(2) << "Warning: \"\" is not a valid resource group." << std::endl;
     64            orxout(internal_warning) << "\"\" is not a valid resource group." << endl;
    6565            return;
    6666        }
  • code/trunk/src/libraries/tools/ResourceLocation.cc

    r8366 r8858  
    8080        else
    8181        {
    82             COUT(2) << "Warning: ResourceLocation '" << this->getPath() << "' does not seem to exist" << std::endl;
     82            orxout(internal_warning) << "ResourceLocation '" << this->getPath() << "' does not seem to exist" << endl;
    8383            return;
    8484        }
     
    101101        catch (const Ogre::Exception& ex)
    102102        {
    103             COUT(1) << "Removing of a ResourceLocation failed: " << ex.what() << std::endl;
     103            orxout(internal_error) << "Removing of a ResourceLocation failed: " << ex.what() << endl;
    104104        }
    105105    }
  • code/trunk/src/libraries/tools/Shader.cc

    r8079 r8858  
    141141                }
    142142                else
    143                     COUT(2) << "Warning: Couldn't load compositor with name \"" << this->compositorName_ << "\"." << std::endl;
     143                    orxout(internal_warning) << "Couldn't load compositor with name \"" << this->compositorName_ << "\"." << endl;
    144144            }
    145145            this->oldcompositorName_ = this->compositorName_;
     
    217217                }
    218218                else
    219                     COUT(2) << "Warning: No pass " << it->pass_ << " in technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << std::endl;
     219                    orxout(internal_warning) << "No pass " << it->pass_ << " in technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
    220220            }
    221221            else
    222                 COUT(2) << "Warning: No technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << std::endl;
     222                orxout(internal_warning) << "No technique " << it->technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
    223223        }
    224224        this->parameters_.clear();
  • code/trunk/src/libraries/tools/Timer.h

    r8729 r8858  
    6666    void MyClass::myFunction()
    6767    {
    68         COUT(0) << "Hello World" << std::endl;
     68        orxout() << "Hello World" << endl;
    6969    }
    7070    @endcode
Note: See TracChangeset for help on using the changeset viewer.