Message205446
looking at
http://hg.python.org/cpython/file/543c76769c14/Lib/http/client.py#l847
(logging in HTTPConnection.send method; but this code has been same since like forever) I see that the HTTP request is NOT pretty printed:
if self.debuglevel > 0:
print("send:", repr(data))
whereas response in effect (because every header is printed separately) is. Wouldn't it be better to pretty print the request as well?
Otherwise I get quite unreadable debugging logs like the following (notice how much response is more readable than request).
It seems to me that proper solution could be just to replace repr() here with something more readable. Wouldn't just str() help? Barring that we can go all the way to pprint.pformat(). |
|
Date |
User |
Action |
Args |
2013-12-07 10:44:40 | mcepl | set | recipients:
+ mcepl |
2013-12-07 10:44:40 | mcepl | set | messageid: <1386413080.92.0.351429113589.issue19917@psf.upfronthosting.co.za> |
2013-12-07 10:44:40 | mcepl | link | issue19917 messages |
2013-12-07 10:44:40 | mcepl | create | |
|