I want to redirect all the output, even from the external modules which are imported to a file.
sys.stdout = open('logfile', 'a')
doesn't do the job for the logging done by external files is echoed on stdout.
I've tinkered with the source code of external modules, and they are deeply knitted with python's "logging" module and rely on it for the output.
Also, I don't want to use stream redirection using > operator.