Skip to content

Commit

Permalink
[JENKINS-15025] Change PrintStreamLogger to System.out instead
Browse files Browse the repository at this point in the history
listener.getLogger (as MavenCli). In this manner output is highlighted.
Originally-Committed-As: 588e9cb7e122bda1e2aa2453fa99b8d4a94f418c
  • Loading branch information
Nikolas Falco committed Jul 15, 2013
1 parent ba7c729 commit 9540dac
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/main/java/hudson/maven/Maven3Builder.java
Expand Up @@ -129,18 +129,6 @@ public Result call() throws IOException {

// manage of Maven error are moved to ExecutionEventLogger, they are
// threaded as in MavenCli
if (!mavenExecutionResult.getThrowables().isEmpty() && isDebug()) {
logger.println( "mavenExecutionResult exceptions not empty");
for(Throwable throwable : mavenExecutionResult.getThrowables()) {
logger.println("message : " + throwable.getMessage());
if (throwable.getCause()!=null) {
logger.println("cause : " + throwable.getCause().getMessage());
}
logger.println("Stack trace : ");
throwable.printStackTrace( logger );
}

}

if(markAsSuccess) {
logger.println(Messages.MavenBuilder_Failed());
Expand Down Expand Up @@ -200,7 +188,7 @@ public MavenExecutionListener(AbstractMavenBuilder maven3Builder) {

// TODO: we should think about reusing the code in org.apache.maven.cli.DefaultMavenExecutionRequestBuilder#logging?
// E.g. there's also the option to redirect logging to a file which is handled there, but not here.
PrintStreamLogger logger = new PrintStreamLogger( maven3Builder.listener.getLogger() );
PrintStreamLogger logger = new PrintStreamLogger( /* maven3Builder.listener.getLogger() */ System.out );
if (maven3Builder.isDebug()) {
logger.setThreshold(PrintStreamLogger.LEVEL_DEBUG);
} else if (maven3Builder.isQuiet()) {
Expand Down

0 comments on commit 9540dac

Please sign in to comment.