diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-08 11:46:10 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-08 11:46:10 -0800 |
commit | a0c7141e2cc7399a9472a8169ea5f730f0407386 (patch) | |
tree | d644ae9f9c312b2a3aa5a384a176ebbe092ec5a6 | |
parent | 317c8480164763b484fa82d0e0273107bc861538 (diff) | |
download | kafka-python-a0c7141e2cc7399a9472a8169ea5f730f0407386.tar.gz |
Change log.error() back to log.exception()
-rw-r--r-- | kafka/conn.py | 6 | ||||
-rw-r--r-- | kafka/producer.py | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index 9a6633a..c80f428 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -48,8 +48,8 @@ class KafkaConnection(local): while bytes_left: try: data = self._sock.recv(bytes_left) - except socket.error, e: - log.error('Unable to receive data from Kafka: %s', e) + except socket.error: + log.exception('Unable to receive data from Kafka') self._raise_connection_error() if data == '': log.error("Not enough data to read this response") @@ -76,7 +76,7 @@ class KafkaConnection(local): if sent is not None: self._raise_connection_error() except socket.error, e: - log.error('Unable to send payload to Kafka: %s', e) + log.exception('Unable to send payload to Kafka') self._raise_connection_error() def recv(self, request_id): diff --git a/kafka/producer.py b/kafka/producer.py index eba662d..a68b6c8 100644 --- a/kafka/producer.py +++ b/kafka/producer.py @@ -67,8 +67,8 @@ def _send_upstream(topic, queue, client, batch_time, batch_size, client.send_produce_request(reqs, acks=req_acks, timeout=ack_timeout) - except Exception as e: - log.error("Unable to send message: %s", e) + except Exception: + log.exception("Unable to send message") class Producer(object): @@ -144,9 +144,9 @@ class Producer(object): try: resp = self.client.send_produce_request([req], acks=self.req_acks, timeout=self.ack_timeout) - except Exception as e: - log.error("Unable to send messages: %s", e) - raise e + except Exception: + log.exception("Unable to send messages") + raise return resp def stop(self, timeout=1): |