ranahaani / GNews

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.
https://pypi.org/project/gnews/
MIT License
708 stars 106 forks source link

Remove logging basicConfig from gnews.py #91

Open babatonga opened 4 months ago

babatonga commented 4 months ago

In the current implementation of gnews.py, the logging basicConfig is being set. However, this can lead to unintended consequences when GNews is used as a module within another application. It alters the entire configuration of the logging module, potentially conflicting with the main application's logging setup.

To address this issue and ensure better compatibility and modularity, it's advisable to remove the logging basicConfig from gnews.py. Instead, users can configure logging within their main application, allowing for better control and isolation of logging configurations. This change will prevent any interference with the main application's logging setup when using GNews as a module.

https://github.com/mengelkampIT/GNews/commit/3c19c26ad13231376b0fc61c3487b5a76d7ee5e8

ikubaysan commented 3 months ago

Please make this change, this has caused me a headache pinpointing why my application was producing duplicate logs. All that needs to be done is remove the logging.basicConfig() call from gnews.py