Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/lightnet-logs' into lightnet-exp…
Browse files Browse the repository at this point in the history
…lorer
  • Loading branch information
shimkiv committed Nov 21, 2023
2 parents 92c3cd4 + c846518 commit c4dbd5e
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/lib/lightnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c4dbd5e

Please sign in to comment.