Closed mrjamesriley closed 10 years ago
run
doesn't capture output other than stdout. You're not seeing it in the log because it's going to stderr. If you have a good way of capturing and returning stderr and stdout separately, I'd love to hear it. Unfortunately, I'm not entirely sure there is one. Maybe popen4, but I'm not sure that's maintained anymore. Sorry about that. I'd be willing to entertain PRs if you come up with something, though.
You know, I just realized this could be done fairly easily for the process-spawn and posix-spawn runners. It will require ignoring the result of run
and keeping the CommandLine
object around for inspection, but it should be pretty straightforward. I'll work on that this morning.
I have a PR in #67 so if you'd like to comment on that with additions, comments, complaints, that would be great. I'm going to close this in favor of continuing discussion there. Thanks.
Hello there,
Not sure if I'm missing something crazy obvious here.
If I run a simple command in terminal like:
ls blah
, then I get the following output:ls: blah: No such file or directory
, given that the 'blah' does not exist in my case, of course.Yet, when running
Cocaine::CommandLine.new('ls', 'blah').run
- I see no way to access the error message above. The ExitStatusError exception gives me a message like:The output of the
run
command gives menil
. And when using the :logger option, all I get is:This is for a script I'm written, where I want to log the actual output of the failed command, otherwise I've got little to work with when reviewing logs later.
So, what to do?
Thanks for a great Gem by the way, it's otherwise a joy to use.
cheers, James