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

fully log node warnings on start

(i.e. don’t need -v for simple errors on start)
This commit is contained in:
Dave Conway-Jones 2016-05-26 10:38:24 +01:00
parent 807873f685
commit 69f83cb905
2 changed files with 10 additions and 15 deletions

View File

@ -34,17 +34,17 @@ var stubbedExpressApp = {
get: function() {}, get: function() {},
post: function() {}, post: function() {},
put: function() {}, put: function() {},
delete: function(){} delete: function() {}
} }
var adminApi = { var adminApi = {
library: { library: {
register: function(){} register: function() {}
}, },
auth: { auth: {
needsPermission: function(){} needsPermission: function() {}
}, },
comms: { comms: {
publish: function(){} publish: function() {}
}, },
adminApp: stubbedExpressApp, adminApp: stubbedExpressApp,
nodeApp: stubbedExpressApp, nodeApp: stubbedExpressApp,
@ -105,16 +105,11 @@ function start() {
var nodeErrors = redNodes.getNodeList(function(n) { return n.err!=null;}); var nodeErrors = redNodes.getNodeList(function(n) { return n.err!=null;});
var nodeMissing = redNodes.getNodeList(function(n) { return n.module && n.enabled && !n.loaded && !n.err;}); var nodeMissing = redNodes.getNodeList(function(n) { return n.module && n.enabled && !n.loaded && !n.err;});
if (nodeErrors.length > 0) { if (nodeErrors.length > 0) {
log.warn("------------------------------------------"); log.warn("------------------------------------------------------");
if (settings.verbose) { for (i=0;i<nodeErrors.length;i+=1) {
for (i=0;i<nodeErrors.length;i+=1) { log.warn("["+nodeErrors[i].name+"] "+nodeErrors[i].err);
log.warn("["+nodeErrors[i].name+"] "+nodeErrors[i].err);
}
} else {
log.warn(log._("server.errors",{count:nodeErrors.length}));
log.warn(log._("server.errors-help"));
} }
log.warn("------------------------------------------"); log.warn("------------------------------------------------------");
} }
if (nodeMissing.length > 0) { if (nodeMissing.length > 0) {
log.warn(log._("server.missing-modules")); log.warn(log._("server.missing-modules"));
@ -148,7 +143,7 @@ function start() {
}).otherwise(function(err) { }).otherwise(function(err) {
console.log(err); console.log(err);
}); });
}); });
} }
function reportMetrics() { function reportMetrics() {

View File

@ -120,7 +120,7 @@
}, },
"localfilesystem": { "localfilesystem": {
"user-dir": "User directory : __path__", "user-dir": "User directory : __path__",
"flows-file": "Flows file : __path__", "flows-file": "Flows file : __path__",
"create": "Creating new flow file", "create": "Creating new flow file",
"empty": "Existing flow file is empty", "empty": "Existing flow file is empty",
"invalid": "Existing flow file is not valid json", "invalid": "Existing flow file is not valid json",