diff --git a/src/logs.js b/src/logs.js index 33a579dde..aa226132c 100644 --- a/src/logs.js +++ b/src/logs.js @@ -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) { diff --git a/src/shell.js b/src/shell.js index c1a1ac0cd..47cf612d8 100644 --- a/src/shell.js +++ b/src/shell.js @@ -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) {