On Mon, Feb 8, 2016 at 6:11 PM, ben <[email protected]> wrote: > Is there a convenient way to do this? > > If not, what is the inconvenient way? > > I managed to log to a file by redirecting stdout
Use the `code_warntype` function and pass a file handle to it as the first argument. > > ~~~ > rdstdout, wrstdout = redirect_stdout() > @code_warntype(myuglyfunction()) > filename=string(Int(Dates.datetime2unix(now())))*"-type-stability.log" > file=open(filename,"w") > write(file,readavailable(rdstdout)) > close(file) > ~~~ > > but I am not sure how to resume the normal behavior of stdout after that > > Thanks! > > ben
