On Wed Oct 02 17:32:49 2013, SALVA wrote:
Show quoted text> It is not possible to capture stderr because the ssh slave process
> runs asynchronously.
OK, that's fine. As long as your code is capturing adequate error information from the channel it is using to communicate with the ssh process.
Show quoted text> > I just found the stderr_fh and stderr_discard constructor options.
> >
> > If you are confident in your error handling code, you should have
> > stderr_discard => 1 be the default, and in a DEBUGGING section
> > recommend users set it to stderr_discard => 0 for additional
> > diagnostics.
>
> ...most ssh based utilities work the way the module does.
Such as?
Show quoted text> In any case, it is too late to change the module API.
I can't see suppressing STDERR by default to likely break many existing uses of this module, and yet it would be a benefit for new adopters of the module.
You could be smart about the change and ignore stderr_discard => 1 if stderr_fh is set. Something like... (pseudo code):
$err_fh = $stderr_fh || ($stderr_discard ? '/dev/null' : 'STDERR')
As long as the interaction between $stderr_fh and $stderr_discard is documented, it should be fine.