diff options
author | Rafael H. Schloming <rhs@apache.org> | 2010-01-19 21:17:36 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2010-01-19 21:17:36 +0000 |
commit | 07b7a61c7876b92b6ea0d6355d97cae4437df5c2 (patch) | |
tree | 2f435b2915cac462d66117f0bd29ec13ac959c81 | |
parent | f985d4b7a07cd754bdee62f073d10180e03912e8 (diff) | |
download | qpid-python-07b7a61c7876b92b6ea0d6355d97cae4437df5c2.tar.gz |
added connection and session address to log statements
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@900961 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | python/qpid/driver.py | 13 | ||||
-rw-r--r-- | python/qpid/messaging.py | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/python/qpid/driver.py b/python/qpid/driver.py index 2851c3aad3..345869cc48 100644 --- a/python/qpid/driver.py +++ b/python/qpid/driver.py @@ -133,6 +133,7 @@ class Driver: def __init__(self, connection): self.connection = connection + self.log_id = "%x" % id(self.connection) self._lock = self.connection._lock self._selector = Selector.default() @@ -198,9 +199,9 @@ class Driver: try: data = self._socket.recv(64*1024) if data: - rawlog.debug("READ: %r", data) + rawlog.debug("READ[%s]: %r", self.log_id, data) else: - rawlog.debug("ABORTED: %s", self._socket.getpeername()) + rawlog.debug("ABORTED[%s]: %s", self.log_id, self._socket.getpeername()) error = "connection aborted" recoverable = True except socket.error, e: @@ -222,7 +223,7 @@ class Driver: self._op_dec.write(*self._seg_dec.read()) for op in self._op_dec.read(): self.assign_id(op) - opslog.debug("RCVD: %r", op) + opslog.debug("RCVD[%s]: %r", self.log_id, op) op.dispatch(self) except VersionError, e: error = e @@ -247,7 +248,7 @@ class Driver: def writeable(self): try: n = self._socket.send(self._buf) - rawlog.debug("SENT: %r", self._buf[:n]) + rawlog.debug("SENT[%s]: %r", self.log_id, self._buf[:n]) self._buf = self._buf[n:] except socket.error, e: self._error(e, True) @@ -271,7 +272,7 @@ class Driver: self.connection.error = (err,) def write_op(self, op): - opslog.debug("SENT: %r", op) + opslog.debug("SENT[%s]: %r", self.log_id, op) self._op_enc.write(op) self._seg_enc.write(*self._op_enc.read()) self._frame_enc.write(*self._seg_enc.read()) @@ -825,7 +826,7 @@ class Driver: if rcv.impending is not UNLIMITED: assert rcv.received < rcv.impending, "%s, %s" % (rcv.received, rcv.impending) rcv.received += 1 - log.debug("RECV [%s] %s", ssn, msg) + log.debug("RCVD[%s]: %s", ssn.log_id, msg) ssn.incoming.append(msg) self.connection._waiter.notifyAll() diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py index ca8483eef0..817f919000 100644 --- a/python/qpid/messaging.py +++ b/python/qpid/messaging.py @@ -423,6 +423,7 @@ class Session: def __init__(self, connection, name, transactional): self.connection = connection self.name = name + self.log_id = "%x" % id(self) self.transactional = transactional @@ -532,7 +533,7 @@ class Session: if msg is not None: msg._receiver.returned += 1 self.unacked.append(msg) - log.debug("RETR [%s] %s", self, msg) + log.debug("RETR[%s]: %s", self.log_id, msg) return msg return None |