If we time out an exec call today (e.g. after 15 minutes) and kill it then we lose all logs. Also, we run the risk of overloading our buffer. We should instead use another approach (spawn?) to stream the logs and save our copy locally.
So basically we want to preserve stdout for printing with PR warnings, but additionally log it string by string?
I was wondering if the experience for everyone would also be better if we combine stdout & stderr too actually (e.g. 2>&1).
But the main reasons are:
I managed to redirect outputs for Cocoapods run:

Sorry, I think I confused you. I still want it collected into a single “result”, just done using streaming and not exec.
https://stackoverflow.com/a/32872753/2506019 — is this approach correct? (Asynchronous part)
I'm trying to mimic our current rawExec function, returning same ExecResult at the end.
If convenient, I can also immediately log spawned command output (like in the screenshot above).
Logging immediately would result in a lot of additional logging messages, which is not ideal. So I prefer to buffer it and only return it at the end for logging.
Although we don’t really execute any other code while we’re waiting for the child process to finish, having an asynchronous implementation is most forwards compatible