Tweaked log messages in controller when messing with immutable properties (time, version).

This commit is contained in:
Thulinma 2013-04-23 12:41:25 +02:00
parent 1f97b1c92e
commit bb380613f4

View file

@ -90,21 +90,22 @@ namespace Controller {
///\param out The location to store the resulting configuration. ///\param out The location to store the resulting configuration.
void CheckConfig(JSON::Value & in, JSON::Value & out){ void CheckConfig(JSON::Value & in, JSON::Value & out){
for (JSON::ObjIter jit = in.ObjBegin(); jit != in.ObjEnd(); jit++){ for (JSON::ObjIter jit = in.ObjBegin(); jit != in.ObjEnd(); jit++){
if (jit->first == "version"){ if (jit->first == "version" || jit->first == "time"){
continue; continue;
} }
if (out.isMember(jit->first)){ if (out.isMember(jit->first)){
if (jit->second != out[jit->first]){ if (jit->second != out[jit->first]){
if (jit->first != "time"){ Log("CONF", std::string("Updated configuration value ") + jit->first);
Log("CONF", std::string("Updated configuration value ") + jit->first);
}
} }
}else{ }else{
Log("CONF", std::string("New configuration value ") + jit->first); Log("CONF", std::string("New configuration value ") + jit->first);
} }
} }
for (JSON::ObjIter jit = out.ObjBegin(); jit != out.ObjEnd(); jit++){ for (JSON::ObjIter jit = out.ObjBegin(); jit != out.ObjEnd(); jit++){
if ( !in.isMember(jit->first) || jit->first == "version"){ if (jit->first == "version" || jit->first == "time"){
continue;
}
if ( !in.isMember(jit->first)){
Log("CONF", std::string("Deleted configuration value ") + jit->first); Log("CONF", std::string("Deleted configuration value ") + jit->first);
} }
} }