https://pantsbuild.org/ logo
c

clean-city-64472

01/17/2022, 5:55 PM
I''ve checked docs and searched this Slack and can't see how to redirect terminal output of a pants run to a file. Using
./pants test  my/path/to/test.py -l=debug > /tmp/test.log
doesn't seem to work.
f

fast-nail-55400

01/17/2022, 6:03 PM
There is
--logdir
to change where some logs files are written.
e

enough-analyst-54434

01/17/2022, 6:04 PM
Pants aside, you're only redirecting stdout there.
f

fast-nail-55400

01/17/2022, 6:04 PM
also log output goes to stderr, so
2>
instead of
>
should work
or better:
>/tmp/test.log 2>&1
e

enough-analyst-54434

01/17/2022, 6:05 PM
In bash and others? you can
&>
to redirect stdout and stderr at once.
c

clean-city-64472

01/17/2022, 6:07 PM
Ahhh okay - thanks. I tried
--logdir
and didn't seem to get anything but i'll keep at it.
2>
works @fast-nail-55400 🙏
sorry for the noobness 😳
c

curved-television-6568

01/18/2022, 6:48 AM
we’ve all been new at some point 😉