//============================================================================//
void Configuration::prepareApplicationLoggingFiles(AbstractConfiguration &config, const string &prefix)
{

    // find all files loggers
    AbstractConfiguration::Keys             channelsKeys;
    AbstractConfiguration::Keys::iterator   keyIt;

    config.keys("logging.channels", channelsKeys);

    config.setString("application.logger", prefix);


    for(keyIt = channelsKeys.begin(); keyIt != channelsKeys.end(); ++keyIt) {
        if(!config.getString("logging.channels." + *keyIt + ".class", "").
            compare("FileChannel")) {

            config.setString("logging.channels." + *keyIt + ".path",
                Path(config.getString("logging.channels." + *keyIt + ".path", "") +
                    Path::separator()).makeAbsolute().
                    setFileName(
                        "UpSys" + prefix + 
                        config.getString("args.software_identifier")
                        + ".log").toString());
        }
    }

}
AbstractConfiguration* ConfigurationMapperTest::createConfiguration() const
{
	AbstractConfiguration* pConfig = new MapConfiguration;
	
	pConfig->setString("config.value1", "v1");
	pConfig->setString("config.value2", "v2");
	pConfig->setString("config.sub.value1", "v3");
	pConfig->setString("config.sub.value2", "v4");
	
	return pConfig;
}
AbstractConfiguration* ConfigurationViewTest::createConfiguration() const
{
	AbstractConfiguration* pConfig = new MapConfiguration;
	
	pConfig->setString("prop1", "foo");
	pConfig->setString("prop2", "bar");
	pConfig->setString("prop3.string1", "foo");
	pConfig->setString("prop3.string2", "bar");
	pConfig->setString("prop4.prop41.string1", "FOO");
	pConfig->setString("prop4.prop41.string2", "BAR");
	pConfig->setString("prop4.prop42.string1", "Foo");
	pConfig->setString("prop4.prop42.string2", "Bar");
	
	return pConfig;
}
//============================================================================//
void Configuration::prepareApplicationLoggingDisableConsole(AbstractConfiguration &config)
{
    // find all files loggers
    AbstractConfiguration::Keys             channelsKeys;
    AbstractConfiguration::Keys::iterator   keyIt;

    config.keys("logging.channels", channelsKeys);

    for(keyIt = channelsKeys.begin(); keyIt != channelsKeys.end(); ++keyIt) {
        if(!config.getString("logging.channels." + *keyIt + ".class", "").
            compare("ConsoleChannel")) {

            config.setString("logging.channels." + *keyIt + ".class",
                "NullChannel");
        }
    }
}