Fixed debug level being null when unset
This commit is contained in:
parent
0e0da824f7
commit
101a8d521c
2 changed files with 3 additions and 3 deletions
|
@ -193,7 +193,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
|
||||
|
|
|
@ -196,8 +196,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue