Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2011, 3:55:35 PM (13 years ago)
Author:
landauf
Message:

adjusted output levels for ogre and cegui messages
added config value for cegui logfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/GUIManager.cc

    r8796 r8798  
    3333#include <memory>
    3434#include <boost/bind.hpp>
    35 #include <boost/preprocessor/stringize.hpp>
    3635#include <OgreRenderQueue.h>
    3736#include <OgreRenderWindow.h>
     
    9392namespace orxonox
    9493{
     94    namespace context
     95    {
     96        namespace
     97        {
     98            REGISTER_OUTPUT_CONTEXT(cegui);
     99        }
     100    }
     101
    95102    static void key_esc()
    96103        { GUIManager::getInstance().keyESC(); }
     
    107114                case CEGUI::Errors:      orxonoxLevel = level::internal_error; break;
    108115                case CEGUI::Warnings:    orxonoxLevel = level::internal_warning; break;
    109                 case CEGUI::Standard:    orxonoxLevel = level::internal_status; break;
    110                 case CEGUI::Informative: orxonoxLevel = level::internal_info; break;
    111                 case CEGUI::Insane:      orxonoxLevel = level::verbose; break;
     116                case CEGUI::Standard:    orxonoxLevel = level::verbose; break;
     117                case CEGUI::Informative: orxonoxLevel = level::verbose_more; break;
     118                case CEGUI::Insane:      orxonoxLevel = level::verbose_ultra; break;
    112119                default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
    113120            }
    114121
    115 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level (and remove boost include)")
    116             orxout(debug_output, context::cegui) << "CEGUI (level: " << level << "): " << message << endl;
     122            orxout(orxonoxLevel, context::cegui) << message << endl;
    117123
    118124            CEGUI::DefaultLogger::logEvent(message, level);
     
    302308        std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
    303309        ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log");
    304 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: inspect this (and remove boost include)")
    305 //        // Set the log level according to ours (translate by subtracting 1)
    306 //        ceguiLogger->setLoggingLevel(
    307 //            static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
     310        ceguiLogger->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
    308311        this->ceguiLogger_ = ceguiLogger.release();
    309312
     
    363366    void GUIManager::setConfigValues(void)
    364367    {
    365         SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.") .callback(this, &GUIManager::changedGUIScheme);
     368        SetConfigValue(guiScheme_, GUIManager::defaultScheme_).description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme);
    366369        SetConfigValue(numScrollLines_, 1).description("How many lines to scroll in a list if the scroll wheel is used");
     370        SetConfigValueExternal(outputLevelCeguiLog_, "OutputHandler", "outputLevelCeguiLog", CEGUI::Standard).description("The log level of the CEGUI log file").callback(this, &GUIManager::changedCeguiOutputLevel);
    367371    }
    368372
    369373    void GUIManager::changedGUIScheme(void)
    370374    {
     375    }
     376
     377    void GUIManager::changedCeguiOutputLevel()
     378    {
     379        if (this->ceguiLogger_)
     380            this->ceguiLogger_->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_));
    371381    }
    372382
Note: See TracChangeset for help on using the changeset viewer.