Fixed setting max log level from command line

This commit is contained in:
SChernykh
2021-08-31 11:18:40 +02:00
parent 7b197824fe
commit 8064865ba5
3 changed files with 3 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ static int do_status(p2pool *m_pool, const char * /* args */)
static int do_loglevel(p2pool * /* m_pool */, const char *args)
{
int level = atoi(args);
level = std::min(std::max(level, 0), 6);
level = std::min(std::max(level, 0), log::MAX_GLOBAL_LOG_LEVEL);
log::GLOBAL_LOG_LEVEL = level;
LOGINFO(0, "log level set to " << level);
return 0;