[issue24255] Replace debuglevel-related logic with logging
Conrad Ho added the comment: Hi, I have referenced the original patch and created an updated patch that uses the logging module + f-strings in place of the print statements in the http.client module. Also updated the relevant tests for print/logging in test_httplib to reflect these changes. The HTTPHandlerTest testcase from test_logging was also affected. In the testcase, it gets a logger with name 'http' and adds a logging.HTTPHandler to it. In our patch, we create a http.client logger, which happens to be considered a child of this testcase logger under the logger naming hierarchy. This causes http.client logging events to propagate up to the 'http' logger and for the testcase to loop infinitely (ie. the HTTPHandler calls http.client functions internally. These functions log events using the http.client logger, which propagate up to the testcase http logger which calls HttpHandler again). I have simply changed the testcase getLogger name to not be 'http' and clash with that http.client module logger. -- nosy: +Conrad Ho Added file: https://bugs.python.org/file47727/http-client-logging-v2.patch ___ Python tracker <https://bugs.python.org/issue24255> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24255] Replace debuglevel-related logic with logging
Conrad Ho added the comment: Thanks Eryn! @Sanyam if you apply the original patch directly that will currently result in some merge failures, and there are test fixes etc that I did on the second patch. Think we should combine them. I just made the chgs suggested by David on my own forked repo. Do you want me to submit a PR directly? -- ___ Python tracker <https://bugs.python.org/issue24255> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24255] Replace debuglevel-related logic with logging
Conrad Ho added the comment: @Eryn in the news blurb thing I'm going to say "original patch done by Eryn Wells." Your employer should be okay with that right? :D -- ___ Python tracker <https://bugs.python.org/issue24255> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24255] Replace debuglevel-related logic with logging
Conrad Ho added the comment: Hi Sanyam, were you able to fix the CI errors? The fixes for the infinite loop that you are seeing in your PR CI run and the changes to test correct logging (vs testing stdout) etc are in my original patch already. I've checked that the test suite passes with my patch. Otherwise, should I try to submit a PR / what's the best way to move this forward? It's my first contribution to cpython! -- ___ Python tracker <https://bugs.python.org/issue24255> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com