summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-09-05 16:27:43 -0700
committerLance Stout <lancestout@gmail.com>2013-09-05 16:27:43 -0700
commite60401278f8933211eaac168475a3c332d62531c (patch)
treec7b82cfe37c86c650d23fb32c536dfe252b854e8 /sleekxmpp
parent24c474a9ec018448846756b33716e5ed973bcdf6 (diff)
parenta030e059931bc37561d4372615dafb3aec242cea (diff)
downloadslixmpp-e60401278f8933211eaac168475a3c332d62531c.tar.gz
slixmpp-e60401278f8933211eaac168475a3c332d62531c.tar.bz2
slixmpp-e60401278f8933211eaac168475a3c332d62531c.tar.xz
slixmpp-e60401278f8933211eaac168475a3c332d62531c.zip
Merge pull request #255 from anton-ryzhov/logging
Add null handler to logging engine
Diffstat (limited to 'sleekxmpp')
-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