Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 11, 2011, 11:20:39 PM (13 years ago)
Author:
landauf
Message:

A context is now defined by a struct instead of only a mask.

Introduced sub-contexts. Sub-contexts of the same main-context share the same mask, but have a different ID.
Main-contexts are filtered using a bitmask which happens for every line of output and is very fast.
Sub-contexts are filtered using a set which is slow but happens only if a specific sub-context is enabled in the config file which is usually not the case.

The concept of filtering normal output + additional contexts was moved from BaseWriter directly to OutputListener and OutputManager which makes the whole system faster.
BaseWriter now calls registerContext() for each configured output context, which basically allows the usage of more than 64 contexts as long as these contexts are not used before loading the config file. Though by design it's not recommended.

Location:
code/branches/output/src/libraries/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/Core.cc

    r8830 r8833  
    263263                               LogWriter::getInstance().configurableMaxLevel_)
    264264            .description("The maximum level of output shown in the log file")
    265             .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevels);
    266         SetConfigValueExternal(LogWriter::getInstance().configurableContextsMaxLevel_,
     265            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevel);
     266        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContextsMaxLevel_,
    267267                               LogWriter::getInstance().getConfigurableSectionName(),
    268                                LogWriter::getInstance().getConfigurableContextsMaxLevelName(),
    269                                LogWriter::getInstance().configurableContextsMaxLevel_)
     268                               LogWriter::getInstance().getConfigurableAdditionalContextsMaxLevelName(),
     269                               LogWriter::getInstance().configurableAdditionalContextsMaxLevel_)
    270270            .description("The maximum level of output shown in the log file for additional contexts")
    271             .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableLevels);
    272         SetConfigValueExternal(LogWriter::getInstance().configurableContexts_,
     271            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
     272        SetConfigValueExternal(LogWriter::getInstance().configurableAdditionalContexts_,
    273273                               LogWriter::getInstance().getConfigurableSectionName(),
    274                                LogWriter::getInstance().getConfigurableContextsName(),
    275                                LogWriter::getInstance().configurableContexts_)
     274                               LogWriter::getInstance().getConfigurableAdditionalContextsName(),
     275                               LogWriter::getInstance().configurableAdditionalContexts_)
    276276            .description("Additional output contexts shown in the log file")
    277             .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableContexts);
     277            .callback(static_cast<BaseWriter*>(&LogWriter::getInstance()), &BaseWriter::changedConfigurableAdditionalContexts);
    278278
    279279        SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
  • code/branches/output/src/libraries/core/command/Shell.cc

    r8831 r8833  
    123123                               this->configurableMaxLevel_)
    124124            .description("The maximum level of output shown in the " + this->getName())
    125             .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevels);
    126         SetConfigValueExternal(this->configurableContextsMaxLevel_,
     125            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevel);
     126        SetConfigValueExternal(this->configurableAdditionalContextsMaxLevel_,
    127127                               this->getConfigurableSectionName(),
    128                                this->getConfigurableContextsMaxLevelName(),
    129                                this->configurableContextsMaxLevel_)
     128                               this->getConfigurableAdditionalContextsMaxLevelName(),
     129                               this->configurableAdditionalContextsMaxLevel_)
    130130            .description("The maximum level of output shown in the " + this->getName() + " for additional contexts")
    131             .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableLevels);
    132         SetConfigValueExternal(this->configurableContexts_,
     131            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContextsLevel);
     132        SetConfigValueExternal(this->configurableAdditionalContexts_,
    133133                               this->getConfigurableSectionName(),
    134                                this->getConfigurableContextsName(),
    135                                this->configurableContexts_)
     134                               this->getConfigurableAdditionalContextsName(),
     135                               this->configurableAdditionalContexts_)
    136136            .description("Additional output contexts shown in the " + this->getName())
    137             .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableContexts);
     137            .callback(static_cast<BaseWriter*>(this), &BaseWriter::changedConfigurableAdditionalContexts);
    138138    }
    139139
Note: See TracChangeset for help on using the changeset viewer.