Wednesday, August 19

Redirect AntBuilder output in Groovy

In Groovy you can use the following code to redirect default AntBuilder output to a log file:

def ant = new AntBuilder()
def logOutput = new PrintStream(logFile)

// redirect std out and error output
System.out = logOutput
System.err = logOutput

// redirect ant output

1 comment:

fepede said...

Thanks for the post Nick!

it is exactly what I was googlin' for :)