Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 31, 2011, 11:42:55 PM (13 years ago)
Author:
landauf
Message:

Removed debugLevel_ from Shell, using correct variable inherited from BaseWriter as config value.
Fixed OutputListener::setLevelMax() which ignored the new output level "message".
Fixed using a boolean called "verbose" instead of the output level with the same name in Loader.
Preventing further problems of this kind by defining OutputLevel as an enum.

Location:
code/branches/output/src/libraries/util
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/util/Output.h

    r8787 r8808  
    3737    // Just for convenience
    3838    using std::endl;
    39     using namespace level;
    4039
    4140    inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContext context = context::undefined())
  • code/branches/output/src/libraries/util/output/BaseWriter.cc

    r8799 r8808  
    6565    void BaseWriter::changedConfigurableLevels()
    6666    {
    67         OutputLevel max_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));
    6969    }
    7070
  • code/branches/output/src/libraries/util/output/BaseWriter.h

    r8799 r8808  
    5050            void setLevelMax(OutputLevel max);
    5151
    52             OutputLevel configurableMaxLevel_;
     52            int configurableMaxLevel_;
    5353            inline std::string getConfigurableMaxLevelName() const
    5454                { return "outputLevel" + this->name_; }
    5555
    56             OutputLevel configurableContextsMaxLevel_;
     56            int configurableContextsMaxLevel_;
    5757            inline std::string getConfigurableContextsMaxLevelName() const
    5858                { return "outputContextsLevel" + this->name_; }
  • code/branches/output/src/libraries/util/output/OutputDefinitions.h

    r8807 r8808  
    3838namespace orxonox
    3939{
    40     typedef uint16_t OutputLevel;
    41 
    4240    namespace level
    4341    {
    44         static const OutputLevel all              = 0xFFFF;
    45         static const OutputLevel none             = 0x0000;
     42        enum OutputLevel
     43        {
     44            all              = 0xFFFF,
     45            none             = 0x0000,
    4646
    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        };
    6061    }
     62
     63    using namespace level;
    6164
    6265    typedef uint64_t OutputContext;
  • code/branches/output/src/libraries/util/output/OutputListener.cc

    r8787 r8808  
    4848    void OutputListener::setLevelMax(OutputLevel max)
    4949    {
    50         this->setLevelRange(level::debug_output, max);
     50        this->setLevelRange(static_cast<OutputLevel>(0x1), max);
    5151    }
    5252
    5353    void OutputListener::setLevelRange(OutputLevel min, OutputLevel max)
    5454    {
    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)
    5857            mask |= level;
    5958
    60         this->setLevelMask(mask);
     59        this->setLevelMask(static_cast<OutputLevel>(mask));
    6160    }
    6261
  • code/branches/output/src/libraries/util/output/OutputManager.cc

    r8805 r8808  
    3838    OutputManager::OutputManager()
    3939    {
    40         this->combinedLevelMask_ = 0;
     40        this->combinedLevelMask_ = level::none;
    4141        this->combinedContextMask_ = 0;
    4242    }
     
    9999    void OutputManager::updateCombinedLevelMask()
    100100    {
    101         this->combinedLevelMask_ = 0;
     101        int mask = 0;
    102102        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);
    104105    }
    105106
Note: See TracChangeset for help on using the changeset viewer.