summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-07-26 21:02:25 -0400
committerLance Stout <lancestout@gmail.com>2010-07-26 21:02:25 -0400
commitc8989c04f3675235e3ae730cb240e2154b5d9e76 (patch)
tree5b20b21ae2575cb76dae32e985aa20484bdab76f /sleekxmpp/xmlstream/xmlstream.py
parent241aba8c767ded0c931b2d70ac223eb81f174f1c (diff)
downloadslixmpp-c8989c04f3675235e3ae730cb240e2154b5d9e76.tar.gz
slixmpp-c8989c04f3675235e3ae730cb240e2154b5d9e76.tar.bz2
slixmpp-c8989c04f3675235e3ae730cb240e2154b5d9e76.tar.xz
slixmpp-c8989c04f3675235e3ae730cb240e2154b5d9e76.zip
Replaced traceback calls to use logging.exception where applicable.
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index cea204b9..6ce89c25 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -19,7 +19,6 @@ import logging
import socket
import threading
import time
-import traceback
import types
import copy
import xml.sax.saxutils
@@ -195,14 +194,14 @@ class XMLStream(object):
return
else:
self.state.set('processing', False)
- traceback.print_exc()
+ logging.exception('Socket Error')
self.disconnect(reconnect=True)
except:
if not self.state.reconnect:
return
else:
self.state.set('processing', False)
- traceback.print_exc()
+ logging.exception('Connection error. Reconnecting.')
self.disconnect(reconnect=True)
if self.state['reconnect']:
self.reconnect()
@@ -258,8 +257,7 @@ class XMLStream(object):
logging.warning("Failed to send %s" % data)
self.state.set('connected', False)
if self.state.reconnect:
- logging.error("Disconnected. Socket Error.")
- traceback.print_exc()
+ logging.exception("Disconnected. Socket Error.")
self.disconnect(reconnect=True)
def sendRaw(self, data):
@@ -344,14 +342,14 @@ class XMLStream(object):
try:
handler.run(args[0])
except Exception as e:
- traceback.print_exc()
+ logging.exception('Error processing event handler: %s' % handler.name)
args[0].exception(e)
elif etype == 'schedule':
try:
logging.debug(args)
handler(*args[0])
except:
- logging.error(traceback.format_exc())
+ logging.exception('Error processing scheduled task')
elif etype == 'quit':
logging.debug("Quitting eventRunner thread")
return False