diff src/plugins/plugin_misc_xmllog.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 bfabeedbf32e
children aa60bd58ac23
line wrap: on
line diff
--- a/src/plugins/plugin_misc_xmllog.py	Sat Apr 19 16:48:26 2014 +0200
+++ b/src/plugins/plugin_misc_xmllog.py	Sat Apr 19 19:19:19 2014 +0200
@@ -18,7 +18,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from sat.core.i18n import _
-from logging import debug, info, error
+from sat.core.log import getLogger
+log = getLogger(__name__)
 from twisted.words.protocols.jabber.xmlstream import XmlStream
 from twisted.words.xish import domish
 
@@ -43,7 +44,7 @@
         elif isinstance(obj, domish.Element):
             log = obj.toXml()
         else:
-            error(_('INTERNAL ERROR: Unmanaged XML type'))
+            log.error(_('INTERNAL ERROR: Unmanaged XML type'))
         self._host.bridge.xmlLog("OUT", log, self._profile)
         return XmlStream.send(self, obj)
 
@@ -65,7 +66,7 @@
     """ % {"label_xmllog": _("Activate XML log")}
 
     def __init__(self, host):
-        info(_("Plugin XML Log initialization"))
+        log.info(_("Plugin XML Log initialization"))
         self.host = host
 
         #parameters
@@ -76,7 +77,7 @@
 
         do_log = self.host.memory.getParamA("Xml log", "Debug")
         if do_log:
-            info(_("XML log activated"))
+            log.info(_("XML log activated"))
             host.trigger.add("XML Initialized", self.logXml)
 
     def logXml(self, xmlstream, profile):