[MNG-6196] updated slf4j to 1.7.25 [SLF4J-394] use new slf4j methods done for us [SLF4J-395] use slf4j-simple System.out cache
Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/eb2db7b2 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/eb2db7b2 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/eb2db7b2 Branch: refs/heads/MNG-6255 Commit: eb2db7b28664dbaac6a59a2189c70d92e455dcea Parents: 542a7a8 Author: Hervé Boutemy <hbout...@apache.org> Authored: Sat Mar 4 02:59:42 2017 +0100 Committer: Hervé Boutemy <hbout...@apache.org> Committed: Tue Sep 26 00:19:57 2017 +0200 ---------------------------------------------------------------------- .../src/conf/logging/simplelogger.properties | 1 + .../java/org/slf4j/impl/MavenSimpleLogger.java | 6 +++++- .../src/main/script/patch-slf4j-simple.groovy | 17 ----------------- pom.xml | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/eb2db7b2/apache-maven/src/conf/logging/simplelogger.properties ---------------------------------------------------------------------- diff --git a/apache-maven/src/conf/logging/simplelogger.properties b/apache-maven/src/conf/logging/simplelogger.properties index 8dea717..64b331b 100644 --- a/apache-maven/src/conf/logging/simplelogger.properties +++ b/apache-maven/src/conf/logging/simplelogger.properties @@ -20,6 +20,7 @@ org.slf4j.simpleLogger.showDateTime=false org.slf4j.simpleLogger.showThreadName=false org.slf4j.simpleLogger.showLogName=false org.slf4j.simpleLogger.logFile=System.out +org.slf4j.simpleLogger.cacheOutputStream=true org.slf4j.simpleLogger.levelInBrackets=true org.slf4j.simpleLogger.log.Sisu=info org.slf4j.simpleLogger.warnLevelString=WARNING http://git-wip-us.apache.org/repos/asf/maven/blob/eb2db7b2/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java ---------------------------------------------------------------------- diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java index 17f1f48..3c1ca4f 100644 --- a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java +++ b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java @@ -56,8 +56,12 @@ public class MavenSimpleLogger } @Override - protected void renderThrowable( Throwable t, PrintStream stream ) + protected void writeThrowable( Throwable t, PrintStream stream ) { + if ( t == null ) + { + return; + } stream.print( buffer().failure( t.getClass().getName() ) ); if ( t.getMessage() != null ) { http://git-wip-us.apache.org/repos/asf/maven/blob/eb2db7b2/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy ---------------------------------------------------------------------- diff --git a/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy b/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy index bba8646..9865625 100644 --- a/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy +++ b/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy @@ -34,20 +34,3 @@ if ( content.contains( 'MavenSimpleLoggerFactory' ) ) println ' patching StaticLoggerBinder.java'; content = content.replaceAll( 'SimpleLoggerFactory', 'MavenSimpleLoggerFactory' ); file.write( content ); - - -println ' patching SimpleLogger.java'; -file = new File( dir, 'SimpleLogger.java' ); -content = file.text; -content = content.replaceAll( 'private static final int LOG_LEVEL_', 'protected static final int LOG_LEVEL_' ); -content = content.replaceAll( 't.printStackTrace(TARGET_STREAM)', 'renderThrowable(t, TARGET_STREAM);' ); - -index = content.indexOf( 'switch (level) {' ); -end = content.indexOf( '}', index ) + 1; -content = content.substring( 0, index ) + 'buf.append(renderLevel(level));' + content.substring( end ); - -content = content.substring( 0, content.lastIndexOf( '}' ) ); -content += ' protected void renderThrowable(Throwable t, PrintStream stream) {}\n'; -content += ' protected String renderLevel(int level) { return ""; }\n}\n'; - -file.write( content ); http://git-wip-us.apache.org/repos/asf/maven/blob/eb2db7b2/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 4a79956..ea119e1 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ under the License. <modelloVersion>1.9.1</modelloVersion> <jxpathVersion>1.3</jxpathVersion> <resolverVersion>1.1.0</resolverVersion> - <slf4jVersion>1.7.22</slf4jVersion> + <slf4jVersion>1.7.25</slf4jVersion> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile> <!-- Control the name of the distribution and information output by mvn --> <distributionId>apache-maven</distributionId>