Make -q and -v do something more sensible

-q switches off all logging and the banner, -v switches logging to debug,
running with neither will be info.

Fixes gh-1108
This commit is contained in:
Dave Syer
2014-06-27 16:24:51 +01:00
parent 93c0f6fbc7
commit 54a23f9920
2 changed files with 16 additions and 3 deletions

View File

@@ -67,8 +67,17 @@ public class SpringApplicationRunner {
this.sources = sources.clone();
this.args = args.clone();
this.compiler = new GroovyCompiler(configuration);
if (configuration.getLogLevel().intValue() <= Level.FINE.intValue()) {
int level = configuration.getLogLevel().intValue();
if (level <= Level.FINER.intValue()) {
System.setProperty("groovy.grape.report.downloads", "true");
System.setProperty("trace", "true");
}
else if (level <= Level.FINE.intValue()) {
System.setProperty("debug", "true");
}
else if (level == Level.OFF.intValue()) {
System.setProperty("spring.main.showBanner", "false");
System.setProperty("logging.level.ROOT", "OFF");
}
}