TheFriendlyCoder / friendlyshell

Framework for writing interactive Python command line interfaces, similar to the 'cmd' built in class.
Apache License 2.0
0 stars 0 forks source link

allow output from batch mode to be redirected and pipped #81

Closed TheFriendlyCoder closed 6 years ago

TheFriendlyCoder commented 6 years ago

For some reason when you pipe the output from a friendly shell session when running it in batch mode the output stream is empty. This prevents, say, piping the output to grep to look for patterns. This needs to be fixed.

TheFriendlyCoder commented 6 years ago

Currently the output system in friendly shell uses the Python logging APIs exclusively for all output streaming. Unfortunately it appears as though the default loggers redirect ALL output to stderr instead of stdout, which in turn causes the output piping and redirection to not work as expected.

NOTE: This can be worked around by redirecting stderr to stdout something like this: myshell script.fsh 2>&1 | grep error