From c84651839cda4c93011e69473eed6668d4807306 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 21 Nov 2023 21:58:07 +0200 Subject: [PATCH] Putting logs streaming within the step to prevent issues with some edge cases. --- src/lib/lightnet.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/lib/lightnet.js b/src/lib/lightnet.js index 8eea0b18..57f14858 100644 --- a/src/lib/lightnet.js +++ b/src/lib/lightnet.js @@ -350,10 +350,13 @@ export async function lightnetFollowLogs({ process, debug }) { const selectedProcess = process || (await promptForDockerContainerProcess(processToLogFileMapping)); const logFilePath = processToLogFileMapping.get(selectedProcess); - await streamDockerContainerFileContent( - lightnetDockerContainerName, - logFilePath - ); + + await step('Docker container file content streaming', async () => { + await streamDockerContainerFileContent( + lightnetDockerContainerName, + logFilePath + ); + }); } function getProcessToLogFileMapping({ mode, archive }) { @@ -552,12 +555,13 @@ async function streamDockerContainerFileContent(containerName, filePath) { try { const border = getBorderCharacters('norc'); console.log( - '\n' + chalk.reset.bold('Docker container file content streaming') + '\n' - ); - console.log( - table([[chalk.reset('Use Ctrl+C to stop the file content streaming.')]], { - border, - }) + '\n' + + table( + [[chalk.reset('Use Ctrl+C to stop the file content streaming.')]], + { + border, + } + ) ); await shellExec(`docker exec ${containerName} tail -n 50 -f ${filePath}`, { silent: false,