[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
This commit is contained in:
Hervé Boutemy 2017-03-04 02:59:42 +01:00
parent 542a7a8915
commit eb2db7b286
4 changed files with 7 additions and 19 deletions

View File

@ -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

View File

@ -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 )
{

View File

@ -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 );

View File

@ -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>