Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2017-05-09 16:23:23 +02:00
commit 0eca65e433
2 changed files with 3 additions and 3 deletions

View file

@ -228,7 +228,7 @@ int main_loop(int argc, char ** argv){
if (Controller::conf.getOption("debug",true).size() > 1){
Controller::Storage["config"]["debug"] = Controller::conf.getInteger("debug");
}
if (Controller::Storage.isMember("config") && Controller::Storage["config"].isMember("debug")){
if (Controller::Storage.isMember("config") && Controller::Storage["config"].isMember("debug") && Controller::Storage["config"]["debug"].isInt()){
Util::Config::printDebugLevel = Controller::Storage["config"]["debug"].asInt();
}
//check for port, interface and username in arguments

View file

@ -242,8 +242,8 @@ void Controller::handleAPICommands(JSON::Value & Request, JSON::Value & Response
JSON::Value & out = Controller::Storage["config"];
if (in.isMember("debug")){
out["debug"] = in["debug"];
if (Util::Config::printDebugLevel != out["debug"].asInt()){
Util::Config::printDebugLevel = out["debug"].asInt();
if (Util::Config::printDebugLevel != (out["debug"].isInt()?out["debug"].asInt():DEBUG)){
Util::Config::printDebugLevel = (out["debug"].isInt()?out["debug"].asInt():DEBUG);
INFO_MSG("Debug level set to %u", Util::Config::printDebugLevel);
}
}