Thu, 30 Apr 2009 01:36:46 +0100
modulemanager: Update logger when a module becomes global
core/modulemanager.lua | file | annotate | diff | comparison | revisions |
--- a/core/modulemanager.lua Wed Apr 29 20:52:24 2009 +0100 +++ b/core/modulemanager.lua Thu Apr 30 01:36:46 2009 +0100 @@ -123,6 +123,10 @@ -- 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 @@ 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)