mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
use implicit logging of context store
This commit is contained in:
@@ -45,13 +45,10 @@ function logUnknownStore(name) {
|
||||
}
|
||||
}
|
||||
|
||||
function logStores() {
|
||||
for(var name in stores) {
|
||||
if (name !== '_') { // ignore default store
|
||||
var plugin = stores[name];
|
||||
log.info(log._("context.log-store-init",
|
||||
{name:name, info:plugin.info() }));
|
||||
}
|
||||
function logStore(name, module) {
|
||||
if (name !== '_') { // ignore default store
|
||||
log.info(log._("context.log-store-init",
|
||||
{name:name, info:"module="+module}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +113,7 @@ function load() {
|
||||
try {
|
||||
// Create a new instance of the plugin by calling its module function
|
||||
stores[pluginName] = plugin(config);
|
||||
logStore(pluginName, plugins[pluginName].module);
|
||||
} catch(err) {
|
||||
return reject(new Error(log._("context.error-loading-module",{module:pluginName,message:err.toString()})));
|
||||
}
|
||||
@@ -426,6 +424,5 @@ module.exports = {
|
||||
get: getContext,
|
||||
delete: deleteContext,
|
||||
clean: clean,
|
||||
close: close,
|
||||
logStores: logStores
|
||||
close: close
|
||||
};
|
||||
|
@@ -267,24 +267,6 @@ LocalFileSystem.prototype.clean = function(activeNodes){
|
||||
});
|
||||
}
|
||||
|
||||
LocalFileSystem.prototype.info = function() {
|
||||
var self = this;
|
||||
var conf = self.config;
|
||||
var info = "module=localfilesystem";
|
||||
if (conf) {
|
||||
if (conf.hasOwnProperty("base")) {
|
||||
info += ",base='"+conf.base+"'";
|
||||
}
|
||||
if (conf.hasOwnProperty("dir")) {
|
||||
info += ",dir='"+conf.dir+"'";
|
||||
}
|
||||
if (conf.hasOwnProperty("cache")) {
|
||||
info += ",cache";
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
module.exports = function(config){
|
||||
return new LocalFileSystem(config);
|
||||
};
|
||||
|
@@ -124,13 +124,6 @@ Memory.prototype._export = function() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
Memory.prototype.info = function() {
|
||||
var self = this;
|
||||
var conf = self.config;
|
||||
var info = "module=memory";
|
||||
return info;
|
||||
}
|
||||
|
||||
module.exports = function(config){
|
||||
return new Memory(config);
|
||||
};
|
||||
|
@@ -223,6 +223,5 @@ module.exports = {
|
||||
// Contexts
|
||||
loadContextsPlugin: context.load,
|
||||
closeContextsPlugin: context.close,
|
||||
listContextStores: context.listStores,
|
||||
logContextStores: context.logStores
|
||||
listContextStores: context.listStores
|
||||
};
|
||||
|
Reference in New Issue
Block a user