PROTON-1522: Define Url repr to exclude user and password; use repr in logging
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/5c746ceb Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5c746ceb Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5c746ceb Branch: refs/heads/go1 Commit: 5c746ceb00b567c6345c3b4da26dc334480b3f6f Parents: 85755ac Author: Justin Ross <[email protected]> Authored: Fri Dec 8 12:26:53 2017 -0800 Committer: Justin Ross <[email protected]> Committed: Fri Dec 8 12:59:19 2017 -0800 ---------------------------------------------------------------------- proton-c/bindings/python/proton/__init__.py | 3 ++- proton-c/bindings/python/proton/reactor.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5c746ceb/proton-c/bindings/python/proton/__init__.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py index 21076ee..0dda550 100644 --- a/proton-c/bindings/python/proton/__init__.py +++ b/proton-c/bindings/python/proton/__init__.py @@ -4258,7 +4258,8 @@ class Url(object): def __str__(self): return pn_url_str(self._url) - def __repr__(self): return "Url(%r)" % str(self) + def __repr__(self): + return "Url(%s://%s/%s)" % (self.scheme, self.host, self.path) def __eq__(self, x): return str(self) == str(x) def __ne__(self, x): return not self == x http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5c746ceb/proton-c/bindings/python/proton/reactor.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py index e9ede47..b8bd96f 100644 --- a/proton-c/bindings/python/proton/reactor.py +++ b/proton-c/bindings/python/proton/reactor.py @@ -554,7 +554,7 @@ class Connector(Handler): # if virtual-host not set, use host from address as default if self.virtual_host is None: connection.hostname = url.host - log.debug("connecting to %s..." % url) + log.debug("connecting to %r..." % url) transport = Transport() if self.sasl_enabled: --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
