summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.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/basexmpp.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/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 1e8441aa..77191e77 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -26,6 +26,9 @@ from sleekxmpp.xmlstream.matcher import *
from sleekxmpp.xmlstream.handler import *
+log = logging.getLogger(__name__)
+
+
# Flag indicating if DNS SRV records are available for use.
SRV_SUPPORT = True
try:
@@ -192,9 +195,9 @@ class BaseXMPP(XMLStream):
xep = "(XEP-%s) " % self.plugin[plugin].xep
desc = (xep, self.plugin[plugin].description)
- logging.debug("Loaded Plugin %s%s" % desc)
+ log.debug("Loaded Plugin %s%s" % desc)
except:
- logging.exception("Unable to load plugin: %s", plugin)
+ log.exception("Unable to load plugin: %s", plugin)
def register_plugins(self):
"""
@@ -228,7 +231,7 @@ class BaseXMPP(XMLStream):
if key in self.plugin:
return self.plugin[key]
else:
- logging.warning("""Plugin "%s" is not loaded.""" % key)
+ log.warning("""Plugin "%s" is not loaded.""" % key)
return False
def get(self, key, default):
@@ -446,12 +449,12 @@ class BaseXMPP(XMLStream):
"""
Attribute accessor for bare jid
"""
- logging.warning("jid property deprecated. Use boundjid.bare")
+ log.warning("jid property deprecated. Use boundjid.bare")
return self.boundjid.bare
@jid.setter
def jid(self, value):
- logging.warning("jid property deprecated. Use boundjid.bare")
+ log.warning("jid property deprecated. Use boundjid.bare")
self.boundjid.bare = value
@property
@@ -459,12 +462,12 @@ class BaseXMPP(XMLStream):
"""
Attribute accessor for full jid
"""
- logging.warning("fulljid property deprecated. Use boundjid.full")
+ log.warning("fulljid property deprecated. Use boundjid.full")
return self.boundjid.full
@fulljid.setter
def fulljid(self, value):
- logging.warning("fulljid property deprecated. Use boundjid.full")
+ log.warning("fulljid property deprecated. Use boundjid.full")
self.boundjid.full = value
@property
@@ -472,12 +475,12 @@ class BaseXMPP(XMLStream):
"""
Attribute accessor for jid resource
"""
- logging.warning("resource property deprecated. Use boundjid.resource")
+ log.warning("resource property deprecated. Use boundjid.resource")
return self.boundjid.resource
@resource.setter
def resource(self, value):
- logging.warning("fulljid property deprecated. Use boundjid.full")
+ log.warning("fulljid property deprecated. Use boundjid.full")
self.boundjid.resource = value
@property
@@ -485,12 +488,12 @@ class BaseXMPP(XMLStream):
"""
Attribute accessor for jid usernode
"""
- logging.warning("username property deprecated. Use boundjid.user")
+ log.warning("username property deprecated. Use boundjid.user")
return self.boundjid.user
@username.setter
def username(self, value):
- logging.warning("username property deprecated. Use boundjid.user")
+ log.warning("username property deprecated. Use boundjid.user")
self.boundjid.user = value
@property
@@ -498,17 +501,17 @@ class BaseXMPP(XMLStream):
"""
Attribute accessor for jid host
"""
- logging.warning("server property deprecated. Use boundjid.host")
+ log.warning("server property deprecated. Use boundjid.host")
return self.boundjid.server
@server.setter
def server(self, value):
- logging.warning("server property deprecated. Use boundjid.host")
+ log.warning("server property deprecated. Use boundjid.host")
self.boundjid.server = value
def set_jid(self, jid):
"""Rip a JID apart and claim it as our own."""
- logging.debug("setting jid to %s" % jid)
+ log.debug("setting jid to %s" % jid)
self.boundjid.full = jid
def getjidresource(self, fulljid):
@@ -588,7 +591,7 @@ class BaseXMPP(XMLStream):
# disconnects. Determine if this was the last connection
# for the JID.
if show == 'unavailable':
- logging.debug("%s %s got offline" % (jid, resource))
+ log.debug("%s %s got offline" % (jid, resource))
del connections[resource]
if not connections and not self.roster[jid]['in_roster']:
@@ -604,7 +607,7 @@ class BaseXMPP(XMLStream):
self.event("changed_status", presence)
if got_online:
self.event("got_online", presence)
- logging.debug("STATUS: %s%s/%s[%s]: %s" % (name, jid, resource,
+ log.debug("STATUS: %s%s/%s[%s]: %s" % (name, jid, resource,
show, status))
def _handle_subscribe(self, presence):