maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r424018 - in /maven/maven-1/core/trunk/src/java/org/apache/maven: MavenUtils.java cli/App.java plugin/PluginScriptParser.java
Date Thu, 20 Jul 2006 18:47:10 GMT
Author: ltheussl
Date: Thu Jul 20 11:47:08 2006
New Revision: 424018

URL: http://svn.apache.org/viewvc?rev=424018&view=rev
Log:
Use commons logging instead of System.out/err.

Modified:
    maven/maven-1/core/trunk/src/java/org/apache/maven/MavenUtils.java
    maven/maven-1/core/trunk/src/java/org/apache/maven/cli/App.java
    maven/maven-1/core/trunk/src/java/org/apache/maven/plugin/PluginScriptParser.java

Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/MavenUtils.java
URL: http://svn.apache.org/viewvc/maven/maven-1/core/trunk/src/java/org/apache/maven/MavenUtils.java?rev=424018&r1=424017&r2=424018&view=diff
==============================================================================
--- maven/maven-1/core/trunk/src/java/org/apache/maven/MavenUtils.java (original)
+++ maven/maven-1/core/trunk/src/java/org/apache/maven/MavenUtils.java Thu Jul 20 11:47:08
2006
@@ -925,19 +925,19 @@
      */
     public static void displayClassLoaderContents( ForeheadClassLoader classLoader )
     {
-        System.out.println( "ClassLoader name: " + classLoader.getName() );
+        log.info( "ClassLoader name: " + classLoader.getName() );
 
         URL[] urls = classLoader.getURLs();
 
         for ( int i = 0; i < urls.length; i++ )
         {
-            System.out.println( "urls[" + i + "] = " + urls[i] );
+            log.info( "urls[" + i + "] = " + urls[i] );
         }
 
         ClassLoader parent = classLoader.getParent();
         if ( parent != null && parent instanceof ForeheadClassLoader )
         {
-            System.out.println( "Displaying Parent classloader: " );
+            log.info( "Displaying Parent classloader: " );
             displayClassLoaderContents( (ForeheadClassLoader) classLoader.getParent() );
         }
     }

Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/cli/App.java
URL: http://svn.apache.org/viewvc/maven/maven-1/core/trunk/src/java/org/apache/maven/cli/App.java?rev=424018&r1=424017&r2=424018&view=diff
==============================================================================
--- maven/maven-1/core/trunk/src/java/org/apache/maven/cli/App.java (original)
+++ maven/maven-1/core/trunk/src/java/org/apache/maven/cli/App.java Thu Jul 20 11:47:08 2006
@@ -543,42 +543,42 @@
         catch ( UnsatisfiedDependencyException e )
         {
             failed = true;
-            System.err.println( e.getLocalizedMessage() );
+            log.error( e.getLocalizedMessage() );
             returnCode = RC_FAILED_DEPENDENCY;
         }
         catch ( ChecksumVerificationException e )
         {
             failed = true;
-            System.err.println( e.getLocalizedMessage() );
+            log.error( e.getLocalizedMessage() );
             returnCode = RC_FAILED_DEPENDENCY;
         }
         catch ( UnknownGoalException e )
         {
             failed = true;
-            System.err.println( MavenUtils.getMessage( "build.failed" ) );
-            System.err.println( MavenUtils.getMessage( "build.unknownGoalException", e.getGoalName()
) );
+            log.error( MavenUtils.getMessage( "build.failed" ) );
+            log.error( MavenUtils.getMessage( "build.unknownGoalException", e.getGoalName()
) );
             returnCode = RC_NO_GOAL;
         }
         catch ( NoSuchGoalException e )
         {
             failed = true;
-            System.err.println( MavenUtils.getMessage( "build.failed" ) );
-            System.err.println( e.getMessage() );
-            System.err.println( MavenUtils.getMessage( "build.noSuchGoalException" ) );
+            log.error( MavenUtils.getMessage( "build.failed" ) );
+            log.error( e.getMessage() );
+            log.error( MavenUtils.getMessage( "build.noSuchGoalException" ) );
             returnCode = RC_NO_GOAL;
         }
         catch ( RepoConfigException e )
         {
             failed = true;
-            System.err.println( e.getLocalizedMessage() );
+            log.error( e.getLocalizedMessage() );
             returnCode = RC_BAD_REPO;
         }
         catch ( NoActionDefinitionException e )
         {
             failed = true;
-            System.err.println( MavenUtils.getMessage( "build.internalError" ) );
-            System.err.println( MavenUtils.getMessage( "build.noActionDefinitionException",
e.getGoal().getName() ) );
-            System.err.println( "" );
+            log.error( MavenUtils.getMessage( "build.internalError" ) );
+            log.error( MavenUtils.getMessage( "build.noActionDefinitionException", e.getGoal().getName()
) );
+            log.error( "" );
             returnCode = RC_EMPTY_GOAL;
 
             if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
@@ -605,12 +605,12 @@
 
             String msg = e.getReason();
 
-            System.err.println( MavenUtils.getMessage( "build.jellyException.file", fileName
) );
-            System.err.println( MavenUtils.getMessage( "build.jellyException.element", elementName
) );
-            System.err.println( MavenUtils.getMessage( "build.jellyException.line", new Integer(
lineNumber ) ) );
-            System.err.println( MavenUtils.getMessage( "build.jellyException.column", new
Integer( column ) ) );
+            log.error( MavenUtils.getMessage( "build.jellyException.file", fileName ) );
+            log.error( MavenUtils.getMessage( "build.jellyException.element", elementName
) );
+            log.error( MavenUtils.getMessage( "build.jellyException.line", new Integer( lineNumber
) ) );
+            log.error( MavenUtils.getMessage( "build.jellyException.column", new Integer(
column ) ) );
 
-            System.err.println( msg );
+            log.error( msg );
 
             if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
             {
@@ -622,15 +622,15 @@
         {
             returnCode = RC_OTHER_FAILURE;
             failed = true;
-            System.err.println( MavenUtils.getMessage( "build.failed" ) );
-            System.err.println( e.getMessage() );
+            log.error( MavenUtils.getMessage( "build.failed" ) );
+            log.error( e.getMessage() );
             if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
             {
                 e.printStackTrace();
             }
             else
             {
-                System.err.println( MavenUtils.getMessage( "displayBugReportHelp.line4" )
);
+                log.error( MavenUtils.getMessage( "displayBugReportHelp.line4" ) );
             }
             if ( e.getMessage().equals( MavenUtils.MAVEN_UNKNOWN_ERROR ) )
             {
@@ -884,8 +884,8 @@
     {
         int returnCode = RC_GOAL_FAILED;
 
-        System.err.println( "" );
-        System.err.println( MavenUtils.getMessage( "build.failed" ) );
+        log.error( "" );
+        log.error( MavenUtils.getMessage( "build.failed" ) );
 
         String msg = null;
 
@@ -931,10 +931,10 @@
                     }
                 }
 
-                System.err.println( MavenUtils.getMessage( "build.jellyException.file", fileName
) );
-                System.err.println( MavenUtils.getMessage( "build.jellyException.element",
elementName ) );
-                System.err.println( MavenUtils.getMessage( "build.jellyException.line", new
Integer( lineNumber ) ) );
-                System.err.println( MavenUtils.getMessage( "build.jellyException.column",
new Integer( column ) ) );
+                log.error( MavenUtils.getMessage( "build.jellyException.file", fileName )
);
+                log.error( MavenUtils.getMessage( "build.jellyException.element", elementName
) );
+                log.error( MavenUtils.getMessage( "build.jellyException.line", new Integer(
lineNumber ) ) );
+                log.error( MavenUtils.getMessage( "build.jellyException.column", new Integer(
column ) ) );
 
             }
             else
@@ -956,7 +956,7 @@
             msg = e.getLocalizedMessage();
         }
 
-        System.err.println( msg );
+        log.error( msg );
 
         if ( getCli().hasOption( DEBUG ) )
         {

Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/plugin/PluginScriptParser.java
URL: http://svn.apache.org/viewvc/maven/maven-1/core/trunk/src/java/org/apache/maven/plugin/PluginScriptParser.java?rev=424018&r1=424017&r2=424018&view=diff
==============================================================================
--- maven/maven-1/core/trunk/src/java/org/apache/maven/plugin/PluginScriptParser.java (original)
+++ maven/maven-1/core/trunk/src/java/org/apache/maven/plugin/PluginScriptParser.java Thu
Jul 20 11:47:08 2006
@@ -225,7 +225,7 @@
      */
     private final void printParseError( String type, SAXParseException spe )
     {
-        System.err.println( type + " [line " + spe.getLineNumber() + ", row " + spe.getColumnNumber()
+ "]: "
+        log.error( type + " [line " + spe.getLineNumber() + ", row " + spe.getColumnNumber()
+ "]: "
             + spe.getMessage() );
     }
 }



Mime
View raw message