From 370ef290d12697c347b649148c3ae0c4132c97a4 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 30 Apr 2009 01:36:46 +0100 Subject: modulemanager: Update logger when a module becomes global --- core/modulemanager.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/modulemanager.lua b/core/modulemanager.lua index a1d3bef3..cc48c2f6 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -123,6 +123,10 @@ function load(host, module_name, config) -- Use modified host, if the module set one modulemap[api_instance.host][module_name] = pluginenv; + if api_instance.host == "*" and host ~= "*" then + api_instance:set_global(); + end + return true; end @@ -260,6 +264,10 @@ end function api:set_global() self.host = "*"; + -- Update the logger + local _log = logger.init("mod_"..self.name); + self.log = function (self, ...) return _log(...); end; + self._log = _log; end local function _add_handler(module, origin_type, tag, xmlns, handler) -- cgit v1.2.3