mirror of
https://github.com/matrix-construct/construct
synced 2024-11-12 04:51:08 +01:00
modules/console: Toggle DWARNING/DERROR to match DEBUG in release-mode compilations.
This commit is contained in:
parent
6acc0ba4cb
commit
6b69e240d8
1 changed files with 18 additions and 6 deletions
|
@ -480,28 +480,40 @@ console_cmd__debug(opt &out, const string_view &line)
|
||||||
out << "Turning on debuglog..." << std::endl;
|
out << "Turning on debuglog..." << std::endl;
|
||||||
while(!log::console_enabled(log::DEBUG))
|
while(!log::console_enabled(log::DEBUG))
|
||||||
log::console_enable(log::DEBUG);
|
log::console_enable(log::DEBUG);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else if(param["onoff"] == "off")
|
else if(param["onoff"] == "off")
|
||||||
{
|
{
|
||||||
out << "Turning off debuglog..." << std::endl;
|
out << "Turning off debuglog..." << std::endl;
|
||||||
log::console_disable(log::DEBUG);
|
log::console_disable(log::DEBUG);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else if(log::console_enabled(log::DEBUG))
|
else if(log::console_enabled(log::DEBUG))
|
||||||
{
|
{
|
||||||
out << "Turning off debuglog..." << std::endl;
|
out << "Turning off debuglog..." << std::endl;
|
||||||
log::console_disable(log::DEBUG);
|
log::console_disable(log::DEBUG);
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
out << "Turning on debuglog..." << std::endl;
|
out << "Turning on debuglog..." << std::endl;
|
||||||
while(!log::console_enabled(log::DEBUG))
|
while(!log::console_enabled(log::DEBUG))
|
||||||
log::console_enable(log::DEBUG);
|
log::console_enable(log::DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When not compiled in debug-mode we attempt to set all DEBUG related
|
||||||
|
// levels (DERROR / DWARNING) to always match DEBUG. In debug-mode
|
||||||
|
// compilation they remain independent, but if we don't do this in release
|
||||||
|
// mode it will leave the user with DERROR messages which weren't DCE'ed
|
||||||
|
if(!RB_DEBUG_LEVEL)
|
||||||
|
{
|
||||||
|
if(log::console_enabled(log::DEBUG))
|
||||||
|
{
|
||||||
|
log::console_enable(log::DERROR);
|
||||||
|
log::console_enable(log::DWARNING);
|
||||||
|
} else {
|
||||||
|
log::console_disable(log::DERROR);
|
||||||
|
log::console_disable(log::DWARNING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
console_cmd__demangle(opt &out, const string_view &line)
|
console_cmd__demangle(opt &out, const string_view &line)
|
||||||
|
|
Loading…
Reference in a new issue