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:
parent
c9f916ebab
commit
1dc021e871
@ -112,7 +112,15 @@ function load() {
|
||||
try {
|
||||
// Create a new instance of the plugin by calling its module function
|
||||
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) {
|
||||
return reject(new Error(log._("context.error-loading-module",{module:pluginName,message:err.toString()})));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user