0

I am trying to run a script and I want its stdout to be redirected to a file. Script is using logging module for logging. When I try to run

python verifyPhone.py -f dupl.csv  1> deleted.txt 

It starts printing output to screen instead of file. But if I replace logger.info with print, I can see outputs in the file. I am not able to figure out why this is happening.
Does logger does not print to stdout ?
How I can see output on terminal if my stdout is already redirected to file ?

Krrish Raj
  • 1,505
  • 12
  • 28
  • Use `python verifyPhone.py -f dupl.csv 2> deleted.txt` to redirect stderr. – Amaro Vita Apr 06 '18 at 07:12
  • I dont want to redirect stderr. Does logging module by default writes to stderr even if i log something at debug or info level ? – Krrish Raj Apr 06 '18 at 07:14
  • this could be probably useful: https://stackoverflow.com/questions/14058453/making-python-loggers-output-all-messages-to-stdout-in-addition-to-log – Ricardo B. Apr 06 '18 at 07:20

0 Answers0