Add option to not log shell subprocess stdout+stderr
When tailing the box log file this leads to logline recursion
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ function tail(filePaths, options) {
|
||||
const args = [ LOGTAIL_CMD, '--lines=' + lines ];
|
||||
if (options.follow) args.push('--follow');
|
||||
|
||||
return shell.sudo('tail', args.concat(filePaths), { streamStdout: true }, () => {});
|
||||
return shell.sudo('tail', args.concat(filePaths), { streamStdout: true, dropStdout: true, dropStdErr: true }, () => {});
|
||||
}
|
||||
|
||||
function journalctl(unit, options) {
|
||||
|
||||
+2
-2
@@ -111,10 +111,10 @@ function sudo(tag, args, options, callback) {
|
||||
|
||||
cp.stdout.on('data', (data) => {
|
||||
if (options.captureStdout) stdoutResult += data.toString('utf8');
|
||||
process.stdout.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
|
||||
if (!options.dropStdout) process.stdout.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
|
||||
});
|
||||
cp.stderr.on('data', (data) => {
|
||||
process.stderr.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
|
||||
if (!options.dropStderr) process.stderr.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
|
||||
});
|
||||
|
||||
cp.on('exit', function (code, signal) {
|
||||
|
||||
Reference in New Issue
Block a user