donaldp     01/12/23 06:17:40

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        ReplaceRegExp.java NetRexxC.java Native2Ascii.java
                        Javah.java IContract.java Cab.java ANTLR.java
  Log:
  Start updating logging to myrmidon style logging
  
  Revision  Changes    Path
  1.8       +17 -15    
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ReplaceRegExp.java        2001/12/23 06:31:14     1.7
  +++ ReplaceRegExp.java        2001/12/23 14:17:40     1.8
  @@ -18,7 +18,6 @@
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.RegularExpression;
  @@ -191,14 +190,15 @@
               }
               catch( IOException e )
               {
  -                log( "An error occurred processing file: '" + 
file.getAbsolutePath() + "': " + e.toString(),
  -                     Project.MSG_ERR );
  +                final String message = "An error occurred processing file: 
'" +
  +                    file.getAbsolutePath() + "': " + e.toString();
  +                getLogger().error( message, e );
               }
           }
           else if( file != null )
           {
  -            log( "The following file is missing: '" + file.getAbsolutePath() 
+ "'",
  -                 Project.MSG_ERR );
  +            final String message = "The following file is missing: '" + 
file.getAbsolutePath() + "'";
  +            getLogger().error( message );
           }
   
           int sz = filesets.size();
  @@ -219,14 +219,15 @@
                       }
                       catch( Exception e )
                       {
  -                        log( "An error occurred processing file: '" + 
f.getAbsolutePath() + "': " + e.toString(),
  -                             Project.MSG_ERR );
  +                        final String message = "An error occurred processing 
file: '" + f.getAbsolutePath() +
  +                            "': " + e.toString();
  +                        getLogger().error( message );
                       }
                   }
                   else
                   {
  -                    log( "The following file is missing: '" + 
file.getAbsolutePath() + "'",
  -                         Project.MSG_ERR );
  +                    final String message = "The following file is missing: 
'" + file.getAbsolutePath() + "'";
  +                    getLogger().error( message );
                   }
               }
           }
  @@ -276,12 +277,13 @@
   
               boolean changes = false;
   
  -            log( "Replacing pattern '" + regex.getPattern( getProject() ) + 
"' with '" + subs.getExpression( getProject() ) +
  -                 "' in '" + f.getPath() + "'" +
  -                 ( byline ? " by line" : "" ) +
  -                 ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" 
) +
  -                 ".",
  -                 Project.MSG_WARN );
  +            final String message = "Replacing pattern '" + regex.getPattern( 
getProject() ) +
  +                "' with '" + subs.getExpression( getProject() ) +
  +                "' in '" + f.getPath() + "'" +
  +                ( byline ? " by line" : "" ) +
  +                ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) 
