summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Ryzhov <anton@ryzhov.me>2013-08-10 21:34:18 +0400
committerAnton Ryzhov <anton@ryzhov.me>2013-08-10 21:34:18 +0400
commita030e059931bc37561d4372615dafb3aec242cea (patch)
tree605c170c38865ece91969c502bda2289fd205077
parent648b03f81172829cae65f6ac9fc551e049310501 (diff)
downloadslixmpp-a030e059931bc37561d4372615dafb3aec242cea.tar.gz
slixmpp-a030e059931bc37561d4372615dafb3aec242cea.tar.bz2
slixmpp-a030e059931bc37561d4372615dafb3aec242cea.tar.xz
slixmpp-a030e059931bc37561d4372615dafb3aec242cea.zip
Add null handler to logging engine
-rw-r--r--sleekxmpp/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py
index 542bb4b6..85ee32b6 100644
--- a/sleekxmpp/__init__.py
+++ b/sleekxmpp/__init__.py
@@ -6,6 +6,17 @@
See the file LICENSE for copying permission.
"""
+import logging
+if hasattr(logging, 'NullHandler'):
+ NullHandler = logging.NullHandler
+else:
+ class NullHandler(logging.Handler):
+ def handle(self, record):
+ pass
+logging.getLogger(__name__).addHandler(NullHandler())
+del NullHandler
+
+
from sleekxmpp.stanza import Message, Presence, Iq
from sleekxmpp.jid import JID, InvalidJID
from sleekxmpp.xmlstream.stanzabase import ET, ElementBase, register_stanza_plugin