You can also use RedirectOutput.