Permalink
Browse files

handle incorrect log levels in simplewallet

  • Loading branch information...
miltonf committed Feb 1, 2019
1 parent 80c7f3b commit 954439fbb64c3e814f2895c280719177bae51716
Showing with 18 additions and 2 deletions.
  1. +18 −2 src/simplewallet/simplewallet.cpp
@@ -2452,8 +2452,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>");
return true;
}
if (!args.empty())
mlog_set_log(args[0].c_str());
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;
}

0 comments on commit 954439f

Please sign in to comment.