Changeset 8524 for code/branches/unity_build/src/libraries/core/Core.cc
- Timestamp:
- May 21, 2011, 4:23:19 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/unity_build/src/libraries/core/Core.cc
r8520 r8524 69 69 #include "Language.h" 70 70 #include "LuaState.h" 71 #include "ObjectList.h" 71 72 #include "command/ConsoleCommand.h" 72 73 #include "command/IOConsole.h" … … 229 230 } 230 231 231 namespace DefaultLogLevels 232 { 233 struct List 234 { 235 OutputLevel::Value logFile; 236 OutputLevel::Value ioConsole; 237 OutputLevel::Value inGameConsole; 238 }; 239 240 using namespace OutputLevel; 241 static const List Dev = { Debug, Info, Info }; 242 static const List User = { Info, Error, Error }; 232 namespace DefaultLevelLogFile 233 { 234 const OutputLevel::Value Dev = OutputLevel::Debug; 235 const OutputLevel::Value User = OutputLevel::Info; 243 236 } 244 237 … … 246 239 void Core::setConfigValues() 247 240 { 248 // Choose the default level saccording to the path Orxonox was started (build directory or not)249 DefaultLogLevels::List defaultLogLevels = (PathConfig::buildDirectoryRun() ? DefaultLogLevels::Dev : DefaultLogLevels::User);250 251 SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile _", defaultLogLevels.logFile)241 // Choose the default level according to the path Orxonox was started (build directory or not) 242 OutputLevel::Value defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User); 243 244 SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile", defaultLogLevel) 252 245 .description("The maximum level of debug output written to the log file"); 253 246 OutputHandler::getInstance().setSoftDebugLevel("LogFile", debugLevelLogFile_); 254 255 SetConfigValueExternal(debugLevelIOConsole_, "OutputHandler", "debugLevelIOConsole_", defaultLogLevels.ioConsole)256 .description("The maximum level of debug output shown in the IO console");257 OutputHandler::getInstance().setSoftDebugLevel("IOConsole", debugLevelIOConsole_);258 // In case we don't start the IOConsole, also configure that simple listener259 OutputHandler::getInstance().setSoftDebugLevel("Console", debugLevelIOConsole_);260 261 SetConfigValueExternal(debugLevelIOConsole_, "OutputHandler", "debugLevelInGameConsole_", defaultLogLevels.inGameConsole)262 .description("The maximum level of debug output shown in the in-game console");263 OutputHandler::getInstance().setSoftDebugLevel("InGameConsole", debugLevelInGameConsole_);264 247 265 248 SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun()) … … 290 273 immediately change the debug levels to predefined values which can be 291 274 reconfigured with \c tconfig. 275 @note 276 The debug levels for the IOConsole and the InGameConsole can be found 277 in the Shell class. The same rules apply. 292 278 */ 293 279 void Core::devModeChanged() … … 296 282 if (isNormal) 297 283 { 298 ModifyConfigValue(debugLevelLogFile_, update); 299 ModifyConfigValue(debugLevelIOConsole_, update); 300 ModifyConfigValue(debugLevelInGameConsole_, update); 284 ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", update); 301 285 } 302 286 else 303 287 { 304 DefaultLogLevels::List levels = (bDevMode_ ? DefaultLogLevels::Dev : DefaultLogLevels::User); 305 ModifyConfigValue(debugLevelLogFile_, tset, levels.logFile); 306 ModifyConfigValue(debugLevelIOConsole_, tset, levels.ioConsole); 307 ModifyConfigValue(debugLevelInGameConsole_, tset, levels.inGameConsole); 308 } 288 OutputLevel::Value level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User); 289 ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level); 290 } 291 292 // Inform listeners 293 ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin(); 294 for (; it != ObjectList<DevModeListener>::end(); ++it) 295 it->devModeChanged(bDevMode_); 309 296 } 310 297 … … 491 478 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL))); 492 479 } 480 481 482 DevModeListener::DevModeListener() 483 { 484 RegisterRootObject(DevModeListener); 485 } 493 486 }
Note: See TracChangeset
for help on using the changeset viewer.