Updated the use of tostring in xmlstream.py

Now uses the xmlns and stream parameters to reduce the number of
extra xmlns attributes used in the logging output.

Added self.default_ns to XMLStream just to be safe.
This commit is contained in:
Lance Stout 2010-08-05 23:11:22 -04:00
parent 0d0c044a68
commit 4d1f071f83

View file

@ -73,6 +73,7 @@ class XMLStream(object):
self.use_ssl = False
self.use_tls = False
self.default_ns = ''
self.stream_header = "<stream>"
self.stream_footer = "</stream>"
@ -304,7 +305,7 @@ class XMLStream(object):
def __spawnEvent(self, xmlobj):
"watching xmlOut and processes handlers"
#convert XML into Stanza
logging.debug("RECV: %s" % tostring(xmlobj))
logging.debug("RECV: %s" % tostring(xmlobj, xmlns=self.default_ns, stream=self))
xmlobj = self.incoming_filter(xmlobj)
stanza_type = StanzaBase
for stanza_class in self.__root_stanza: