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

don't use logging.basicConfig #47

Merged
merged 3 commits into from
Feb 28, 2023
Merged

Conversation

kandersolar
Copy link
Contributor

Closes #46.

With this patch, creating a Client no longer affects the external loggers' level:

In [1]: import logging
   ...: import cdsapi
   ...:
   ...: # external logger initially at WARNING level:
   ...: my_logger = logging.getLogger('my_logger')
   ...: print(my_logger)  # <Logger my_logger (WARNING)>
   ...: my_logger.info('this is not printed')
   ...: client = cdsapi.Client()
   ...: print(my_logger)  # <Logger my_logger (INFO)>
   ...: my_logger.info('this is printed')
   ...:
<Logger my_logger (WARNING)>
<Logger my_logger (WARNING)>

Happy to add tests/docs/etc, let me know if that's needed.

@FussyDuck
Copy link

FussyDuck commented Aug 20, 2021

CLA assistant check
All committers have signed the CLA.

@peanutfun
Copy link

Why is this being delayed so long? Is there something one could help with? I would very much appreciate the fix!

@kandersolar
Copy link
Contributor Author

I think the next step is for the ECMWF maintainers (@b8raoult?) to review :)

@EddyCMWF EddyCMWF merged commit 5862e1f into ecmwf:master Feb 28, 2023
@kandersolar kandersolar deleted the loggingfix branch February 28, 2023 14:39
@kandersolar
Copy link
Contributor Author

Thanks @EddyCMWF! Glad to see some activity on this repo again :)

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.

cdsapi.Client changes logging level of external loggers
5 participants