Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8798 for code/branches/output


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

Location:
code/branches/output/src/libraries
Files:
5 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
  • code/branches/output/src/libraries/core/GUIManager.h

    r8729 r8798  
    152152        bool protectedCall(FunctionType function);
    153153
     154        void changedCeguiOutputLevel();
     155
    154156        // keyHandler functions
    155157        void buttonPressed (const KeyEvent& evt);
     
    168170
    169171#ifdef ORXONOX_OLD_CEGUI
    170         CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    171         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
     172        CEGUI::OgreCEGUIRenderer*            guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
     173        CEGUI::ResourceProvider*             resourceProvider_;     //!< CEGUI's resource provider
    172174#else
    173         CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    174         CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
    175         Ogre::RenderQueueListener*           rqListener_;       //!< RQ listener so we can draw UNDER Ogre overlays
     175        CEGUI::OgreRenderer*                 guiRenderer_;          //!< CEGUI's interface to the Ogre Engine
     176        CEGUI::OgreResourceProvider*         resourceProvider_;     //!< CEGUI's resource provider
     177        Ogre::RenderQueueListener*           rqListener_;           //!< RQ listener so we can draw UNDER Ogre overlays
    176178        CEGUI::OgreImageCodec*               imageCodec_;
    177179#endif
    178         LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
    179         CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
    180         CEGUI::System*                       guiSystem_;        //!< CEGUI's main system
    181         shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    182         CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    183         CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
    184         CEGUI::Window*                       hudRootWindow_;    //!< Root node for the HUD sheets
    185         CEGUI::Window*                       menuRootWindow_;   //!< Root node for the menu sheets (used by Lua)
    186         std::map<std::string, PlayerInfo*>   players_;          //!< Stores the player (owner) for each GUI
    187         Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
     180        LuaState*                            luaState_;             //!< LuaState, access point to the Lua engine
     181        CEGUI::LuaScriptModule*              scriptModule_;         //!< CEGUI's script module to use Lua
     182        CEGUI::System*                       guiSystem_;            //!< CEGUI's main system
     183        shared_ptr<ResourceInfo>             rootFileInfo_;         //!< Resource information about the root script
     184        CEGUI::Logger*                       ceguiLogger_;          //!< CEGUI's logger to be able to log CEGUI errors in our log
     185        int                                  outputLevelCeguiLog_;  //!< CEGUI's log level
     186        CEGUI::Window*                       rootWindow_;           //!< Root node for all windows
     187        CEGUI::Window*                       hudRootWindow_;        //!< Root node for the HUD sheets
     188        CEGUI::Window*                       menuRootWindow_;       //!< Root node for the menu sheets (used by Lua)
     189        std::map<std::string, PlayerInfo*>   players_;              //!< Stores the player (owner) for each GUI
     190        Ogre::Camera*                        camera_;               //!< Camera used to render the scene with the GUI
    188191
    189192        /// Helper object that executes the surrogate destructor destroy()
    190193        DestructionHelper<GUIManager>        destructionHelper_;
    191194
    192         static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
     195        static GUIManager*                   singletonPtr_s;        //!< Singleton reference to GUIManager
    193196
    194197        // The used CEGUI scheme.
     
    196199        std::string guiScheme_;
    197200        bool oldCEGUI_;
    198        
     201
    199202        int numScrollLines_; ///< How many lines to scroll in a list if the scroll wheel is used
    200203
  • code/branches/output/src/libraries/core/GraphicsManager.cc

    r8796 r8798  
    3535#include <boost/filesystem.hpp>
    3636#include <boost/shared_array.hpp>
    37 #include <boost/preprocessor/stringize.hpp>
    3837
    3938#include <OgreFrameListener.h>
     
    6968namespace orxonox
    7069{
     70    namespace context
     71    {
     72        namespace
     73        {
     74            REGISTER_OUTPUT_CONTEXT(ogre);
     75        }
     76    }
     77
    7178    static const std::string __CC_GraphicsManager_group = "GraphicsManager";
    7279    static const std::string __CC_setScreenResolution_name = "setScreenResolution";
     
    159166        SetConfigValue(ogreLogFile_,     "ogre.log")
    160167            .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
    161         SetConfigValue(ogreLogLevelTrivial_ , 5)
    162             .description("Corresponding orxonox debug level for ogre Trivial");
    163         SetConfigValue(ogreLogLevelNormal_  , 4)
    164             .description("Corresponding orxonox debug level for ogre Normal");
    165         SetConfigValue(ogreLogLevelCritical_, 2)
    166             .description("Corresponding orxonox debug level for ogre Critical");
    167168    }
    168169
     
    410411            {
    411412            case Ogre::LML_TRIVIAL:
    412                 orxonoxLevel = this->ogreLogLevelTrivial_;
     413                orxonoxLevel = level::verbose_more;
    413414                break;
    414415            case Ogre::LML_NORMAL:
    415                 orxonoxLevel = this->ogreLogLevelNormal_;
     416                orxonoxLevel = level::verbose;
    416417                break;
    417418            case Ogre::LML_CRITICAL:
    418                 orxonoxLevel = this->ogreLogLevelCritical_;
     419                orxonoxLevel = level::internal_warning;
    419420                break;
    420421            default:
     
    423424            introduction = "Ogre: ";
    424425        }
    425 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level, also for config values (and remove boost include)")
    426         orxout(debug_output, context::ogre) << "ogre (level: " << lml << "): " << introduction << message << endl;
     426
     427        orxout(orxonoxLevel, context::ogre) << introduction << message << endl;
    427428    }
    428429
  • code/branches/output/src/libraries/core/GraphicsManager.h

    r8706 r8798  
    134134        std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
    135135        std::string         ogreLogFile_;              //!< log filename for Ogre log messages
    136         int                 ogreLogLevelTrivial_;      //!< Corresponding Orxonox debug level for LL_TRIVIAL
    137         int                 ogreLogLevelNormal_;       //!< Corresponding Orxonox debug level for LL_NORMAL
    138         int                 ogreLogLevelCritical_;     //!< Corresponding Orxonox debug level for LL_CRITICAL
    139136
    140137        /// Helper object that executes the surrogate destructor destroy()
  • code/branches/output/src/libraries/util/output/OutputDefinitions.h

    r8796 r8798  
    7575            REGISTER_OUTPUT_CONTEXT(test2);
    7676            REGISTER_OUTPUT_CONTEXT(output);
    77             REGISTER_OUTPUT_CONTEXT(cegui);
    78             REGISTER_OUTPUT_CONTEXT(ogre);
    7977            REGISTER_OUTPUT_CONTEXT(lua);
    8078            REGISTER_OUTPUT_CONTEXT(tcl);
Note: See TracChangeset for help on using the changeset viewer.