FileDocCategorySizeDatePackage
LogOutputStream.javaAPI DocApache Ant 1.702932Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs

LogOutputStream

public class LogOutputStream extends org.apache.tools.ant.util.LineOrientedOutputStream
Logs each line written to this stream to the log system of ant. Tries to be smart about line separators.
since
Ant 1.2

Fields Summary
private org.apache.tools.ant.ProjectComponent
pc
private int
level
Constructors Summary
public LogOutputStream(org.apache.tools.ant.Task task, int level)
Creates a new instance of this class.

param
task the task for whom to log
param
level loglevel used to log data written to this stream.


                                   
         
        this((ProjectComponent) task, level);
    
public LogOutputStream(org.apache.tools.ant.ProjectComponent pc, int level)
Creates a new instance of this class.

param
pc the project component for whom to log
param
level loglevel used to log data written to this stream.
since
Ant 1.6.3

        this.pc = pc;
        this.level = level;
    
Methods Summary
public intgetMessageLevel()
Get the level.

return
the log level.

        return level;
    
protected voidprocessBuffer()
Converts the buffer to a string and sends it to processLine

        try {
            super.processBuffer();
        } catch (IOException e) {
            // impossible since *our* processLine doesn't throw an IOException
            throw new RuntimeException("Impossible IOException caught: " + e);
        }
    
protected voidprocessLine(java.lang.String line)
Logs a line to the log system of ant.

param
line the line to log.

        processLine(line, level);
    
protected voidprocessLine(java.lang.String line, int level)
Logs a line to the log system of ant.

param
line the line to log.
param
level the logging level to use.

        pc.log(line, level);