Browse files

Merge pull request #14 from ashchristopher/master

Log the URL used in the RESTful API request.
  • Loading branch information...
2 parents c2285c5 + e391c8b commit e757d973a448ba9a32005972fa04459f12e2690e @dlo dlo committed Sep 27, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 bottlenose/api.py
View
4 bottlenose/api.py 100644 → 100755
@@ -9,6 +9,7 @@
import hmac
import time
import socket
+import logging
from hashlib import sha256
@@ -79,6 +80,8 @@ def __getattr__(self, k):
Style=self.Style, Region=self.Region, Timeout=self.Timeout)
def __call__(self, **kwargs):
+ logger = logging.getLogger(__name__)
+
kwargs['Timestamp'] = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
kwargs['Operation'] = self.Operation
kwargs['Version'] = self.Version
@@ -110,6 +113,7 @@ def __call__(self, **kwargs):
api_request = urllib2.Request(api_string, headers={"Accept-Encoding": "gzip"})
if self.Timeout:
socket.setdefaulttimeout(self.Timeout)
+ logger.debug("Amazon URL: %s" % api_string)
response = urllib2.urlopen(api_request)
if self.Timeout:
socket.setdefaulttimeout(None)

0 comments on commit e757d97

Please sign in to comment.