I am scheduling some scripts with taskscheduleR for R. There are some performance issues I want to diagnose, but the problem is that standard logs from scheduler does not contain timestamps and contain only results of print and cat statements, so it is difficult to tell which code lines take most time. There are also some scripts sourced inside scheduled scripts.
How can I extend logging to contain timestamp or running time of every code line including ones that are sources?