Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Log http requests (silent by default) #300

Merged
merged 2 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions datalab/utils/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import json
import urllib.request, urllib.parse, urllib.error
import httplib2
import logging


log = logging.getLogger(__name__)


# TODO(nikhilko): Start using the requests library instead.
Expand Down Expand Up @@ -132,6 +136,7 @@ def request(url, args=None, data=None, headers=None, method=None,

response = None
try:
log.debug('request: method[%(method)s], url[%(url)s], body[%(data)s]' % locals())
response, content = http.request(url,
method=method,
body=data,
Expand Down
5 changes: 5 additions & 0 deletions google/datalab/utils/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import json
import urllib.request, urllib.parse, urllib.error
import httplib2
import logging


log = logging.getLogger(__name__)


# TODO(nikhilko): Start using the requests library instead.
Expand Down Expand Up @@ -132,6 +136,7 @@ def request(url, args=None, data=None, headers=None, method=None,

response = None
try:
log.debug('request: method[%(method)s], url[%(url)s], body[%(data)s]' % locals())
response, content = http.request(url,
method=method,
body=data,
Expand Down