Add version to plugin load log

This commit is contained in:
Asher 2020-09-30 15:43:43 -05:00
parent e64b186527
commit 7a982555a8
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -34,7 +34,12 @@ const loadPlugin = async (pluginPath: string, httpServer: HttpServer, args: Args
try { try {
const plugin: Plugin = require(pluginPath) const plugin: Plugin = require(pluginPath)
plugin.activate(httpServer, args) plugin.activate(httpServer, args)
logger.debug("Loaded plugin", field("name", path.basename(pluginPath)))
logger.debug(
"Loaded plugin",
field("name", path.basename(pluginPath)),
field("version", require(path.join(pluginPath, "package.json")).version || "n/a"),
)
} catch (error) { } catch (error) {
if (error.code !== "MODULE_NOT_FOUND") { if (error.code !== "MODULE_NOT_FOUND") {
logger.warn(error.message) logger.warn(error.message)