Improve some debug output

This commit is contained in:
Marco Pesenti Gritti 2006-06-19 12:28:44 -04:00
parent c65ef6f9cd
commit 73c94c7bfb
2 changed files with 2 additions and 4 deletions

View File

@ -486,9 +486,7 @@ class PresenceService(gobject.GObject):
"""Convenience function to share an activity with other buddies."""
if not self._started:
raise RuntimeError("presence service must be started first.")
uid = activity.get_id()
logging.debug('Sharing activity uid %s, stype %s' % (uid, stype))
owner_nick = self._owner.get_nick_name()
real_stype = Service.compose_service_type(stype, uid)
if address and type(address) != type(""):
@ -503,7 +501,7 @@ class PresenceService(gobject.GObject):
# random port #
port = random.randint(5000, 65535)
logging.debug('Share activity %s, address %s, port %d' % (stype, address, port))
logging.debug('Share activity %s, type %s, address %s, port %d, properties %s' % (uid, stype, address, port, properties))
service = Service.Service(name=owner_nick, stype=real_stype, domain="local",
address=address, port=port, properties=properties)
# Publish it to the world

View File

@ -138,7 +138,7 @@ class Service(object):
if self._properties.has_key(_ACTIVITY_UID_TAG):
prop_uid = self._properties[_ACTIVITY_UID_TAG]
if (prop_uid and not uid) or (prop_uid != uid):
raise ValueError("ActivityUID property specified, but the service type's activity UID didn't match it.")
raise ValueError("ActivityUID property specified, but the service type's activity UID didn't match it: %s, %s" % (prop_uid, uid))
self._activity_uid = uid
if uid and not self._properties.has_key(_ACTIVITY_UID_TAG):
self._properties[_ACTIVITY_UID_TAG] = uid