org.apache.tools.ant.taskdefs
Class LogOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--org.apache.tools.ant.taskdefs.LogOutputStream
- public class LogOutputStream
- extends java.io.OutputStream
Logs each line written to this stream to the log system of ant.
Tries to be smart about line separators.
TODO: This class can be split to implement other line based processing
of data written to the stream.
Constructor Summary |
LogOutputStream(Task task,
int level)
Creates a new instance of this class. |
Method Summary |
void |
close()
Writes all remaining |
int |
getMessageLevel()
|
protected void |
processBuffer()
Converts the buffer to a string and sends it to processLine |
protected void |
processLine(java.lang.String line)
Logs a line to the log system of ant. |
protected void |
processLine(java.lang.String line,
int level)
Logs a line to the log system of ant. |
void |
write(int cc)
Write the data to the buffer and flush the buffer, if a line
separator is detected. |
Methods inherited from class java.io.OutputStream |
flush, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogOutputStream
public LogOutputStream(Task task,
int level)
- Creates a new instance of this class.
- Parameters:
task
- the task for whom to loglevel
- loglevel used to log data written to this stream.
write
public void write(int cc)
throws java.io.IOException
- Write the data to the buffer and flush the buffer, if a line
separator is detected.
- Overrides:
write
in class java.io.OutputStream
- Parameters:
cc
- data to log (byte).
processBuffer
protected void processBuffer()
- Converts the buffer to a string and sends it to
processLine
processLine
protected void processLine(java.lang.String line)
- Logs a line to the log system of ant.
- Parameters:
line
- the line to log.
processLine
protected void processLine(java.lang.String line,
int level)
- Logs a line to the log system of ant.
- Parameters:
line
- the line to log.
close
public void close()
throws java.io.IOException
- Writes all remaining
- Overrides:
close
in class java.io.OutputStream
getMessageLevel
public int getMessageLevel()
Includes only those classes commonly used by task writers. The Ant 1.3 distribution includes complete Javadoc for all classes included in Ant, though in most cases these are not intended as APIs.