0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00

modules/console: Allow explicit on/off arguments to debug cmd.

This commit is contained in:
Jason Volk 2019-03-28 16:11:37 -07:00
parent f340e44692
commit 8e23a49ced

View file

@ -433,14 +433,35 @@ console_cmd__debug(opt &out, const string_view &line)
return true;
}
if(log::console_enabled(log::DEBUG))
const params param{line, " ",
{
"onoff"
}};
if(param["onoff"] == "on")
{
out << "Turning on debuglog..." << std::endl;
while(!log::console_enabled(log::DEBUG))
log::console_enable(log::DEBUG);
return true;
}
else if(param["onoff"] == "off")
{
out << "Turning off debuglog..." << std::endl;
log::console_disable(log::DEBUG);
return true;
}
else if(log::console_enabled(log::DEBUG))
{
out << "Turning off debuglog..." << std::endl;
log::console_disable(log::DEBUG);
return true;
} else {
out << "Turning on debuglog..." << std::endl;
log::console_enable(log::DEBUG);
while(!log::console_enabled(log::DEBUG))
log::console_enable(log::DEBUG);
return true;
}
}