diff src/plugins/plugin_xep_0071.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 c897c8d321b3
children 069ad98b360d
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0071.py	Sat Apr 19 16:48:26 2014 +0200
+++ b/src/plugins/plugin_xep_0071.py	Sat Apr 19 19:19:19 2014 +0200
@@ -19,9 +19,10 @@
 
 from sat.core.i18n import _
 from sat.core import exceptions
-from logging import debug, info, error
+from sat.core.log import getLogger
+log = getLogger(__name__)
 
-from wokkel import disco, pubsub, iwokkel
+from wokkel import disco, iwokkel
 from zope.interface import implements
 # from lxml import etree
 from lxml import html
@@ -69,7 +70,7 @@
     SYNTAX_XHTML_IM = "XHTML-IM"
 
     def __init__(self, host):
-        info(_("XHTML-IM plugin initialization"))
+        log.info(_("XHTML-IM plugin initialization"))
         self.host = host
         self.synt_plg = self.host.plugins["TEXT-SYNTAXES"]
         self.synt_plg.addSyntax(self.SYNTAX_XHTML_IM, lambda xhtml: xhtml, self.XHTML2XHTML_IM, [self.synt_plg.OPT_HIDDEN])
@@ -189,7 +190,7 @@
         for elem in to_strip:
             if elem.tag in blacklist:
                 #we need to remove the element and all descendants
-                debug(u"removing black listed tag: %s" % (elem.tag))
+                log.debug(u"removing black listed tag: %s" % (elem.tag))
                 elem.drop_tree()
             else:
                 elem.drop_tag()