1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Improve custom context store module logging

This commit is contained in:
Nick O'Leary 2018-08-09 15:37:04 +01:00
parent c9f916ebab
commit 1dc021e871
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -112,7 +112,15 @@ function load() {
try { try {
// Create a new instance of the plugin by calling its module function // Create a new instance of the plugin by calling its module function
stores[pluginName] = plugin(config); stores[pluginName] = plugin(config);
log.info(log._("context.log-store-init", {name:pluginName, info:"module="+plugins[pluginName].module})); var moduleInfo = plugins[pluginName].module;
if (typeof moduleInfo !== 'string') {
if (moduleInfo.hasOwnProperty("toString")) {
moduleInfo = moduleInfo.toString();
} else {
moduleInfo = "custom";
}
}
log.info(log._("context.log-store-init", {name:pluginName, info:"module="+moduleInfo}));
} catch(err) { } catch(err) {
return reject(new Error(log._("context.error-loading-module",{module:pluginName,message:err.toString()}))); return reject(new Error(log._("context.error-loading-module",{module:pluginName,message:err.toString()})));
} }