fix: Duplicate plugin registration logging in debug
This commit is contained in:
@@ -59,7 +59,7 @@ async function master() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This function will only be called in each forked process
|
// This function will only be called in each forked process
|
||||||
async function start(id: number, disconnect: () => void) {
|
async function start(_id: number, disconnect: () => void) {
|
||||||
// Ensure plugins are loaded
|
// Ensure plugins are loaded
|
||||||
PluginManager.loadPlugins();
|
PluginManager.loadPlugins();
|
||||||
|
|
||||||
|
|||||||
@@ -81,12 +81,16 @@ export class PluginManager {
|
|||||||
.get(plugin.type)!
|
.get(plugin.type)!
|
||||||
.push({ ...plugin, priority: plugin.priority ?? PluginPriority.Normal });
|
.push({ ...plugin, priority: plugin.priority ?? PluginPriority.Normal });
|
||||||
|
|
||||||
Logger.debug(
|
// Do not log plugin registration in forked worker processes, one log from the master process
|
||||||
"plugins",
|
// is enough. This can be detected by the presence of `process.send`.
|
||||||
`Plugin(type=${plugin.type}) registered ${
|
if (process.send === undefined) {
|
||||||
"name" in plugin.value ? plugin.value.name : ""
|
Logger.debug(
|
||||||
} ${plugin.description ? `(${plugin.description})` : ""}`
|
"plugins",
|
||||||
);
|
`Plugin(type=${plugin.type}) registered ${
|
||||||
|
"name" in plugin.value ? plugin.value.name : ""
|
||||||
|
} ${plugin.description ? `(${plugin.description})` : ""}`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user