summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-11-06 01:28:59 -0400
committerLance Stout <lancestout@gmail.com>2010-11-06 01:28:59 -0400
commit4fb77ac8787422169566d613562127acf75a427b (patch)
treec0c0f095c7c7cd2f701c85462e768b214657e072 /sleekxmpp/plugins/xep_0030.py
parentd0c506f93010f62cd447ce29f98ab991f521ec99 (diff)
downloadslixmpp-4fb77ac8787422169566d613562127acf75a427b.tar.gz
slixmpp-4fb77ac8787422169566d613562127acf75a427b.tar.bz2
slixmpp-4fb77ac8787422169566d613562127acf75a427b.tar.xz
slixmpp-4fb77ac8787422169566d613562127acf75a427b.zip
Logging no longer uses root logger.
Each module should now log into its own logger.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030.py')
-rw-r--r--sleekxmpp/plugins/xep_0030.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/sleekxmpp/plugins/xep_0030.py b/sleekxmpp/plugins/xep_0030.py
index 21f4538a..a3fac346 100644
--- a/sleekxmpp/plugins/xep_0030.py
+++ b/sleekxmpp/plugins/xep_0030.py
@@ -13,6 +13,10 @@ from .. xmlstream.matcher.xpath import MatchXPath
from .. xmlstream.stanzabase import registerStanzaPlugin, ElementBase, ET, JID
from .. stanza.iq import Iq
+
+log = logging.getLogger(__name__)
+
+
class DiscoInfo(ElementBase):
namespace = 'http://jabber.org/protocol/disco#info'
name = 'query'
@@ -222,18 +226,18 @@ class xep_0030(base.base_plugin):
def handle_item_query(self, iq):
if iq['type'] == 'get':
- logging.debug("Items requested by %s" % iq['from'])
+ log.debug("Items requested by %s" % iq['from'])
self.xmpp.event('disco_items_request', iq)
elif iq['type'] == 'result':
- logging.debug("Items result from %s" % iq['from'])
+ log.debug("Items result from %s" % iq['from'])
self.xmpp.event('disco_items', iq)
def handle_info_query(self, iq):
if iq['type'] == 'get':
- logging.debug("Info requested by %s" % iq['from'])
+ log.debug("Info requested by %s" % iq['from'])
self.xmpp.event('disco_info_request', iq)
elif iq['type'] == 'result':
- logging.debug("Info result from %s" % iq['from'])
+ log.debug("Info result from %s" % iq['from'])
self.xmpp.event('disco_info', iq)
def handle_disco_info(self, iq, forwarded=False):
@@ -248,13 +252,13 @@ class xep_0030(base.base_plugin):
if not node_name:
node_name = 'main'
- logging.debug("Using default handler for disco#info on node '%s'." % node_name)
+ log.debug("Using default handler for disco#info on node '%s'." % node_name)
if node_name in self.nodes:
node = self.nodes[node_name]
iq.reply().setPayload(node.info.xml).send()
else:
- logging.debug("Node %s requested, but does not exist." % node_name)
+ log.debug("Node %s requested, but does not exist." % node_name)
iq.reply().error().setPayload(iq['disco_info'].xml)
iq['error']['code'] = '404'
iq['error']['type'] = 'cancel'
@@ -276,13 +280,13 @@ class xep_0030(base.base_plugin):
if not node_name:
node_name = 'main'
- logging.debug("Using default handler for disco#items on node '%s'." % node_name)
+ log.debug("Using default handler for disco#items on node '%s'." % node_name)
if node_name in self.nodes:
node = self.nodes[node_name]
iq.reply().setPayload(node.items.xml).send()
else:
- logging.debug("Node %s requested, but does not exist." % node_name)
+ log.debug("Node %s requested, but does not exist." % node_name)
iq.reply().error().setPayload(iq['disco_items'].xml)
iq['error']['code'] = '404'
iq['error']['type'] = 'cancel'