- Timestamp:
- May 21, 2011, 4:23:19 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/unity_build/src/libraries/core/command/Shell.cc
r8518 r8524 40 40 #include "core/ConfigFileManager.h" 41 41 #include "core/ConfigValueIncludes.h" 42 #include "core/PathConfig.h" 42 43 #include "CommandExecutor.h" 43 44 #include "ConsoleCommand.h" … … 87 88 for (;it != OutputHandler::getInstance().getOutput().end(); ++it) 88 89 { 89 if (it->first <= this->getSoftDebugLevel())90 if (it->first <= debugLevel_) 90 91 { 91 92 this->outputBuffer_ << it->second; … … 96 97 // Register the shell as output listener 97 98 OutputHandler::getInstance().registerOutputListener(this); 99 OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_); 98 100 } 99 101 … … 105 107 OutputHandler::getInstance().unregisterOutputListener(this); 106 108 this->inputBuffer_->destroy(); 109 } 110 111 namespace DefaultLogLevel 112 { 113 const OutputLevel::Value Dev = OutputLevel::Info; 114 const OutputLevel::Value User = OutputLevel::Error; 107 115 } 108 116 … … 118 126 setConfigValueGeneric(this, &commandHistory_, ConfigFileType::CommandHistory, "Shell", "commandHistory_", std::vector<std::string>()); 119 127 SetConfigValue(cacheSize_s, 32); 128 129 // Choose the default level according to the path Orxonox was started (build directory or not) 130 OutputLevel::Value defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User); 131 SetConfigValueExternal(debugLevel_, "OutputHandler", "debugLevel" + consoleName_, defaultDebugLevel) 132 .description("The maximum level of debug output shown in the " + consoleName_); 133 OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_); 120 134 } 121 135 … … 141 155 this->commandHistory_.erase(this->commandHistory_.begin() + index); 142 156 ModifyConfigValue(commandHistory_, remove, index); 157 } 158 } 159 160 /** Called upon changes in the development mode (by Core) 161 Behaviour details see Core::devModeChanged. 162 */ 163 void Shell::devModeChanged(bool value) 164 { 165 bool isNormal = (value == PathConfig::buildDirectoryRun()); 166 if (isNormal) 167 { 168 ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, update); 169 } 170 else 171 { 172 OutputLevel::Value level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User); 173 ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, tset, level); 143 174 } 144 175 }
Note: See TracChangeset
for help on using the changeset viewer.