Not sure if it is the same case that you want
Usually i just redirect stdout and stderr to proper files:
```
cat filetoread.log | while read -r line;do
echo $line | another_script.sh 1>>/tmp/stdout.log 2>>/tmp/stderr.log
done
```
and run another script tail the error log:
```
tail -F /tmp/stderr.log | while read -r line;do
echo $line | do_whatever.sh
done
```