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

Allow to set verbosity level of get_download #78

Closed
faroit opened this issue Nov 29, 2020 · 5 comments
Closed

Allow to set verbosity level of get_download #78

faroit opened this issue Nov 29, 2020 · 5 comments
Milestone

Comments

@faroit
Copy link
Contributor

faroit commented Nov 29, 2020

download_get produces print statements that users might want to hide if they:

e.g.

Download file size: 984374 bytes On disk at /var/folders/4p/m3ccc38s0fg5b3c0zb1mdpph0000gn/T/tmpkzsf605i/0117522-200613084148143.zip

Maybe a verbose=False flag would be suffucient here? Ideally, there would be consistent usage of logging to set this package-wide.

Let me know what you think

@sckott
Copy link
Collaborator

sckott commented Nov 30, 2020

Sure, sounds good to set it package wide. Any best practice for doing that?

@faroit
Copy link
Contributor Author

faroit commented Dec 7, 2020

there are many packages to handle this nicely, but common practice seems still using logging and set some global config for it https://docs.python.org/3/library/logging.config.html

@sckott
Copy link
Collaborator

sckott commented Dec 7, 2020

@sckott sckott added this to the v0.6 milestone Jan 28, 2021
sckott added a commit that referenced this issue Jan 28, 2021
- this allows users to set the loggin level
- and allows users to turn off or turn on logging messages
- bump patch version for the change
@sckott
Copy link
Collaborator

sckott commented Jan 28, 2021

@faroit can you reinstall and try again?

download_get egs https://pygbif.readthedocs.io/en/latest/modules/occurrence.html#pygbif.occurrences.download_get

download egs https://pygbif.readthedocs.io/en/latest/modules/occurrence.html#pygbif.occurrences.download

those two methods were the only ones to use print statements, changed to logging now

@sckott sckott closed this as completed Mar 6, 2021
@faroit
Copy link
Contributor Author

faroit commented Mar 9, 2021

@sckott thanks a lot. I tried them and it works as advertised 👍

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

No branches or pull requests

2 participants