Does anyone have a good built-in solution for determining which output stream console output is coming from?
Você pode simplesmente usar a sintaxe Redirecionamento para ver STDOUT versus STDERR para separar arquivos . No exemplo abaixo, o arquivo A conteria STDOUT, em que fileB conteria STDERR.
Exemplo: command >> fileA 2>> fileB Redirect output and errors to separate files
STDIN = 0 Keyboard input STDOUT = 1 Text output STDERR = 2 Error text output UNDEFINED = 3-9 command 2> filename Redirect any error message into a file command 2>> filename Append any error message into a file (command)2> filename Redirect any CMD.exe error into a file command > file 2>&1 Redirect errors and output to one file command > fileA 2> fileB Redirect output and errors to separate files