You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Johannes Buchner (JIRA)" <ji...@codehaus.org> on 2009/01/07 05:10:19 UTC

[jira] Issue Comment Edited: (MNG-3507) ANSI Color logging for improved output visibility.

    [ http://jira.codehaus.org/browse/MNG-3507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160189#action_160189 ] 

Johannes Buchner edited comment on MNG-3507 at 1/6/09 10:08 PM:
----------------------------------------------------------------

A slightly different approach, yet considerably easier. 
http://twoday.tuwien.ac.at/jo/stories/320760/
Works of course on environments that support it, but assuming all unices want it, you can just fix your "Maven2 Start Up Batch" script to add this. 

Like so: (at the end of the mvn bash script distributed)

exec "$JAVACMD" \
  $MAVEN_OPTS \
  -classpath "${M2_HOME}"/boot/classworlds-*.jar \
  "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
  "-Dmaven.home=${M2_HOME}"  \
  ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS |
  sed -e 's/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/[1;32mTests run: \1[0m, Failures: [1;31m\2[0m, Errors: [1;33m\3[0m, Skipped: [1;34m\4[0m/g' \
  -e 's/\(\[WARN\].*\)/[1;33m\1[0m/g' \
  -e 's/\(\[INFO\].*\)/[1;34m\1[0m/g' \
  -e 's/\(\[ERROR\].*\)/[1;31m\1[0m/g'

Or is that just the one gentoo provides? Anyhow, you could provide this to your distributers. 

      was (Author: buchner.johannes):
    A slightly different approach, yet considerably easier. 
http://twoday.tuwien.ac.at/jo/stories/320760/
Works of course on environments that support it, but assuming all unices want it, you can just fix your "Maven2 Start Up Batch" script to add this. 

Like so: (at the end of the mvn bash script distributed)

exec "$JAVACMD" \
  $MAVEN_OPTS \
  -classpath "${M2_HOME}"/boot/classworlds-*.jar \
  "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
  "-Dmaven.home=${M2_HOME}"  \
  ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS |
  sed -e 's/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/[1;32mTests run: \1[0m, Failures: [1;31m\2[0m, Errors: [1;33m\3[0m, Skipped: [1;34m\4[0m/g' \
  -e 's/\(\[WARN\].*\)/[1;33m\1[0m/g' \
  -e 's/\(\[INFO\].*\)/[1;34m\1[0m/g' \
  -e 's/\(\[ERROR\].*\)/[1;31m\1[0m/g'

Or is that just the one gentoo provides? Anyhow, you provide this to your distributers. 
  
> ANSI Color logging for improved output visibility.
> --------------------------------------------------
>
>                 Key: MNG-3507
>                 URL: http://jira.codehaus.org/browse/MNG-3507
>             Project: Maven 2
>          Issue Type: Improvement
>            Reporter: Rahul Thakur
>             Fix For: 3.x
>
>         Attachments: maven-colorlogger.zip, pom.xml
>
>
> Is it possible for Maven to use ANSI color logging? IMO it would make Maven logs much easier to read and increase the visibility of items that the user want to see at any given point in time. 
> I think Andrew Williams did some work under Plexus sandbox to enable color logging. There also a color logger available in Ant. 
> http://ant.apache.org/manual/listeners.html#AnsiColorLogger

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira