-
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?
Conversation
…gs to text or json file
…ng the logs, instead of retrieving all of the logs and then writing them all to the file
…ck when writing to file
…t arguments to be paired - either both are provided, or an error will be displated
…ds called on the *viamClient
… logs cli command
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.
LGTM! There were some changes in flag names that were recently merged in, but I don't suspect it should affect your PR too much
cli/app.go
Outdated
&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 comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention needs format flag
, needs output flag
for the users in the usage text? Not sure if necessary, but a suggestion, since I feel like I would read that as being able to format it when printing to console as well
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.
You can decide the format when printing to the console! The command will default to text if the format
flag is not included. Are you suggesting something else?
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.
Oh, you can also format it for the console! Ignore me then :)
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.
A couple small things but generally lgtm
cli/app.go
Outdated
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 comment
The 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?
cli/app.go
Outdated
logsFlagStartTime = "start" | ||
logsFlagEndTime = "end" |
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
and dataFlagEnd
). Would you be willing to rename those to generalFlagStart
and generalFlagEnd
and then update call sites so that there's only the single instance of a --start
or --end
flag?
…s-For-Downloading-Logs
…Time to generalFlagStart and generalFlagEnd
e627f4b
to
b292477
Compare
cb55d25
to
0d65512
Compare
This PR implements additional filters to the machines logs CLI command, specifically:
keyword
,start time
,end time
andlog level
. Below are the details and test cases for the command:See ticket here
Invalid: Without any arguments
With Keyword Filter
With Error Level
Start Time
Start from after the last log
Start from a time with only a few logs
End Time
Notice how in the second screenshot, we skip the logs passed 15:16.
Start & End Time
End Case
Do we not want to output something prettier if their are no logs to display?