Merge pull request #3643

e2b7558 handle improper log levels (cryptochangements34)
This commit is contained in:
luigi1111 2018-06-12 12:13:07 -05:00
commit ed139efc5d
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -2452,7 +2452,23 @@ bool simple_wallet::set_log(const std::vector<std::string> &args)
return true;
}
if(!args.empty())
{
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();
return true;
}