Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli/src/cli/commands/project/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ export function getLogsCommand(): Command {
normalizeDatetime,
)
.addOption(
new Option("--level <level>", "Filter by log level")
.choices([...LogLevelSchema.options])
.hideHelp(),
new Option("--level <level>", "Filter by log level").choices([
...LogLevelSchema.options,
]),
)
.option("-n, --limit <n>", "Results per page (1-1000, default: 50)")
.option("-f, --follow", "Stream new logs as they arrive")
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/tests/cli/logs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ describe("logs command", () => {
t.expectResult(result).toFail();
});

it("documents --level in --help", async () => {
const result = await t.run("logs", "--help");

t.expectResult(result).toSucceed();
t.expectResult(result).toContain("--level <level>");
});

it("filters function logs by --level", async () => {
await t.givenLoggedInWithProject(fixture("basic"));
t.api.mockFunctionLogs("my-function", [
Expand Down
Loading