Skip to content

Commit

Permalink
Support for the -X / --debug / --quiet arguments on the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 13, 2020
1 parent 6f59283 commit ace5009
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,15 @@ void logging(CliRequest cliRequest) {
cliRequest.quiet = !cliRequest.debug && cliRequest.commandLine.hasOption(CLIManager.QUIET);
cliRequest.showErrors = cliRequest.debug || cliRequest.commandLine.hasOption(CLIManager.ERRORS);

java.util.logging.Level level;
ch.qos.logback.classic.Level level;
if (cliRequest.debug) {
cliRequest.request.setLoggingLevel(MavenExecutionRequest.LOGGING_LEVEL_DEBUG);
level = Level.FINER;
level = ch.qos.logback.classic.Level.DEBUG;
} else if (cliRequest.quiet) {
cliRequest.request.setLoggingLevel(MavenExecutionRequest.LOGGING_LEVEL_ERROR);
level = Level.SEVERE;
level = ch.qos.logback.classic.Level.WARN;
} else {
cliRequest.request.setLoggingLevel(MavenExecutionRequest.LOGGING_LEVEL_INFO);
level = Level.INFO;
level = ch.qos.logback.classic.Level.INFO;
}
((ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(level);

// LOG COLOR
String styleColor = cliRequest.getUserProperties().getProperty(STYLE_COLOR_PROPERTY, "auto");
Expand Down Expand Up @@ -439,8 +437,6 @@ protected void configure() {
new MojoExecutionScopeModule(container));
}

// container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() );

eventSpyDispatcher = container.lookup(EventSpyDispatcher.class);
eventSpyDispatcher.getEventSpies().add(realmCache.asEventSpy());

Expand Down

0 comments on commit ace5009

Please sign in to comment.