Changeset 8796
- Timestamp:
- Jul 30, 2011, 12:54:55 AM (13 years ago)
- Location:
- code/branches/output/src/libraries
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/Core.cc
r8788 r8796 51 51 #endif 52 52 53 #include <boost/preprocessor/stringize.hpp> 54 53 55 #include "util/Clock.h" 54 56 #include "util/Output.h" 55 57 #include "util/Exception.h" 58 #include "util/output/LogWriter.h" 56 59 #include "util/Scope.h" 57 60 #include "util/ScopedSingletonManager.h" … … 142 145 this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log"); 143 146 144 // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% (Windows) was used145 OutputHandler::getInstance().setLogPath(PathConfig::getLogPathString());146 147 147 #ifdef ORXONOX_PLATFORM_WINDOWS 148 148 // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump … … 166 166 RegisterRootObject(Core); 167 167 this->setConfigValues(); 168 // Rewrite the log file with the correct log levels 169 OutputHandler::getInstance().rewriteLogFile(); 168 169 // Set the correct log path and rewrite the log file with the correct log levels 170 LogWriter::getInstance().setLogPath(PathConfig::getLogPathString()); 170 171 171 172 #if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN) … … 232 233 namespace DefaultLevelLogFile 233 234 { 234 const OutputLevel::Value Dev = OutputLevel::Debug; 235 const OutputLevel::Value User = OutputLevel::Info; 235 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: inspect this (and remove boost include)") 236 const OutputLevel Dev = level::internal_info; 237 const OutputLevel User = level::internal_info; 236 238 } 237 239 … … 240 242 { 241 243 // Choose the default level according to the path Orxonox was started (build directory or not) 242 OutputLevel ::ValuedefaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);244 OutputLevel defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User); 243 245 244 246 SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile", defaultLogLevel) 245 247 .description("The maximum level of debug output written to the log file"); 246 OutputHandler::getInstance().setSoftDebugLevel("LogFile",debugLevelLogFile_);248 LogWriter::getInstance().setLevelMax(this->debugLevelLogFile_); 247 249 248 250 SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun()) … … 286 288 else 287 289 { 288 OutputLevel ::Valuelevel = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);290 OutputLevel level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User); 289 291 ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level); 290 292 } -
code/branches/output/src/libraries/core/Core.h
r8729 r8796 136 136 137 137 bool bGraphicsLoaded_; 138 int debugLevelLogFile_; //!< The debug level for the log file (belongs to OutputHandler)138 OutputLevel debugLevelLogFile_; //!< The debug level for the log file (belongs to LogWriter) 139 139 std::string language_; //!< The language 140 140 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called -
code/branches/output/src/libraries/core/GUIManager.cc
r8788 r8796 33 33 #include <memory> 34 34 #include <boost/bind.hpp> 35 #include <boost/preprocessor/stringize.hpp> 35 36 #include <OgreRenderQueue.h> 36 37 #include <OgreRenderWindow.h> … … 101 102 void logEvent(const CEGUI::String& message, CEGUI::LoggingLevel level = CEGUI::Standard) 102 103 { 103 int orxonoxLevel = CEGUI::Standard;104 OutputLevel orxonoxLevel = level::debug_output; 104 105 switch (level) 105 106 { 106 case CEGUI::Errors: orxonoxLevel = 1; break;107 case CEGUI::Warnings: orxonoxLevel = 2; break;108 case CEGUI::Standard: orxonoxLevel = 4; break;109 case CEGUI::Informative: orxonoxLevel = 5; break;110 case CEGUI::Insane: orxonoxLevel = 6; break;107 case CEGUI::Errors: orxonoxLevel = level::internal_error; break; 108 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; 111 112 default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!"); 112 113 } 113 OutputHandler::getOutStream(orxonoxLevel) 114 << "CEGUI: " << message << std::endl; 114 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; 115 117 116 118 CEGUI::DefaultLogger::logEvent(message, level); … … 263 265 264 266 this->oldCEGUI_ = false; 265 267 266 268 // Note: No SceneManager specified yet 267 269 #ifdef ORXONOX_OLD_CEGUI … … 300 302 std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger()); 301 303 ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log"); 302 // Set the log level according to ours (translate by subtracting 1) 303 ceguiLogger->setLoggingLevel( 304 static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1)); 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)); 305 308 this->ceguiLogger_ = ceguiLogger.release(); 306 309 -
code/branches/output/src/libraries/core/GraphicsManager.cc
r8423 r8796 35 35 #include <boost/filesystem.hpp> 36 36 #include <boost/shared_array.hpp> 37 #include <boost/preprocessor/stringize.hpp> 37 38 38 39 #include <OgreFrameListener.h> … … 396 397 Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName) 397 398 { 398 intorxonoxLevel;399 OutputLevel orxonoxLevel; 399 400 std::string introduction; 400 401 // Do not show caught OGRE exceptions in front 401 402 if (message.find("EXCEPTION") != std::string::npos) 402 403 { 403 orxonoxLevel = OutputLevel::Debug;404 orxonoxLevel = level::internal_error; 404 405 introduction = "Ogre, caught exception: "; 405 406 } … … 418 419 break; 419 420 default: 420 orxonoxLevel = 0;421 orxonoxLevel = level::debug_output; 421 422 } 422 423 introduction = "Ogre: "; 423 424 } 424 OutputHandler::getOutStream(orxonoxLevel)425 << introduction << message << std::endl;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 } 427 428 -
code/branches/output/src/libraries/core/LuaState.cc
r8788 r8796 36 36 } 37 37 #include <loki/ScopeGuard.h> 38 #include <boost/preprocessor/stringize.hpp> 38 39 39 40 #include "util/Output.h" … … 238 239 void LuaState::luaLog(unsigned int level, const std::string& message) 239 240 { 240 OutputHandler::getOutStream(level) << message << std::endl; 241 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level (and remove boost include)") 242 orxout(debug_output, context::lua) << "luaLog (level: " << level << "): " << message << endl; 241 243 } 242 244 -
code/branches/output/src/libraries/util/output/OutputDefinitions.h
r8789 r8796 75 75 REGISTER_OUTPUT_CONTEXT(test2); 76 76 REGISTER_OUTPUT_CONTEXT(output); 77 REGISTER_OUTPUT_CONTEXT(cegui); 78 REGISTER_OUTPUT_CONTEXT(ogre); 79 REGISTER_OUTPUT_CONTEXT(lua); 80 REGISTER_OUTPUT_CONTEXT(tcl); 77 81 } 78 82 }
Note: See TracChangeset
for help on using the changeset viewer.