X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fmodulemanager.lua;h=cc48c2f6776ed58cfa29bbdc9408d770a99b01de;hb=43e6f37e8a0300929a4623f1a61c2d0ee2b24d5e;hp=a1d3bef3aafc6e695c2f97b396772fc087b30844;hpb=e116081c1d261e25c546a1a98c4207fd5e3fc48e;p=prosody.git 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)