7

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

I need to know that.

Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61

2 Answers2

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
pyfunc
  • 65,343
  • 15
  • 148
  • 136
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"
Maksym Polshcha
  • 18,030
  • 8
  • 52
  • 77