# HG changeset patch # User Matthew Wild # Date 1241051806 -3600 # Node ID 034e345c0f8d0bd9b34ac75cba3dc8c558e08e6c # Parent 21f41b06f1d2f29843fe4c49605079ab68c95bb3 modulemanager: Update logger when a module becomes global diff -r 21f41b06f1d2 -r 034e345c0f8d core/modulemanager.lua --- 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)