It may be helpful to adopt a library like shpyx that offers the ability to capture the output from the running process.
This would then allow for:
- The output log to be written to a config.ini specified file/directory at exit
- Live output to be made available for debugging, e.g. when an environment variable like
REAPP_DEBUG_MODE is detected