LogStreamHandler (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: LogStreamHandler

# Class LogStreamHandler

java.lang.Object
org.apache.tools.ant.taskdefs.PumpStreamHandler
org.apache.tools.ant.taskdefs.LogStreamHandler

All Implemented Interfaces:
  `ExecuteStreamHandler`

public class LogStreamHandler extends PumpStreamHandler
Logs standard output and error of a subprocess to the log system of ant.

Since:
  Ant 1.2

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class PumpStreamHandler

  `PumpStreamHandler.ThreadWithPumper`
  Modifier and Type
  Class
  Description
  `protected static class`
  `PumpStreamHandler.ThreadWithPumper`
  Specialized subclass that allows access to the running StreamPumper.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LogStreamHandler(ProjectComponent pc, int outlevel, int errlevel)`
  Creates log stream handler
  `LogStreamHandler(Task task, int outlevel, int errlevel)`
  Creates log stream handler

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `stop()`
  Stop the log stream handler.

  ### Methods inherited from class PumpStreamHandler

  `createProcessErrorPump, createProcessOutputPump, createPump, createPump, createPump, finish, getErr, getOut, setProcessErrorStream, setProcessInputStream, setProcessOutputStream, start`
  Modifier and Type
  Method
  Description
  `protected void`
  `createProcessErrorPump(InputStream is, OutputStream os)`
  Create the pump to handle error output.
  `protected void`
  `createProcessOutputPump(InputStream is, OutputStream os)`
  Create the pump to handle process output.
  `protected Thread`
  `createPump(InputStream is, OutputStream os)`
  Creates a stream pumper to copy the given input stream to the given output stream.
  `protected Thread`
  `createPump(InputStream is, OutputStream os, boolean closeWhenExhausted)`
  Creates a stream pumper to copy the given input stream to the given output stream.
  `protected Thread`
  `createPump(InputStream is, OutputStream os, boolean closeWhenExhausted, boolean nonBlockingIO)`
  Creates a stream pumper to copy the given input stream to the given output stream.
  `protected final void`
  `finish(Thread t)`
  Waits for a thread to finish while trying to make it finish quicker by stopping the pumper (if the thread is a `ThreadWithPumper` instance) or interrupting the thread.
  `protected OutputStream`
  `getErr()`
  Get the error stream.
  `protected OutputStream`
  `getOut()`
  Get the output stream.
  `void`
  `setProcessErrorStream(InputStream is)`
  Set the `InputStream` from which to read the standard error of the process.
  `void`
  `setProcessInputStream(OutputStream os)`
  Set the `OutputStream` by means of which input can be sent to the process.
  `void`
  `setProcessOutputStream(InputStream is)`
  Set the `InputStream` from which to read the standard output of the process.
  `void`
  `start()`
  Start the `Thread`s.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LogStreamHandler

    public LogStreamHandler(Task task, int outlevel, int errlevel)
    Creates log stream handler
    Parameters:
      `task` - the task for whom to log
      `outlevel` - the loglevel used to log standard output
      `errlevel` - the loglevel used to log standard error

  - ### LogStreamHandler

    public LogStreamHandler(ProjectComponent pc, int outlevel, int errlevel)
    Creates log stream handler
    Parameters:
      `pc` - the project component for whom to log
      `outlevel` - the loglevel used to log standard output
      `errlevel` - the loglevel used to log standard error

- ## Method Details

  - ### stop

    public void stop()
    Stop the log stream handler.
    Specified by:
      `stop` in interface `ExecuteStreamHandler`
    Overrides:
      `stop` in class `PumpStreamHandler`