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

Reduce logging for exec node

(can be re-enabled by using node -v red.js ... )
This commit is contained in:
Dave C-J 2014-10-25 17:50:55 +01:00
parent b54e9edfa6
commit d9363f4974

View File

@ -35,7 +35,7 @@ module.exports = function(RED) {
var arg = []; var arg = [];
if (node.append.length > 0) { arg = node.append.split(","); } if (node.append.length > 0) { arg = node.append.split(","); }
if (msg.payload.trim() !== "") { arg.unshift(msg.payload); } if (msg.payload.trim() !== "") { arg.unshift(msg.payload); }
node.log(node.cmd+" ["+arg+"]"); if (RED.settings.verbose) { node.log(node.cmd+" ["+arg+"]"); }
if (node.cmd.indexOf(" ") == -1) { if (node.cmd.indexOf(" ") == -1) {
var ex = spawn(node.cmd,arg); var ex = spawn(node.cmd,arg);
ex.stdout.on('data', function (data) { ex.stdout.on('data', function (data) {
@ -62,7 +62,7 @@ module.exports = function(RED) {
} }
else { else {
var cl = node.cmd+" "+msg.payload+" "+node.append; var cl = node.cmd+" "+msg.payload+" "+node.append;
node.log(cl); if (RED.settings.verbose) { node.log(cl); }
var child = exec(cl, function (error, stdout, stderr) { var child = exec(cl, function (error, stdout, stderr) {
msg.payload = stdout; msg.payload = stdout;
var msg2 = {payload:stderr}; var msg2 = {payload:stderr};