From eb2fee80e8821e440d59bec302817321786f52ff Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Fri, 22 Jun 2018 11:53:25 -0700 Subject: [PATCH] Stop logging tracebacks when we're about to reraise At that point, it's up to the caller to decide whether a stack trace is appropriate; if the caller decides the connection error is recoverable, us logging a traceback will only confuse things. Also, prevent a TypeError during log interpolation by actually using the argument we were providing. --- kmip/pie/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmip/pie/client.py b/kmip/pie/client.py index bb648b1..f01f5fe 100644 --- a/kmip/pie/client.py +++ b/kmip/pie/client.py @@ -131,7 +131,7 @@ class ProxyKmipClient(object): self.proxy.open() self._is_open = True except Exception as e: - self.logger.exception("could not open client connection", e) + self.logger.error("could not open client connection: %s", e) raise def close(self): @@ -148,7 +148,7 @@ class ProxyKmipClient(object): self.proxy.close() self._is_open = False except Exception as e: - self.logger.exception("could not close client connection", e) + self.logger.error("could not close client connection: %s", e) raise @is_connected