Changeset 8799 for code/branches/output/src/libraries/core
- Timestamp:
- Jul 30, 2011, 7:51:08 PM (13 years ago)
- Location:
- code/branches/output/src/libraries/core
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/Core.cc
r8796 r8799 50 50 # undef max 51 51 #endif 52 53 #include <boost/preprocessor/stringize.hpp>54 52 55 53 #include "util/Clock.h" … … 231 229 } 232 230 233 namespace DefaultLevelLogFile234 {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;238 }239 240 231 //! Function to collect the SetConfigValue-macro calls. 241 232 void Core::setConfigValues() 242 233 { 243 // Choose the default level according to the path Orxonox was started (build directory or not) 244 OutputLevel defaultLogLevel = (PathConfig::buildDirectoryRun() ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User); 245 246 SetConfigValueExternal(debugLevelLogFile_, "OutputHandler", "debugLevelLogFile", defaultLogLevel) 247 .description("The maximum level of debug output written to the log file"); 248 LogWriter::getInstance().setLevelMax(this->debugLevelLogFile_); 234 SetConfigValueExternal(LogWriter::getInstance().configurableMaxLevel_, 235 LogWriter::getInstance().getConfigurableSectionName(), 236 LogWriter::getInstance().getConfigurableMaxLevelName(), 237 LogWriter::getInstance().configurableMaxLevel_) 238 .description("The maximum level of output shown in the log file") 239 .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevels); 240 SetConfigValueExternal(LogWriter::getInstance().configurableContextsMaxLevel_, 241 LogWriter::getInstance().getConfigurableSectionName(), 242 LogWriter::getInstance().getConfigurableContextsMaxLevelName(), 243 LogWriter::getInstance().configurableContextsMaxLevel_) 244 .description("The maximum level of output shown in the log file for additional contexts") 245 .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevels); 246 SetConfigValueExternal(LogWriter::getInstance().configurableContexts_, 247 LogWriter::getInstance().getConfigurableSectionName(), 248 LogWriter::getInstance().getConfigurableContextsName(), 249 LogWriter::getInstance().configurableContexts_) 250 .description("Additional output contexts shown in the log file") 251 .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableContexts); 249 252 250 253 SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun()) … … 281 284 void Core::devModeChanged() 282 285 { 283 bool isNormal = (bDevMode_ == PathConfig::buildDirectoryRun());284 if (isNormal)285 {286 ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", update);287 }288 else289 {290 OutputLevel level = (bDevMode_ ? DefaultLevelLogFile::Dev : DefaultLevelLogFile::User);291 ModifyConfigValueExternal(debugLevelLogFile_, "debugLevelLogFile", tset, level);292 }293 294 286 // Inform listeners 295 287 ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin(); -
code/branches/output/src/libraries/core/Core.h
r8796 r8799 136 136 137 137 bool bGraphicsLoaded_; 138 OutputLevel debugLevelLogFile_; //!< The debug level for the log file (belongs to LogWriter)139 138 std::string language_; //!< The language 140 139 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called -
code/branches/output/src/libraries/core/GUIManager.cc
r8798 r8799 77 77 #include "util/Math.h" 78 78 #include "util/OrxAssert.h" 79 #include "util/output/BaseWriter.h" 79 80 #include "ConfigValueIncludes.h" 80 81 #include "Core.h" … … 368 369 SetConfigValue(guiScheme_, GUIManager::defaultScheme_).description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme); 369 370 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);371 SetConfigValueExternal(outputLevelCeguiLog_, BaseWriter::getConfigurableSectionName(), "outputLevelCeguiLog", CEGUI::Standard).description("The log level of the CEGUI log file").callback(this, &GUIManager::changedCeguiOutputLevel); 371 372 } 372 373 -
code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
r8797 r8799 56 56 57 57 IOConsole::IOConsole() 58 : shell_(new Shell(" IOConsole", false))58 : shell_(new Shell("Console", false)) 59 59 , buffer_(shell_->getInputBuffer()) 60 60 , cout_(std::cout.rdbuf()) -
code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
r8797 r8799 44 44 //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode 45 45 IOConsole::IOConsole() 46 : shell_(new Shell(" IOConsole", false))46 : shell_(new Shell("Console", false)) 47 47 , buffer_(shell_->getInputBuffer()) 48 48 , cout_(std::cout.rdbuf()) -
code/branches/output/src/libraries/core/command/Shell.cc
r8795 r8799 56 56 unsigned int Shell::cacheSize_s; 57 57 58 namespace DefaultLogLevel 59 { 60 const OutputLevel Dev = level::internal_warning; 61 const OutputLevel User = level::user_info; 62 } 63 58 64 /** 59 65 @brief Constructor: Initializes the values. … … 62 68 */ 63 69 Shell::Shell(const std::string& consoleName, bool bScrollable) 64 : inputBuffer_(new InputBuffer())65 , consoleName_(consoleName)70 : BaseWriter(consoleName) 71 , inputBuffer_(new InputBuffer()) 66 72 , bScrollable_(bScrollable) 67 73 { … … 79 85 ConfigFileManager::getInstance().setFilename(ConfigFileType::CommandHistory, "commandHistory.ini"); 80 86 87 // Choose the default level according to the path Orxonox was started (build directory or not) 88 OutputLevel defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User); 89 this->setLevelMax(defaultDebugLevel); 90 81 91 this->setConfigValues(); 82 92 … … 91 101 { 92 102 this->inputBuffer_->destroy(); 93 }94 95 namespace DefaultLogLevel96 {97 const OutputLevel Dev = level::internal_warning;98 const OutputLevel User = level::user_info;99 103 } 100 104 … … 111 115 SetConfigValue(cacheSize_s, 32); 112 116 113 // Choose the default level according to the path Orxonox was started (build directory or not) 114 OutputLevel defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User); 115 SetConfigValueExternal(debugLevel_, "OutputHandler", "debugLevel" + consoleName_, defaultDebugLevel) 116 .description("The maximum level of debug output shown in the " + consoleName_); 117 this->setLevelMax(this->debugLevel_); 117 SetConfigValueExternal(this->configurableMaxLevel_, 118 this->getConfigurableSectionName(), 119 this->getConfigurableMaxLevelName(), 120 this->configurableMaxLevel_) 121 .description("The maximum level of output shown in the " + this->getName()) 122 .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevels); 123 SetConfigValueExternal(this->configurableContextsMaxLevel_, 124 this->getConfigurableSectionName(), 125 this->getConfigurableContextsMaxLevelName(), 126 this->configurableContextsMaxLevel_) 127 .description("The maximum level of output shown in the " + this->getName() + " for additional contexts") 128 .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevels); 129 SetConfigValueExternal(this->configurableContexts_, 130 this->getConfigurableSectionName(), 131 this->getConfigurableContextsName(), 132 this->configurableContexts_) 133 .description("Additional output contexts shown in the " + this->getName()) 134 .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevels); 118 135 } 119 136 … … 150 167 if (isNormal) 151 168 { 152 ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, update);169 ModifyConfigValueExternal(debugLevel_, this->getConfigurableMaxLevelName(), update); 153 170 } 154 171 else 155 172 { 156 173 OutputLevel level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User); 157 ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, tset, level);174 ModifyConfigValueExternal(debugLevel_, this->getConfigurableMaxLevelName(), tset, level); 158 175 } 159 176 } -
code/branches/output/src/libraries/core/command/Shell.h
r8797 r8799 191 191 unsigned int scrollPosition_; ///< The number of the line that is currently being referenced by scrollIterator_ 192 192 unsigned int historyPosition_; ///< If the user scrolls through the history of entered commands (stored in commandHistory_), this contains the currently viewed history entry 193 194 const std::string consoleName_; ///< The name of this shell - used to define the name of the soft-debug-level config-value195 193 const bool bScrollable_; ///< If true, the user can scroll through the output-lines 196 194
Note: See TracChangeset
for help on using the changeset viewer.