I'm working on quite big project(a lot of modules) and I want to save whole stdout to a file. I tried logging library, but it saves only output of log(something). In project there is a lot of print(). So how can I save whole content of console (basically stdout) to a file? Important is that stdout must be still visible.
Asked
Active
Viewed 646 times
0
-
`open(pythonfile, 'r').read().replace('print(', 'logging.logger.info(')` – Alexander McFarlane Aug 09 '17 at 14:24
-
In linux: `python yourfilename.py > outputfilelog` – Laszlowaty Aug 09 '17 at 14:36
-
In some other module there is runned logging library. If I try to save stdout in any way, record is interrupted just after calling to logging – maz00r Aug 09 '17 at 17:17