getLocalLogfilePaths -> getLogPaths

This commit is contained in:
Girish Ramakrishnan
2022-01-04 09:12:45 -08:00
parent a04abf25f4
commit b18626c75c
2 changed files with 9 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ exports = module.exports = {
listBackups,
getTask,
getLocalLogfilePaths,
getLogPaths,
getLogs,
getCertificate,
@@ -1792,7 +1792,7 @@ async function updateApp(app, data, auditSource) {
return { taskId };
}
function getLocalLogfilePaths(app) {
async function getLogPaths(app) {
assert.strictEqual(typeof app, 'object');
const appId = app.id;
@@ -1824,7 +1824,8 @@ async function getLogs(app, options) {
const args = [ '--lines=' + lines ];
if (follow) args.push('--follow', '--retry', '--quiet'); // same as -F. to make it work if file doesn't exist, --quiet to not output file headers, which are no logs
const cp = spawn('/usr/bin/tail', args.concat(getLocalLogfilePaths(app)));
const logPaths = await getLogPaths(app);
const cp = spawn('/usr/bin/tail', args.concat(logPaths));
const transformStream = split(function mapper(line) {
if (format !== 'json') return line + '\n';