cdsapi icon indicating copy to clipboard operation
cdsapi copied to clipboard

don't use logging.basicConfig

Open kandersolar opened this issue 4 years ago • 1 comments

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.

kandersolar avatar Aug 20 '21 14:08 kandersolar

CLA assistant check
All committers have signed the CLA.

FussyDuck avatar Aug 20 '21 14:08 FussyDuck

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

peanutfun avatar Jan 24 '23 13:01 peanutfun

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

kandersolar avatar Jan 24 '23 15:01 kandersolar

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

kandersolar avatar Feb 28 '23 14:02 kandersolar