Set tqdm.disable from os.environ #1061
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a updated version of #950 that also adds in tests and updates the documentation for the
disable
parameter, and it updates the branch to be able to merge again as the other PR is stale since before the summer.The following is taken from #950
We evaluated the following suggestion that was posted earlier and decided it was not good enough as a general solution as it would both require us to update all usages of tqdm in our code, and we would have to remove it when/if this PR would be added in and all developers coding new code that uses tqdm would have to remember/know that they need to add in that fix in order to get the centralized disable feature.
read the known issues
environment, where applicable:
Usecase example
A simple use-case for this option is that we are running a big set of code where we have both support to run the exact same code as a cli tool from a users computer and in a hosted environment inside celery. And when we run it in celery, we do not want our logs to be polluted with tdqm loggin output. This option would make it super easy to disable all tdqm logging as we have it in a lot of places in our code and we would just configure our production servers with ansible/terraform to have this environment variable and we are all set and can controll our logging from a central point.