Changeset 8808 for code/branches/output/src/libraries/util
- Timestamp:
- Jul 31, 2011, 11:42:55 PM (13 years ago)
- Location:
- code/branches/output/src/libraries/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/util/Output.h
r8787 r8808 37 37 // Just for convenience 38 38 using std::endl; 39 using namespace level;40 39 41 40 inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContext context = context::undefined()) -
code/branches/output/src/libraries/util/output/BaseWriter.cc
r8799 r8808 65 65 void BaseWriter::changedConfigurableLevels() 66 66 { 67 OutputLevelmax_level = std::max(this->configurableMaxLevel_, this->configurableContextsMaxLevel_);68 OutputListener::setLevelMax( max_level);67 int max_level = std::max(this->configurableMaxLevel_, this->configurableContextsMaxLevel_); 68 OutputListener::setLevelMax(static_cast<OutputLevel>(max_level)); 69 69 } 70 70 -
code/branches/output/src/libraries/util/output/BaseWriter.h
r8799 r8808 50 50 void setLevelMax(OutputLevel max); 51 51 52 OutputLevelconfigurableMaxLevel_;52 int configurableMaxLevel_; 53 53 inline std::string getConfigurableMaxLevelName() const 54 54 { return "outputLevel" + this->name_; } 55 55 56 OutputLevelconfigurableContextsMaxLevel_;56 int configurableContextsMaxLevel_; 57 57 inline std::string getConfigurableContextsMaxLevelName() const 58 58 { return "outputContextsLevel" + this->name_; } -
code/branches/output/src/libraries/util/output/OutputDefinitions.h
r8807 r8808 38 38 namespace orxonox 39 39 { 40 typedef uint16_t OutputLevel;41 42 40 namespace level 43 41 { 44 static const OutputLevel all = 0xFFFF; 45 static const OutputLevel none = 0x0000; 42 enum OutputLevel 43 { 44 all = 0xFFFF, 45 none = 0x0000, 46 46 47 static const OutputLevel message = 0x0001; 48 static const OutputLevel debug_output = 0x0002; 49 static const OutputLevel user_error = 0x0004; 50 static const OutputLevel user_warning = 0x0008; 51 static const OutputLevel user_status = 0x0010; 52 static const OutputLevel user_info = 0x0020; 53 static const OutputLevel internal_error = 0x0040; 54 static const OutputLevel internal_warning = 0x0080; 55 static const OutputLevel internal_status = 0x0100; 56 static const OutputLevel internal_info = 0x0200; 57 static const OutputLevel verbose = 0x0400; 58 static const OutputLevel verbose_more = 0x0800; 59 static const OutputLevel verbose_ultra = 0x1000; 47 message = 0x0001, 48 debug_output = 0x0002, 49 user_error = 0x0004, 50 user_warning = 0x0008, 51 user_status = 0x0010, 52 user_info = 0x0020, 53 internal_error = 0x0040, 54 internal_warning = 0x0080, 55 internal_status = 0x0100, 56 internal_info = 0x0200, 57 verbose = 0x0400, 58 verbose_more = 0x0800, 59 verbose_ultra = 0x1000 60 }; 60 61 } 62 63 using namespace level; 61 64 62 65 typedef uint64_t OutputContext; -
code/branches/output/src/libraries/util/output/OutputListener.cc
r8787 r8808 48 48 void OutputListener::setLevelMax(OutputLevel max) 49 49 { 50 this->setLevelRange( level::debug_output, max);50 this->setLevelRange(static_cast<OutputLevel>(0x1), max); 51 51 } 52 52 53 53 void OutputListener::setLevelRange(OutputLevel min, OutputLevel max) 54 54 { 55 OutputLevel mask = 0; 56 57 for (OutputLevel level = min; level <= max; level = level << 1) 55 int mask = 0; 56 for (int level = min; level <= max; level = level << 1) 58 57 mask |= level; 59 58 60 this->setLevelMask( mask);59 this->setLevelMask(static_cast<OutputLevel>(mask)); 61 60 } 62 61 -
code/branches/output/src/libraries/util/output/OutputManager.cc
r8805 r8808 38 38 OutputManager::OutputManager() 39 39 { 40 this->combinedLevelMask_ = 0;40 this->combinedLevelMask_ = level::none; 41 41 this->combinedContextMask_ = 0; 42 42 } … … 99 99 void OutputManager::updateCombinedLevelMask() 100 100 { 101 this->combinedLevelMask_= 0;101 int mask = 0; 102 102 for (size_t i = 0; i < this->listeners_.size(); ++i) 103 this->combinedLevelMask_ |= this->listeners_[i]->getLevelMask(); 103 mask |= this->listeners_[i]->getLevelMask(); 104 this->combinedLevelMask_ = static_cast<OutputLevel>(mask); 104 105 } 105 106
Note: See TracChangeset
for help on using the changeset viewer.