mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 10:01:02 +00:00
handle improper log levels
This commit is contained in:
parent
6f6521ad7a
commit
e2b75586fb
1 changed files with 18 additions and 2 deletions
|
@ -2439,8 +2439,24 @@ bool simple_wallet::set_log(const std::vector<std::string> &args)
|
||||||
fail_msg_writer() << tr("usage: set_log <log_level_number_0-4> | <categories>");
|
fail_msg_writer() << tr("usage: set_log <log_level_number_0-4> | <categories>");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!args.empty())
|
if(!args.empty())
|
||||||
mlog_set_log(args[0].c_str());
|
{
|
||||||
|
uint16_t level = 0;
|
||||||
|
if(epee::string_tools::get_xtype_from_string(level, args[0]))
|
||||||
|
{
|
||||||
|
if(4 < level)
|
||||||
|
{
|
||||||
|
fail_msg_writer() << tr("wrong number range, use: set_log <log_level_number_0-4> | <categories>");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
mlog_set_log_level(level);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mlog_set_log(args[0].c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
success_msg_writer() << "New log categories: " << mlog_get_categories();
|
success_msg_writer() << "New log categories: " << mlog_get_categories();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue