Skip to content
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

Show progress only when logging to terminal #2582

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

nirs
Copy link
Member

@nirs nirs commented Sep 2, 2024

Fix the terminal check so we use the right configuration when logging to file, and hide the progress in this case.

Fixes #2581

nirs added 2 commits September 2, 2024 22:57
This way the pb.Start() does not start the ticker and never write
anything:
https://github.com/cheggaaa/pb/blob/master/v3/pb.go#L173

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Logging progress to file is not useful and it also breaks the log
format, adding empty line before the first progress, and leaving the
last progress at the start of the next log line.

Fix the terminal check to use os.Stderr, since both pb and logrus use
os.Stderr. When not using a terminal, hide the progress bar.

Fixes lima-vm#2581
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@AkihiroSuda AkihiroSuda added this to the v1.0 milestone Sep 3, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 01eb321 into lima-vm:master Sep 3, 2024
27 checks passed
@AkihiroSuda AkihiroSuda added the area/cli limactl CLI user experience label Sep 3, 2024
@nirs nirs deleted the progress-to-file branch September 3, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli limactl CLI user experience cherry-pick/v0.23
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress written when logging to file
2 participants