Add standard error redirect option
itn3000 opened this issue · comments
Yusuke Ito commented
Currently(rev: 09f95cb), ProcessX.StartAsync throws error when process output stderr.
This may be unexpected result in apps using stderr as logging or progress.
So I propose adding option to redirecting stderr.
In particular, add System.IO.Stream
or System.Buffers.IBufferWriter<byte>
(or char
?) to ProcessX.StartAsync
API
Yoshifumi Kawai commented
thanks for the proposal.
I've added new api GetDualAsyncEnumerable
, and just published in 1.1.0
.
https://github.com/Cysharp/ProcessX#raw-processstderror-stream
Is it okay?
Yusuke Ito commented
This is what I needed, thanks.
Bent Rasmussen commented
Just an idea - a combined async enumerable:
struct ProcessResponse
{
public ProcessResponse(ProcessResponseSource source, string text)
{
Source = source;
Text = text;
}
public ProcessResponseSource Source { get; }
public string Text { get; }
}
public enum ProcessResponseSource
{
Output,
Error,
}