I am currently using sink
to save my output to some text file:
sink('out.txt', append=TRUE, split=TRUE)
I would like to add to each output/message the date time at wich it was given out. sink
seems not to support that. What would be the simplest way to achieve this?
That is, my expected output is
[1] "some message"
But I would like it to be
2014-12-02 13:12:12 [1] "some message"
Or something along these lines.
I prefer a solution where I do not have to adjust every single output of my script. I'd much rather just set this up in a config/include file at the start only, to keep the code clean and manageable.