maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steph...@apache.org
Subject git commit: keep logging looking like before
Date Wed, 12 Dec 2012 11:14:49 GMT
Updated Branches:
  refs/heads/logging/slf4j-jul 5d8dcbe32 -> c80e47acf


keep logging looking like before


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c80e47ac
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c80e47ac
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c80e47ac

Branch: refs/heads/logging/slf4j-jul
Commit: c80e47acfd6f0699f3ce728a50698c38c491d3d8
Parents: 5d8dcbe
Author: Stephen Connolly <stephen.alan.connolly@gmail.com>
Authored: Wed Dec 12 11:14:24 2012 +0000
Committer: Stephen Connolly <stephen.alan.connolly@gmail.com>
Committed: Wed Dec 12 11:14:24 2012 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/maven/cli/MavenCli.java   |   28 ++++++++++++---
 1 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/c80e47ac/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 0875af6..ef3a887 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -38,7 +38,6 @@ import java.util.logging.Formatter;
 import java.util.logging.Handler;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
-import java.util.logging.SimpleFormatter;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.ParseException;
@@ -316,7 +315,7 @@ public class MavenCli
         if ( cliRequest.debug )
         {
             cliRequest.request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_DEBUG
);
-            setRootLoggerLevel( Level.FINEST );
+            setRootLoggerLevel( Level.FINE );
         }
         else if ( cliRequest.quiet )
         {
@@ -364,9 +363,28 @@ public class MavenCli
             public String format( LogRecord record )
             {
                 StringBuilder sb = new StringBuilder();
-                sb.append( '[' );
-                sb.append( record.getLevel().getLocalizedName() );
-                sb.append( "] " );
+                if ( Level.INFO.equals( record.getLevel() ) )
+                {
+                    sb.append( "[INFO] " );
+                }
+                else if ( Level.WARNING.equals( record.getLevel() ) )
+                {
+                    sb.append( "[WARNING] " );
+                }
+                else if ( Level.SEVERE.equals( record.getLevel() ) )
+                {
+                    sb.append( "[ERROR] " );
+                }
+                else if ( Level.FINE.equals( record.getLevel() ) )
+                {
+                    sb.append( "[DEBUG] " );
+                }
+                else
+                {
+                    sb.append( '[' );
+                    sb.append( record.getLevel().getLocalizedName() );
+                    sb.append( "] " );
+                }
                 sb.append( formatMessage( record ) );
                 sb.append( lineSeparator );
                 if ( record.getThrown() != null )


Mime
View raw message