Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using httplib in my python code and have following mentioned.


import httplib

httplib.HTTPConnection.debuglevel = 2



I do get all the info I need but httplib library is printing it on console. I do not know any way by which I can get all those logs in file and not on console.

Your help is appreciated.
Posted

1 solution

If HTTPConnection does not have a defined method to write to a file, then you would need to redirect stdout, as described in Redirecting all kinds of stdout in Python - Eli Bendersky's website[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900