Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 12, 2011, 12:26:40 AM (13 years ago)
Author:
landauf
Message:

added flag to disable automatic registration of output listeners. avoids crash during creation of a Shell if some verbose context (object_list?) is activated.
different handling of sub-contexts whose main-context is also explicitly registered (even though that's not the intended way to use)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/util/output/BaseWriter.cc

    r8833 r8834  
    3333namespace orxonox
    3434{
    35     BaseWriter::BaseWriter(const std::string& name)
     35    BaseWriter::BaseWriter(const std::string& name, bool bRegister) : OutputListener(bRegister)
    3636    {
    3737        this->name_ = name;
     
    4242
    4343        this->subcontextsCheckMask_ = context::none;
     44        this->subcontextsNoCheckMask_ = context::none;
    4445
    4546        this->changedConfigurableLevel();
     
    5455    void BaseWriter::output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines)
    5556    {
    56         if (((this->subcontextsCheckMask_ & context.mask) == 0) || (this->subcontexts_.find(context.sub_id) != this->subcontexts_.end()))
     57        if (((this->subcontextsCheckMask_ & context.mask) == 0) ||
     58            (this->subcontextsNoCheckMask_ & context.mask) ||
     59            (this->subcontexts_.find(context.sub_id) != this->subcontexts_.end()))
    5760        {
    5861            const std::string& prefix = OutputManager::getInstance().getDefaultPrefix(level, context);
     
    9093        OutputContextMask context_mask = context::none;
    9194        this->subcontextsCheckMask_ = context::none;
     95        this->subcontextsNoCheckMask_ = context::none;
    9296
    9397        this->subcontexts_.clear();
    94         this->subcontexts_.insert(context::no_subcontext);
    9598
    9699        for (size_t i = 0; i < this->configurableAdditionalContexts_.size(); ++i)
     
    117120                this->subcontextsCheckMask_ |= container.mask;
    118121            }
     122            else
     123            {
     124                this->subcontextsNoCheckMask_ |= container.mask;
     125            }
    119126        }
    120127
Note: See TracChangeset for help on using the changeset viewer.