I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-12-22 00:53:11-08 by duaneellis
capture log stderr in addition to stdout from a subprocess
I'm using "expect.pm" - it works well, and I'm using this method:
$object->log_file( \&my_log_function );
I do not see a way to capture the spawn'ed processes STDERR. As an alternative, is there a way to map the sub-processes STDERR to STDOUT (much like one would do a BASH command line) My problem is the subprocess is generating both *stdout* and *stderr* the stdout, I can log, the stderr - I cannot get to (or do not know how).
I can manage the problem *IF* stdout and stderr are the same for the subprocess. I just do not know how to do this. Any suggestions?
Direct Responses: 4341 | Write a response
Posted on 2007-02-14 10:34:16-08 by rgiersig in response to 3876
Re: capture log stderr in addition to stdout from a subprocess
strange... the pty is set up to get both stdout and stderr from the spawned command, so the logging should write both to the logfile. you can of course spawn the command with "2>&1" attached, but i don't think thats the error. maybe the spawned application opens /dev/tty? this should also point to the pty but doesn't reliably do so on all systems...
Direct Responses: Write a response