Skip to content

Commit

Permalink
Fix default logger
Browse files Browse the repository at this point in the history
  • Loading branch information
raggledodo committed May 5, 2019
1 parent b7de01e commit ebbb883
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions logs/logs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct DefLogger final : public iLogger
{
case FATAL:
fatal(msg);
break;
case ERROR:
error(msg);
break;
Expand All @@ -92,7 +91,7 @@ struct DefLogger final : public iLogger
/// Implementation of iLogger
void warn (std::string msg) const override
{
if (log_level_ <= WARN)
if (WARN <= log_level_)
{
std::cerr << warn_tag << msg << '\n';
}
Expand All @@ -101,7 +100,7 @@ struct DefLogger final : public iLogger
/// Implementation of iLogger
void error (std::string msg) const override
{
if (log_level_ <= ERROR)
if (ERROR <= log_level_)
{
std::cerr << err_tag << msg << '\n';
}
Expand All @@ -110,7 +109,10 @@ struct DefLogger final : public iLogger
/// Implementation of iLogger
void fatal (std::string msg) const override
{
throw std::runtime_error(msg);
if (FATAL <= log_level_)
{
throw std::runtime_error(msg);
}
}

LOG_LEVEL log_level_ = INFO;
Expand Down

0 comments on commit ebbb883

Please sign in to comment.