Ejemplo n.º 1
0
    void PropertyConfiguratorImpl::doConfigure(std::istream& in) throw (ConfigureFailure) {
        // parse the file to get all of the configuration
        _properties.load(in);

        instantiateAllAppenders();
        // get categories
        std::vector<std::string> catList;
        getCategories(catList);

        // configure each category
        for(std::vector<std::string>::const_iterator iter = catList.begin();
            iter != catList.end(); ++iter) {
            configureCategory(*iter);
        }
    }
Ejemplo n.º 2
0
Logger::Logger()
{
    m_Severity = severity::WARNING;
    string sEnvSeverity;
    bool bEnvSeveritySet = getEnv("AVG_LOG_SEVERITY", sEnvSeverity);
    if(bEnvSeveritySet) {
        m_Severity = Logger::stringToSeverity(sEnvSeverity);
    }
    setupCategory();

    string sEnvCategories;
    bool bEnvSet = getEnv("AVG_LOG_CATEGORIES", sEnvCategories);
    if (bEnvSet) {
        vector<string> sCategories;
        ba::split(sCategories, sEnvCategories, ba::is_any_of(" "), ba::token_compress_on);
        vector<string>::iterator it;
        for(it=sCategories.begin(); it!=sCategories.end(); it++) {
            string::size_type pos = (*it).find(":");
            string sCategory;
            string sSeverity = "NONE";
            if(pos == string::npos) {
                sCategory = *it;
            } else {
                vector<string> tmpValues;
                ba::split( tmpValues, *it, ba::is_any_of(":"), ba::token_compress_on);
                sCategory = tmpValues.at(0);
                sSeverity = tmpValues.at(1);
            }
            severity_t severity = stringToSeverity(sSeverity);
            configureCategory(sCategory, severity);
        }
    }

    string sDummy;
    bool bEnvOmitStdErr = getEnv("AVG_LOG_OMIT_STDERR", sDummy);
    if (!bEnvOmitStdErr) {
        m_pStdSink = LogSinkPtr(new StandardLogSink);
        addLogSink(m_pStdSink);
    }
}
Ejemplo n.º 3
0
void Logger::setupCategory()
{
    configureCategory(category::NONE);
    configureCategory(category::PROFILE);
    configureCategory(category::PROFILE_VIDEO);
    configureCategory(category::EVENTS);
    configureCategory(category::CONFIG);
    configureCategory(category::MEMORY);
    configureCategory(category::APP);
    configureCategory(category::PLUGIN);
    configureCategory(category::PLAYER);
    configureCategory(category::SHADER);
    configureCategory(category::DEPRECATION);
}