+
  +                ".";
  +            getLogger().warn( message );
   
               if( byline )
               {
  
  
  
  1.9       +7 -9      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
  
  Index: NetRexxC.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NetRexxC.java     2001/12/23 06:31:14     1.8
  +++ NetRexxC.java     2001/12/23 14:17:40     1.9
  @@ -20,7 +20,6 @@
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   
   /**
  @@ -596,8 +595,7 @@
               }
               else
               {
  -                log( "Dropping from classpath: " +
  -                     f.getAbsolutePath(), Project.MSG_VERBOSE );
  +                getLogger().debug( "Dropping from classpath: " + 
f.getAbsolutePath() );
               }
           }
   
  @@ -640,7 +638,7 @@
       private void doNetRexxCompile()
           throws TaskException
       {
  -        log( "Using NetRexx compiler", Project.MSG_VERBOSE );
  +        getLogger().debug( "Using NetRexx compiler" );
           String classpath = getCompileClasspath();
           StringBuffer compileOptions = new StringBuffer();
           StringBuffer fileList = new StringBuffer();
  @@ -674,7 +672,7 @@
               compileOptions.append( compileOptionsArray[ i ] );
               compileOptions.append( " " );
           }
  -        log( compileOptions.toString(), Project.MSG_VERBOSE );
  +        getLogger().debug( compileOptions.toString() );
   
           String eol = System.getProperty( "line.separator" );
           StringBuffer niceSourceList = new StringBuffer( "Files to be 
compiled:" + eol );
  @@ -686,7 +684,7 @@
               niceSourceList.append( eol );
           }
   
  -        log( niceSourceList.toString(), Project.MSG_VERBOSE );
  +        getLogger().debug( niceSourceList.toString() );
   
           // need to set java.class.path property and restore it later
           // since the NetRexx compiler has no option for the classpath
  @@ -702,17 +700,17 @@
   
               if( rc > 1 )
               {// 1 is warnings from real NetRexxC
  -                log( out.toString(), Project.MSG_ERR );
  +                getLogger().error( out.toString() );
                   String msg = "Compile failed, messages should have been 
provided.";
                   throw new TaskException( msg );
               }
               else if( rc == 1 )
               {
  -                log( out.toString(), Project.MSG_WARN );
  +                getLogger().warn( out.toString() );
               }
               else
               {
  -                log( out.toString(), Project.MSG_INFO );
  +                getLogger().info( out.toString() );
               }
           }
           finally
  
  
  
  1.8       +1 -2      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
  
  Index: Native2Ascii.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Native2Ascii.java 2001/12/23 06:31:14     1.7
  +++ Native2Ascii.java 2001/12/23 14:17:40     1.8
  @@ -10,7 +10,6 @@
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Mapper;
  @@ -225,7 +224,7 @@
               }
           }
   
  -        log( "converting " + srcName, Project.MSG_VERBOSE );
  +        getLogger().debug( "converting " + srcName );
           sun.tools.native2ascii.Main n2a
               = new sun.tools.native2ascii.Main();
           if( !n2a.convert( cmd.getArguments() ) )
  
  
  
  1.9       +2 -3      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Javah.java        2001/12/23 06:31:14     1.8
  +++ Javah.java        2001/12/23 14:17:40     1.9
  @@ -290,8 +290,7 @@
       protected void logAndAddFilesToCompile( Commandline cmd )
       {
           int n = 0;
  -        log( "Compilation args: " + cmd.toString(),
  -             Project.MSG_VERBOSE );
  +        getLogger().debug( "Compilation args: " + cmd.toString() );
   
           StringBuffer niceClassList = new StringBuffer();
           if( cls != null )
  @@ -324,7 +323,7 @@
           prefix.append( " to be compiled:" );
           prefix.append( lSep );
   
  -        log( prefix.toString() + niceClassList.toString(), 
Project.MSG_VERBOSE );
  +        getLogger().debug( prefix.toString() + niceClassList.toString() );
       }
   
       /**
  
  
  
  1.11      +3 -4      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java
  
  Index: IContract.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- IContract.java    2001/12/23 06:31:14     1.10
  +++ IContract.java    2001/12/23 14:17:40     1.11
  @@ -18,7 +18,6 @@
   import org.apache.tools.ant.BuildEvent;
   import org.apache.tools.ant.BuildListener;
   import org.apache.tools.ant.DirectoryScanner;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.Javac;
   import org.apache.tools.ant.taskdefs.MatchingTask;
  @@ -976,8 +975,8 @@
   
                       if( srcFile.lastModified() > now )
                       {
  -                        log( "Warning: file modified in the future: " +
  -                             files[ i ], Project.MSG_WARN );
  +                        final String message = "Warning: file modified in 
the future: " + files[ i ];
  +                        getLogger().warn( message );
                       }
   
                       if( !classFile.exists() || srcFile.lastModified() > 
classFile.lastModified() )
  @@ -1069,7 +1068,7 @@
               if( "jikes".equals( compiler ) )
               {
                   icCompiler = compiler;
  -                includeJavaRuntime = true;
  +                m_includeJavaRuntime = true;
                   path.append( getCompileClasspath() );
               }
           }
  
  
  
  1.15      +1 -2      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Cab.java  2001/12/23 06:31:14     1.14
  +++ Cab.java  2001/12/23 14:17:40     1.15
  @@ -17,7 +17,6 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Os;
   import org.apache.tools.ant.DirectoryScanner;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.taskdefs.exec.ExecTask;
   import org.apache.tools.ant.types.FileSet;
  @@ -118,7 +117,7 @@
   
           if( !Os.isFamily( "windows" ) )
           {
  -            log( "Using listcab/libcabinet", Project.MSG_VERBOSE );
  +            getLogger().debug( "Using listcab/libcabinet" );
   
               StringBuffer sb = new StringBuffer();
   
  
  
  
  1.13      +7 -10     
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ANTLR.java        2001/12/23 06:31:14     1.12
  +++ ANTLR.java        2001/12/23 14:17:40     1.13
  @@ -76,13 +76,13 @@
   
       public void setOutputdirectory( File outputDirectory )
       {
  -        log( "Setting output directory to: " + outputDirectory.toString(), 
Project.MSG_VERBOSE );
  +        getLogger().debug( "Setting output directory to: " + 
outputDirectory.toString() );
           this.outputDirectory = outputDirectory;
       }
   
       public void setTarget( File target )
       {
  -        log( "Setting target to: " + target.toString(), Project.MSG_VERBOSE 
);
  +        getLogger().debug( "Setting target to: " + target.toString() );
           this.target = target;
       }
   
  @@ -127,7 +127,7 @@
   
               if( fork )
               {
  -                log( "Forking " + commandline.toString(), 
Project.MSG_VERBOSE );
  +                getLogger().debug( "Forking " + commandline.toString() );
                   int err = run( commandline.getCommandline() );
                   if( err == 1 )
                   {
  @@ -163,27 +163,24 @@
               {
                   int pling = u.indexOf( "!" );
                   String jarName = u.substring( 9, pling );
  -                log( "Implicitly adding " + jarName + " to classpath",
  -                     Project.MSG_DEBUG );
  +                getLogger().debug( "Implicitly adding " + jarName + " to 
classpath" );
                   createClasspath().setLocation( new File( ( new File( jarName 
) ).getAbsolutePath() ) );
               }
               else if( u.startsWith( "file:" ) )
               {
                   int tail = u.indexOf( resource );
                   String dirName = u.substring( 5, tail );
  -                log( "Implicitly adding " + dirName + " to classpath",
  -                     Project.MSG_DEBUG );
  +                getLogger().debug( "Implicitly adding " + dirName + " to 
classpath" );
                   createClasspath().setLocation( new File( ( new File( dirName 
) ).getAbsolutePath() ) );
               }
               else
               {
  -                log( "Don\'t know how to handle resource URL " + u,
  -                     Project.MSG_DEBUG );
  +                getLogger().debug( "Don\'t know how to handle resource URL " 
+ u );
               }
           }
           else
           {
  -            log( "Couldn\'t find " + resource, Project.MSG_DEBUG );
  +            getLogger().debug( "Couldn\'t find " + resource );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to