Browse Source

Pass in streams to constructor rather than task + level. This allows it to be more easily configured for different tasks.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270406 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
c838d08144
2 changed files with 6 additions and 22 deletions
  1. +3
    -11
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/LogStreamHandler.java
  2. +3
    -11
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/LogStreamHandler.java

+ 3
- 11
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/LogStreamHandler.java View File

@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs.exec;

import java.io.IOException;
import java.io.OutputStream;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;

/**
* Logs standard output and error of a subprocess to the log system of ant.
@@ -19,17 +19,9 @@ import org.apache.tools.ant.Task;
public class LogStreamHandler
extends PumpStreamHandler
{
/**
* Creates a new instance of this class.
*
* @param task the task for whom to log
* @param outlevel the loglevel used to log standard output
* @param errlevel the loglevel used to log standard error
*/
public LogStreamHandler( Task task, int outlevel, int errlevel )
public LogStreamHandler( final OutputStream output, final OutputStream error )
{
super( new LogOutputStream( task, outlevel ),
new LogOutputStream( task, errlevel ) );
super( output, error );
}

public void stop()


+ 3
- 11
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/LogStreamHandler.java View File

@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs.exec;

import java.io.IOException;
import java.io.OutputStream;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;

/**
* Logs standard output and error of a subprocess to the log system of ant.
@@ -19,17 +19,9 @@ import org.apache.tools.ant.Task;
public class LogStreamHandler
extends PumpStreamHandler
{
/**
* Creates a new instance of this class.
*
* @param task the task for whom to log
* @param outlevel the loglevel used to log standard output
* @param errlevel the loglevel used to log standard error
*/
public LogStreamHandler( Task task, int outlevel, int errlevel )
public LogStreamHandler( final OutputStream output, final OutputStream error )
{
super( new LogOutputStream( task, outlevel ),
new LogOutputStream( task, errlevel ) );
super( output, error );
}

public void stop()


Loading…
Cancel
Save