Catching STDERR output
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 260
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
I'm not sure if y'all take support requests directly through the issue queue, so I'll try my luck. I created the tool Drall and one of it's main features is parallel processing, which is powered by amphp/process.
Reference: context.
Question 1: Catch STDERR
$sOutput = yield ByteStream\buffer($process->getStdout());
Here, I only get the STDOUT contents from $process. How do I get both STDOUT and STDERR, preferably, intermingled output, i.e. not in separate variables. Is appending 2>&1 the only way? Or is there another way?
Question 2: No buffer
Currently, I use ByteStream\buffer($process->getStdout()); where I catch the output in a variable. Is there a way to let the output go to STDOUT directly instead of catching it in a variable?
Any help will be appreciated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced src/Commands/ExecCommand.php around line 149 and read the process stream APIs used there, including getStdout() and ByteStream\buffer(). Determine whether STDERR can be combined with STDOUT and whether output can be forwarded directly; document the supported approach for both questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100