Another noob question which remained unanswered in the discord user chat, and on which I couldn't really find any specific answer, nor could I manage to answer myself.
I have a
child: Child which is spawned using
.spawn() and I want to stream read both
stderr from it using
BufReader and I can't use it anywhere else after that.
&child.stdout doesn't work as
BufReader seems to be needing to own the emitter.
I haven't found any examples of using both
stderr with a
Child using a streamed reader, only using a single
.wait_with_output and getting the whole
stderr contents at once, which may be quite a large block of text.
Why I want it to work this way - I want to read stdout line by line to parse it for valuable info (upload links of the
appcenter CLI for example) - the main reason. I also want to append the log files with those lines to robustly check for any output of running commands in case of something stops abruptly.
There are really two questions:
- How do I read both
- Is it the correct way to approach solving the problem of parsing lines and using log files?