Skip to content

Progressbar writer #227

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anysomewhere
Copy link

@anysomewhere anysomewhere commented Apr 12, 2025

Use the writer from the logger to write the progressbar output to. The logger is available in every function that uses a progressbar but it is often un(der)used. As the default output writer for loggers is os.Stderr as which is the default for the progressbar as well, this won't change anything for default logger users, but it enables users of the library to redirect the progressbar output.

Use the writer from the logger to write the progressbar output to.
The logger is available in every function that uses a progressbar but it is often un(der)used.
As the default output writer for loggers is os.Stderr as which is the default for the progressbar as well, this won't change anything for default logger users, but it enables users of the library to redirect the progressbar output.
if len(description) > 0 {
desc = description[0]
}
return progressbar.NewOptions64(
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to minimize the amount of configuration here, sticking to the defaults like before?

Copy link
Author

Choose a reason for hiding this comment

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

The progressbar interface isn't that flexible.

@bdon
Copy link
Member

bdon commented Apr 15, 2025

Thanks, agreed this would be useful and has a lot of overlap with #117 so maybe we should move to slog soon which should encompass hiding progress. What specific subcommand do you need this for?

@anysomewhere
Copy link
Author

Is there a requirement to move to slog? That would make progressbars more or less impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants