I have started using Mathematica to automate file backup operations. The logistics I need make Mathematica a good choice. I am testing and developing the Notebook manually, and Print outputs document the operational events. The saved Notebook provides a record of the process for that day.
I would like to have an easy way to direct Print output to a separate file, for example, by adding
DirectPrintOutputTo["filename "<>DateList["Year","Month","Day"]<>".txt"]
at the beginning of a Notebook. The advantages of this approach seem obvious. I assume I would need to load my function from a package before calling it. Is something like this this possible? Any suggestions about how to do it?
Alternatively, maybe I could write a print function called PrintTo that would, on first use, open an output file with the name assigned to printToFileName, and I could use the editor to change all the Print functions to PrintTo functions. Not so fancy, but I think I know how to how to do it.
I think that I answered my own question, in the sense that my alternative idea seems straightforward and pretty implementable.
Print. So it is not good suggestion then :) – Kuba Jul 26 '13 at 19:54