ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Exec.java
Date Mon, 03 Jul 2000 12:26:30 GMT
conor       00/07/03 05:26:27

  Modified:    src/main/org/apache/tools/ant/taskdefs Exec.java
  Log:
  Have Exec log messages from its error stream with MSG_WARN rather
  than having all messages logged at MSG_INFO.
  
  Revision  Changes    Path
  1.11      +8 -8      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java
  
  Index: Exec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Exec.java	2000/06/26 10:47:36	1.10
  +++ Exec.java	2000/07/03 12:26:26	1.11
  @@ -118,9 +118,9 @@
   
               // copy input and error to the output stream
               StreamPumper inputPumper =
  -                new StreamPumper(proc.getInputStream(), "exec", project, fos);
  +                new StreamPumper(proc.getInputStream(), Project.MSG_INFO, project, fos);
               StreamPumper errorPumper =
  -                new StreamPumper(proc.getErrorStream(), "error", project, fos);
  +                new StreamPumper(proc.getErrorStream(), Project.MSG_WARN, project, fos);
   
               // starts pumping away the generated output/error
               inputPumper.start();
  @@ -167,17 +167,17 @@
       // Process's runtime.
       class StreamPumper extends Thread {
           private BufferedReader din;
  -        private String name;
  +        private int messageLevel;
           private boolean endOfStream = false;
           private int SLEEP_TIME = 5;
           private Project project;
           private PrintWriter fos;
   
  -        public StreamPumper(InputStream is, String name, Project project, PrintWriter fos)
{
  -            this.din     = new BufferedReader(new InputStreamReader(is));
  -            this.name    = name;
  +        public StreamPumper(InputStream is, int messageLevel, Project project, PrintWriter
fos) {
  +            this.din = new BufferedReader(new InputStreamReader(is));
  +            this.messageLevel = messageLevel;
               this.project = project;
  -            this.fos     = fos;
  +            this.fos = fos;
           }
   
           public void pumpStream()
  @@ -189,7 +189,7 @@
   
                   if (line != null) {
                       if (fos == null)
  -                        project.log(line, name, Project.MSG_INFO);
  +                        project.log(line, messageLevel);
                       else
                           fos.println(line);
                   } else {
  
  
  

Mime
View raw message