-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logs): implement several filters & support retrieval of persiste…
…d logs (#165) This commit does two enhancements to the `log` subcommand. - add several options such as `--grep`, `--levels`, and `--regions` that allows for filtering out logs that we're not interested in - add options called `--since` and `--until`, which enable the retrieval of persisted logs (as opposed to live logs)
- Loading branch information
1 parent
696ad05
commit e9f695b
Showing
8 changed files
with
470 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ export { | |
red, | ||
yellow, | ||
} from "https://deno.land/[email protected]/fmt/colors.ts"; | ||
export { parse as parseArgs } from "https://deno.land/std@0.170.0/flags/mod.ts"; | ||
export { parse } from "https://deno.land/std@0.195.0/flags/mod.ts"; | ||
export { TextLineStream } from "https://deno.land/[email protected]/streams/text_line_stream.ts"; | ||
|
||
// x/semver | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2021 Deno Land Inc. All rights reserved. MIT license. | ||
|
||
import { parse } from "../deps.ts"; | ||
|
||
export function parseArgs(args: string[]) { | ||
const parsed = parse(args, { | ||
alias: { | ||
"help": "h", | ||
"version": "V", | ||
"project": "p", | ||
}, | ||
boolean: [ | ||
"help", | ||
"prod", | ||
"static", | ||
"version", | ||
"dry-run", | ||
], | ||
string: [ | ||
"project", | ||
"token", | ||
"include", | ||
"exclude", | ||
"import-map", | ||
"deployment", | ||
"since", | ||
"until", | ||
"grep", | ||
"levels", | ||
"regions", | ||
"limit", | ||
], | ||
collect: ["grep"], | ||
default: { | ||
static: true, | ||
limit: "100", | ||
}, | ||
}); | ||
return parsed; | ||
} | ||
|
||
export type Args = ReturnType<typeof parseArgs>; |
Oops, something went wrong.