mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
plugins: Give each plugin a plugin-specific logger object
This makes it possible for plugins to stop assuming that log4js is available at `ep_etherpad-lite/node_modules/log4js`.
This commit is contained in:
parent
daee90d2af
commit
1513932ca1
3 changed files with 10 additions and 2 deletions
|
@ -98,7 +98,10 @@ exports.update = async () => {
|
|||
defs.parts = sortParts(parts);
|
||||
defs.hooks = pluginUtils.extractHooks(defs.parts, 'hooks', exports.pathNormalization);
|
||||
defs.loaded = true;
|
||||
await Promise.all(Object.keys(defs.plugins).map((p) => hooks.aCallAll(`init_${p}`, {})));
|
||||
await Promise.all(Object.keys(defs.plugins).map(async (p) => {
|
||||
const logger = log4js.getLogger(`plugin:${p}`);
|
||||
await hooks.aCallAll(`init_${p}`, {logger});
|
||||
}));
|
||||
};
|
||||
|
||||
exports.getPackages = async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue