Skip to content

Commit

Permalink
Don't overwrite custom log level config in test mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Jul 5, 2017
1 parent 72ea220 commit 8fca258
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rapidoid-commons/src/main/java/org/rapidoid/config/Conf.java
Expand Up @@ -103,8 +103,14 @@ static void applyConfig(Config config) {
Log.options().fancy(true); Log.options().fancy(true);
} }


String logLevel = LOG.entry("level").or("info"); LogLevel logLevel = LOG.entry("level").to(LogLevel.class).getOrNull();
Log.setLogLevel(GlobalCfg.quiet() ? LogLevel.ERROR : LogLevel.valueOf(logLevel.toUpperCase())); if (logLevel != null && !Env.test()) {
Log.setLogLevel(logLevel);
}

if (GlobalCfg.quiet()) {
Log.setLogLevel(LogLevel.ERROR); // overwrite the configured log level in quiet mode
}
} }
} }


Expand Down

0 comments on commit 8fca258

Please sign in to comment.