I'm trying to display the result log data of a long running process that I've kicked off using groovy's String.execute() method.
command = "ls -la"
Process proc = command.execute().text
And I get the out put as expected.
However, if the command is some long running process like a slowly running TestNG test which prints out logging data as it runs, I'm unable to execute it and see the logging in real time.
I've tried variations on this:
String command "Some long running command that ouptuts logging info"
Process proc = command.execute().text
StringBuffer outBuff = new StringBuffer()
proc.consumeProcessOutputStream(outBuff)
while(outBuff != "")
{
println outBuff.toString()
}
Is this possible?