My application is invoked from run.py
. I've installed Pygments and I'd like to redirect Python's output so that as tracebacks occur, they're formatted in an easier to read format.
This is the command that I've tried, python run.py 2>&1 | pygmentize -l py
Redirecting both stdout
and stderr
through pygmentize. The pygmentize documentation says that it will read from stdin
if no file is provided, "If no input file is given, use stdin, if -o is not given, use stdout."
However, when I redirect like this, no output--errors or log statements or anything else--is output to my terminal.
When I run my command without piping its output into pygmentize, i.e. python run.py 2>&1
I get this output:
INFO:werkzeug: * Running on http://0.0.0.0:5000/
INFO:werkzeug: * Restarting with reloader
Any suggestions?