Skip to content

Commit e04b476

Browse files
committed
feat(cli): simplify logs command
1 parent 5f28484 commit e04b476

File tree

1 file changed

+20
-29
lines changed
  • apps/cli/src/commands/rollups

1 file changed

+20
-29
lines changed

apps/cli/src/commands/rollups/logs.ts

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export const createLogsCommand = () => {
77
.description("Show logs of a local rollups node environment.")
88
.option("-f, --follow", "Follow log output")
99
.option("--no-color", "Produce monochrome output")
10-
.option("--no-log-prefix", "Don't print prefix in logs")
1110
.option(
1211
"--since <string>",
1312
"Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)",
@@ -17,37 +16,29 @@ export const createLogsCommand = () => {
1716
"Number of lines to show from the end of the logs",
1817
"all",
1918
)
20-
.option("-t, --timestamps", "Show timestamps")
2119
.option(
2220
"--until <string>",
2321
"Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)",
2422
)
2523
.configureHelp({ showGlobalOptions: true })
26-
.action(
27-
async (
28-
{ follow, color, logPrefix, since, tail, timestamps, until },
29-
command,
30-
) => {
31-
const { projectName } = command.optsWithGlobals();
32-
const logOptions: string[] = [];
33-
if (follow) logOptions.push("--follow");
34-
if (color === false) logOptions.push("--no-color");
35-
if (logPrefix === false) logOptions.push("--no-log-prefix");
36-
if (since) logOptions.push("--since", since);
37-
if (tail) logOptions.push("--tail", tail);
38-
if (timestamps) logOptions.push("--timestamps");
39-
await execa(
40-
"docker",
41-
[
42-
"compose",
43-
"-p",
44-
projectName,
45-
"logs",
46-
...logOptions,
47-
"rollups-node",
48-
],
49-
{ stdio: "inherit" },
50-
);
51-
},
52-
);
24+
.action(async ({ follow, color, since, tail, until }, command) => {
25+
const { projectName } = command.optsWithGlobals();
26+
const logOptions: string[] = ["--no-log-prefix"];
27+
if (follow) logOptions.push("--follow");
28+
if (color === false) logOptions.push("--no-color");
29+
if (since) logOptions.push("--since", since);
30+
if (tail) logOptions.push("--tail", tail);
31+
await execa(
32+
"docker",
33+
[
34+
"compose",
35+
"-p",
36+
projectName,
37+
"logs",
38+
...logOptions,
39+
"rollups-node",
40+
],
41+
{ stdio: "inherit" },
42+
);
43+
});
5344
};

0 commit comments

Comments
 (0)