diff frontends/src/quick_frontend/quick_contact_management.py @ 1009:d1084f7e56a5

quick_frontend: use of new logging system
author Goffi <goffi@goffi.org>
date Mon, 05 May 2014 18:58:34 +0200
parents 1fe00f0c9a91
children 75025461141f
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_contact_management.py	Mon May 05 18:58:34 2014 +0200
+++ b/frontends/src/quick_frontend/quick_contact_management.py	Mon May 05 18:58:34 2014 +0200
@@ -18,9 +18,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from sat.core.i18n import _
-from logging import debug, info, warning, error
+from sat.core.log import getLogger
+log = getLogger(__name__)
 from sat.tools.jid  import JID
-import pdb
 
 
 class QuickContactManagement(object):
@@ -68,7 +68,7 @@
             if self.__contactlist[entity.bare].has_key(name):
                 return self.__contactlist[entity.bare][name]
         else:
-            debug(_('Trying to get attribute for an unknown contact'))
+            log.debug(_('Trying to get attribute for an unknown contact'))
         return None
 
     def isConnected(self, entity):
@@ -84,7 +84,7 @@
                 #no more resource available: the contact seems really disconnected
                 del self.__contactlist[entity.bare]
         except KeyError:
-            error(_('INTERNAL ERROR: Key error'))
+            log.error(_('INTERNAL ERROR: Key log.error'))
             raise
 
     def update(self, entity, key, value):
@@ -96,7 +96,7 @@
         if self.__contactlist.has_key(entity.bare):
             self.__contactlist[entity.bare][key] = value
         else:
-            debug (_('Trying to update an unknown contact: %s'), entity.bare)
+            log.debug (_('Trying to update an unknown contact: %s') % entity.bare)
 
     def get_full(self, entity):
         return entity.bare+'/'+self.__contactlist[entity.bare]['resources'][-1]