From: Aleksey Maksimov Date: Tue, 2 Jul 2013 10:14:38 +0000 (+0800) Subject: Added code to debug HTTP requests (commented) X-Git-Tag: v0.2.23~113^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9fb9aaf8668074e73863556f7a82bdc99f558bf;p=tools%2Fpython-jenkinsapi.git Added code to debug HTTP requests (commented) --- diff --git a/jenkinsapi/utils/requester.py b/jenkinsapi/utils/requester.py index f026bc1..d01ec55 100644 --- a/jenkinsapi/utils/requester.py +++ b/jenkinsapi/utils/requester.py @@ -1,5 +1,18 @@ import requests from jenkinsapi.exceptions import JenkinsAPIException +# import logging + +# # these two lines enable debugging at httplib level (requests->urllib3->httplib) +# # you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. +# # the only thing missing will be the response.body which is not logged. +# import httplib +# httplib.HTTPConnection.debuglevel = 1 + +# logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests +# logging.getLogger().setLevel(logging.DEBUG) +# requests_log = logging.getLogger("requests.packages.urllib3") +# requests_log.setLevel(logging.DEBUG) +# requests_log.propagate = True class Requester(object):