What is the maximum debuglevel for a Python httplib
Asked Answered
P

2

7

These docs do not say what the maximum debug level is.

I need to know that.

Paul answered 6/7, 2012 at 21:46 Comment(0)
A
11

I went through httplib.py and the code is littered with the following statement:

if self.debuglevel > 0:

This means there are just two levels.

  1. debuglevel less than or equal to zero
  2. debuglevel greater than zero

Yes this could have been better documented.

Also any time you need to check such an information, you can easily look at the code. Here is my favorite approach to locate a source file for a particular module.

>>> import httplib
>>> httplib.__file__
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc'

Now you can just open the following file to go through it's source code

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py
Axial answered 6/7, 2012 at 21:53 Comment(1)
"Yes this could have been better documented." Agreed. Thanks for answering this.Polo
P
2

As I saw from httplib.py sources there are only 2 debug levels:

  • <=0 - no debug info
  • any value greater than zero - turn on debug info

This is a typical check:

if self.debuglevel > 0:
        print "blablabla"
Papaw answered 6/7, 2012 at 21:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.