Added copyMergedOutput().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2297 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2008-04-28 22:00:55 +00:00
parent 099f6be796
commit 0cf663e07b
@@ -49,6 +49,18 @@ public class ProcessLogger
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
}
/**
* Starts a thread to copy the output of the supplied process's stdout stream to the supplied
* target logger (it assumes the process was created with a ProcessBuilder and the stdout and
* stderr streams have been merged).
*
* @see #copyOutput
*/
public static void copyMergedOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " output", process.getInputStream()).start();
}
protected static class StreamReader extends Thread
{
public StreamReader (Logger target, String name, InputStream input)