maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject [04/33] maven git commit: [MNG-3507] add color message debug info
Date Sat, 24 Sep 2016 15:19:26 GMT
[MNG-3507] add color message debug info

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

Branch: refs/heads/MNG-6056-feature-toggle
Commit: 5dab4940c9a7d3b362bd2a8b078b183e4eb521bb
Parents: 1b5b4f0
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Sun Jul 10 11:38:50 2016 +0200
Committer: Hervé Boutemy <hboutemy@apache.org>
Committed: Sun Jul 10 11:38:50 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/maven/cli/MavenCli.java     | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/5dab4940/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 3e1194b..eeb22c6 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
@@ -91,6 +91,7 @@ import org.apache.maven.model.profile.ProfileSelector;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.properties.internal.EnvironmentUtils;
 import org.apache.maven.properties.internal.SystemProperties;
+import org.apache.maven.shared.utils.logging.MessageBuffer;
 import org.apache.maven.shared.utils.logging.MessageUtils;
 import org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest;
 import org.apache.maven.toolchain.building.ToolchainsBuilder;
@@ -529,6 +530,26 @@ public class MavenCli
         {
             slf4jLogger.info( "Enabling strict checksum verification on all artifact downloads."
);
         }
+
+        if ( slf4jLogger.isDebugEnabled() )
+        {
+            slf4jLogger.debug( "message scheme: " + ( MessageUtils.isColor() ? "color" :
"plain" ) );
+            if ( MessageUtils.isColor() )
+            {
+                MessageBuffer buff = MessageUtils.buffer();
+                buff.a( "message styles: " );
+                buff.debug().a( "debug" ).reset().a( ' ' );
+                buff.info().a( "info" ).reset().a( ' ' );
+                buff.warning().a( "warning" ).reset().a( ' ' );
+                buff.error().a( "error" ).reset().a( ' ' );
+                buff.success( "success" ).a( ' ' );
+                buff.failure( "failure" ).a( ' ' );
+                buff.strong( "strong" ).a( ' ' );
+                buff.mojo( "mojo" ).a( ' ' );
+                buff.project( "project" );
+                slf4jLogger.debug( buff.toString() );
+            }
+        }
     }
 
     private void properties( CliRequest cliRequest )


Mime
View raw message