From: Ed Page Date: Thu, 14 Jan 2010 02:12:10 +0000 (-0600) Subject: Improving logging X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=97f2510b8328e31e7647e5e702ad93020f95eb22;p=theonering Improving logging --- diff --git a/src/channel/contact_list.py b/src/channel/contact_list.py index a67fdc5..d247ec6 100644 --- a/src/channel/contact_list.py +++ b/src/channel/contact_list.py @@ -90,6 +90,7 @@ class AllContactsListChannel( self._process_refresh(addressbook, added, removed) def _process_refresh(self, addressbook, added, removed): + _moduleLogger.info("Added: %r, Removed: %r" % (len(added), len(removed))) connection = self._conn handlesAdded = [ handle.create_handle(connection, "contact", contactId, phoneNumber) diff --git a/src/channel/text.py b/src/channel/text.py index bcdacbe..64ee0be 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -63,13 +63,13 @@ class TextChannel(telepathy.server.ChannelTypeText): try: mergedConversations = self._conn.session.voicemails.get_conversation(self._contactKey) except KeyError: - _moduleLogger.debug("Nothing in the conversation yet for %r" % (self._contactKey, )) + _moduleLogger.debug("No voicemails in the conversation yet for %r" % (self._contactKey, )) else: self._report_conversation(mergedConversations) try: mergedConversations = self._conn.session.texts.get_conversation(self._contactKey) except KeyError: - _moduleLogger.debug("Nothing in the conversation yet for %r" % (self._contactKey, )) + _moduleLogger.debug("No texts conversation yet for %r" % (self._contactKey, )) else: self._report_conversation(mergedConversations) @@ -129,6 +129,11 @@ class TextChannel(telepathy.server.ChannelTypeText): # before the last one sent because that creates a race condition of two # people sending at about the same time, which happens quite a bit newConversations = mergedConversations.conversations + if not newConversations: + _moduleLogger.debug( + "No messages ended up existing for %r" % (self._contactKey, ) + ) + return newConversations = self._filter_out_reported(newConversations) newConversations = self._filter_out_read(newConversations) newConversations = list(newConversations)