cdsapi
cdsapi copied to clipboard
don't use logging.basicConfig
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.
Why is this being delayed so long? Is there something one could help with? I would very much appreciate the fix!
I think the next step is for the ECMWF maintainers (@b8raoult?) to review :)
Thanks @EddyCMWF! Glad to see some activity on this repo again :)