cmd
cmd copied to clipboard
Is there a way to have stderr buffered into stdout
I know the standard os/exec lib has a function called CombinedOutput. Can go-cmd do something similar? My use case is after an executable has run, I am writing the stdout / stderr buffers to a log file. If the executable's output produces both stdout and stderr output, I don't have a way to produce a consolidated log in the order the output was received. I know this can be handled by streaming and the select, but was wanting to use the buffer since I don't have a need for real time inspection.
I have taken an initial pass at adding this functionality. Here is the branch from my fork. All tests are passing including the additional one I added cloned from the bothOutput Test and make applicate changes.
https://github.com/jwomackgsa/cmd/tree/add-buffered-combinedoutput
#76
Thank you for the contribution, @jwomackgsa. Merged, and will be in release as v1.4.2.