mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +01:00
modules/console: Add log level adjustment command.
This commit is contained in:
parent
7e27be36d9
commit
bb0659fd83
1 changed files with 26 additions and 0 deletions
|
@ -369,6 +369,32 @@ console_cmd__debug(opt &out, const string_view &line)
|
||||||
// log
|
// log
|
||||||
//
|
//
|
||||||
|
|
||||||
|
bool
|
||||||
|
console_cmd__log__level(opt &out, const string_view &line)
|
||||||
|
{
|
||||||
|
const params param{line, " ",
|
||||||
|
{
|
||||||
|
"level",
|
||||||
|
}};
|
||||||
|
|
||||||
|
const int level
|
||||||
|
{
|
||||||
|
param.at<int>(0)
|
||||||
|
};
|
||||||
|
|
||||||
|
for(int i(0); i < num_of<log::facility>(); ++i)
|
||||||
|
if(i <= level)
|
||||||
|
{
|
||||||
|
console_enable(log::facility(i));
|
||||||
|
out << "[\033[1;42m+\033[0m]: " << reflect(log::facility(i)) << std::endl;
|
||||||
|
} else {
|
||||||
|
console_disable(log::facility(i));
|
||||||
|
out << "[\033[1;41m-\033[0m]: " << reflect(log::facility(i)) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
console_cmd__log__mask(opt &out, const string_view &line)
|
console_cmd__log__mask(opt &out, const string_view &line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue