diff src/plugins/plugin_xep_0060.py @ 993:301b342c697a

core: use of the new core.log module: /!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
author Goffi <goffi@goffi.org>
date Sat, 19 Apr 2014 19:19:19 +0200
parents 1a759096ccbd
children 318eab3f93f8
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Sat Apr 19 16:48:26 2014 +0200
+++ b/src/plugins/plugin_xep_0060.py	Sat Apr 19 19:19:19 2014 +0200
@@ -19,7 +19,8 @@
 
 from sat.core.i18n import _
 from sat.core.constants import Const as C
-from logging import debug, info, error
+from sat.core.log import getLogger
+log = getLogger(__name__)
 from wokkel.pubsub import PubSubRequest
 from wokkel import disco, pubsub
 from zope.interface import implements
@@ -49,7 +50,7 @@
     OPT_PUBLISH_MODEL = 'pubsub#publish_model'
 
     def __init__(self, host):
-        info(_("PubSub plugin initialization"))
+        log.info(_("PubSub plugin initialization"))
         self.host = host
         self.managedNodes = []
         self.clients = {}
@@ -86,13 +87,13 @@
             err_mess = _('Trying to %(action)s with an unknown profile key [%(profile_key)s]') % {
                 'action': action,
                 'profile_key': profile_key}
-            error(err_mess)
+            log.error(err_mess)
             raise Exception(err_mess)
         try:
             client = self.clients[profile]
         except KeyError:
             err_mess = _('INTERNAL ERROR: no handler for required profile')
-            error(err_mess)
+            log.error(err_mess)
             raise Exception(err_mess)
         return profile, client
 
@@ -215,7 +216,7 @@
 
     def deleteReceived(self, event):
         #TODO: manage delete event
-        debug(_("Publish node deleted"))
+        log.debug(_("Publish node deleted"))
 
     # def purgeReceived(self, event):