libcloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r905494 - /incubator/libcloud/trunk/libcloud/base.py
Date Tue, 02 Feb 2010 01:52:52 GMT
Author: pquerna
Date: Tue Feb  2 01:52:52 2010
New Revision: 905494

URL: http://svn.apache.org/viewvc?rev=905494&view=rev
Log:
log the requesting connection id, not just the response id.

Modified:
    incubator/libcloud/trunk/libcloud/base.py

Modified: incubator/libcloud/trunk/libcloud/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/base.py?rev=905494&r1=905493&r2=905494&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/base.py (original)
+++ incubator/libcloud/trunk/libcloud/base.py Tue Feb  2 01:52:52 2010
@@ -202,7 +202,7 @@
     log = None
 
     def _log_response(self, r):
-        rv = "# -------- begin %d response ----------\n" % (id(r))
+        rv = "# -------- begin %d:%d response ----------\n" % (id(self), id(r))
         ht = ""
         v = r.version
         if r.version == 10:
@@ -232,7 +232,7 @@
                                     debuglevel=r.debuglevel)
         rr.begin()
         rv += ht
-        rv += "\n# -------- end %d response ----------\n" % (id(r))
+        rv += "\n# -------- end %d:%d response ----------\n" % (id(self), id(r))
         return (rr, rv)
 
     def getresponse(self):
@@ -260,7 +260,8 @@
 
     def request(self, method, url, body=None, headers=None):
         if self.log is not None:
-            self.log.write(self._log_curl(method, url, body, headers) + "\n")
+            pre = "# -------- begin %d request ----------\n"  % id(self)
+            self.log.write(pre + self._log_curl(method, url, body, headers) + "\n")
             self.log.flush()
         return httplib.HTTPSConnection.request(self, method, url, body, headers)
 



Mime
View raw message