diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-30 01:36:46 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-30 01:36:46 +0100 |
commit | 370ef290d12697c347b649148c3ae0c4132c97a4 (patch) | |
tree | cc96f1b4e0d393434001b724bcd298ff9e4aa7a4 /core | |
parent | 3015c946d18d28566fd92201291a33b0872eccc1 (diff) | |
download | prosody-370ef290d12697c347b649148c3ae0c4132c97a4.tar.gz prosody-370ef290d12697c347b649148c3ae0c4132c97a4.zip |
modulemanager: Update logger when a module becomes global
Diffstat (limited to 'core')
-rw-r--r-- | core/modulemanager.lua | 8 |
1 files changed, 8 insertions, 0 deletions
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) |