ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs Recorder.java VerbosityLevelChoices.java
Date Sat, 12 Jan 2002 23:40:09 GMT
donaldp     02/01/12 15:40:09

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Recorder.java
  Removed:     proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        VerbosityLevelChoices.java
  Log:
  Use LogLevel and thus remove the need for VerbosityLevelChoices
  
  Revision  Changes    Path
  1.8       +7 -12     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Recorder.java
  
  Index: Recorder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Recorder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Recorder.java	30 Dec 2001 09:15:37 -0000	1.7
  +++ Recorder.java	12 Jan 2002 23:40:09 -0000	1.8
  @@ -15,6 +15,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  +import org.apache.antlib.core.LogLevel;
   
   /**
    * This task is the manager for RecorderEntry's. It is this class that holds all
  @@ -87,30 +88,25 @@
        * @param level The new Loglevel value
        * @see VerbosityLevelChoices
        */
  -    public void setLoglevel( final VerbosityLevelChoices level )
  +    public void setLoglevel( final LogLevel level )
       {
           //I hate cascading if/elseif clauses !!!
  -        String lev = level.getValue();
  -        if( lev.equalsIgnoreCase( "error" ) )
  +        if( LogLevel.ERROR == level )
           {
               loglevel = Project.MSG_ERR;
           }
  -        else if( lev.equalsIgnoreCase( "warn" ) )
  +        else if( LogLevel.WARN == level )
           {
               loglevel = Project.MSG_WARN;
           }
  -        else if( lev.equalsIgnoreCase( "info" ) )
  +        else if( LogLevel.INFO == level )
           {
               loglevel = Project.MSG_INFO;
           }
  -        else if( lev.equalsIgnoreCase( "verbose" ) )
  +        else if( LogLevel.DEBUG == level )
           {
               loglevel = Project.MSG_VERBOSE;
           }
  -        else if( lev.equalsIgnoreCase( "debug" ) )
  -        {
  -            loglevel = Project.MSG_DEBUG;
  -        }
       }
   
       /**
  @@ -193,7 +189,6 @@
               outputStream = new FileOutputStream( name, m_append.booleanValue() );
           }
   
  -        final PrintStream out = new PrintStream( outputStream );
  -        return out;
  +        return new PrintStream( outputStream );
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message