-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APP-6612] Add Filters for Downloading Logs #4673
base: main
Are you sure you want to change the base?
Changes from 11 commits
386db8c
232f143
6a02466
e14e9be
761d6fe
05dc2c2
921a908
690b887
e2786a5
225b5cb
b0698af
b3e00d3
bf0df5f
7abd091
0c6c6f9
b292477
0d65512
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,15 @@ const ( | |
// TODO: RSDK-6683. | ||
quietFlag = "quiet" | ||
|
||
logsFlagErrors = "errors" | ||
logsFlagTail = "tail" | ||
logsFlagCount = "count" | ||
logsFlagFormat = "format" | ||
logsFlagOutputFile = "output" | ||
logsFlagKeyword = "keyword" | ||
logsFlagLevels = "levels" | ||
logsFlagStartTime = "start" | ||
logsFlagEndTime = "end" | ||
logsFlagErrors = "errors" | ||
logsFlagTail = "tail" | ||
logsFlagCount = "count" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like some of these were added in a separate PR already. Would you mind pulling down main so we can get a more up-to-date look at what the diff is precisely? |
||
|
||
runFlagData = "data" | ||
runFlagStream = "stream" | ||
|
@@ -1548,6 +1554,32 @@ var app = &cli.App{ | |
Required: true, | ||
}, | ||
}, | ||
&cli.StringFlag{ | ||
Name: logsFlagOutputFile, | ||
Usage: "path to output file", | ||
}, | ||
&cli.StringFlag{ | ||
Name: logsFlagFormat, | ||
Usage: "file format (text or json)", | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe mention There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can decide the format when printing to the console! The command will default to text if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, you can also format it for the console! Ignore me then :) |
||
&cli.StringFlag{ | ||
Name: logsFlagKeyword, | ||
Usage: "filter logs by keyword", | ||
}, | ||
&cli.StringSliceFlag{ | ||
Name: logsFlagLevels, | ||
Usage: "filter logs by levels (e.g., info, warn, error)", | ||
}, | ||
&cli.TimestampFlag{ | ||
Name: logsFlagStartTime, | ||
Usage: "filter logs starting from this time", | ||
Layout: "2006-01-02T15:04:05Z", // Example format for ISO 8601 | ||
}, | ||
&cli.TimestampFlag{ | ||
Name: logsFlagEndTime, | ||
Usage: "filter logs until this time", | ||
Layout: "2006-01-02T15:04:05Z", // Example format for ISO 8601 | ||
}, | ||
&cli.BoolFlag{ | ||
Name: logsFlagErrors, | ||
Usage: "show only errors", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(minor) I'm gonna ask you to do a bit of bookkeeping for us here if you don't mind! We already have a "start" flag and an "end" flag (
dataFlagStart
anddataFlagEnd
). Would you be willing to rename those togeneralFlagStart
andgeneralFlagEnd
and then update call sites so that there's only the single instance of a--start
or--end
flag?