summaryrefslogtreecommitdiff
path: root/src/saml2/pack.py
diff options
context:
space:
mode:
authorJozef Knaperek <jknaperek@gmail.com>2015-10-12 16:22:19 +0200
committerJozef Knaperek <jknaperek@gmail.com>2015-10-15 15:33:10 +0200
commitc7febbf9e8c85355dccb53a326a51bfc41db1c66 (patch)
tree976664df2088314a431be719f64359448ddf17e9 /src/saml2/pack.py
parent1228db66eb006e0f069cc1b6b1612c6cbaa8df1d (diff)
downloadpysaml2-c7febbf9e8c85355dccb53a326a51bfc41db1c66.tar.gz
Fix paramter passing in logging messages
Pass parameters into logger calls directly instead of pre-merging with the logger message. This way the logs are easier to maintain and process. The code is also faster when logging is turned off since it doesn't have to evaluate all params and render them into strings.
Diffstat (limited to 'src/saml2/pack.py')
-rw-r--r--src/saml2/pack.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/saml2/pack.py b/src/saml2/pack.py
index 91b6f976..3377c451 100644
--- a/src/saml2/pack.py
+++ b/src/saml2/pack.py
@@ -169,18 +169,18 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
if isinstance(thingy, six.string_types):
# remove the first XML version/encoding line
if thingy[0:5].lower() == '<?xml':
- logger.debug("thingy0: %s" % thingy)
+ logger.debug("thingy0: %s", thingy)
_part = thingy.split("\n")
thingy = "".join(_part[1:])
thingy = thingy.replace(PREFIX, "")
- logger.debug("thingy: %s" % thingy)
+ logger.debug("thingy: %s", thingy)
_child = ElementTree.Element('')
_child.tag = '{%s}FuddleMuddle' % DUMMY_NAMESPACE
body.append(_child)
_str = ElementTree.tostring(envelope, encoding="UTF-8")
if isinstance(_str, six.binary_type):
_str = _str.decode('utf-8')
- logger.debug("SOAP precursor: %s" % _str)
+ logger.debug("SOAP precursor: %s", _str)
# find an remove the namespace definition
i = _str.find(DUMMY_NAMESPACE)
j = _str.rfind("xmlns:", 0, i)