You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use embedded R for better management including timestamped output #243
Original thread on {shinytest2} for context.
Can there be an option to toggle timestamping of output from stderr (and also stdout) for a processx background r process via r_bg?
That is not possible for processx, but it is possible to callr. In fact, it is basically already implemented in the asciicast package, which creates a JSON file with time stamps.
{shinytest2} already uses {callr}, so no problem there.
I hope I'm not missing something obvious, but I don't see any usage (other than within testing code) of {callr} within {asciicast}.
I do see multiple usages of processx::poll(list(con)) inside a while loop. I believe this would block the main R session which we can't have for testing or interactive use within the terminal. For {asciicast}, you're allowed to block the main R session while the function call is performing the replay.
asciicast does not use callr, it is an alternative. It uses an embedded R in a subprocess instead of running the usual R executable from the terminal, which allows a lot more control.
So you cannot substitute callr with asciicast. But the same mechanism that is in asciicast is coming to callr soonish, and then you can have timestamps in the output.
changed the title [-]Feature request: Capture all R Console output with timestamp?[/-][+]Use embedded R for better management including timestamped output[/+]on May 17, 2026
Activity
gaborcsardi commentedon Jan 10, 2023
That is not possible for processx, but it is possible to callr. In fact, it is basically already implemented in the asciicast package, which creates a JSON file with time stamps.
yogat3ch commentedon Jan 10, 2023
@schloerke It sounds like a rework of
shinytest2to usecallrwould be necessary, is that a substantial undertaking?schloerke commentedon Jan 10, 2023
{shinytest2}already uses{callr}, so no problem there.I hope I'm not missing something obvious, but I don't see any usage (other than within testing code) of
{callr}within{asciicast}.I do see multiple usages of
processx::poll(list(con))inside a while loop. I believe this would block the main R session which we can't have for testing or interactive use within the terminal. For{asciicast}, you're allowed to block the main R session while the function call is performing the replay.gaborcsardi commentedon Jan 10, 2023
asciicast does not use callr, it is an alternative. It uses an embedded R in a subprocess instead of running the usual R executable from the terminal, which allows a lot more control.
So you cannot substitute callr with asciicast. But the same mechanism that is in asciicast is coming to callr soonish, and then you can have timestamps in the output.
schloerke commentedon Jan 10, 2023
Sounds good. I look forward to the upcoming feature in
{callr}. Thank you!yogat3ch commentedon Jan 10, 2023
Awesome, appreciative of the discussion and look forward to the forthcoming
callrfeatures![-]Feature request: Capture all R Console output with timestamp?[/-][+]Use embedded R for better management including timestamped output[/+]gaborcsardi commentedon Jun 4, 2026
I started working on this in https://github.com/r-lib/callr/tree/feature/embedded-r