CaliDog / certstream-python

Python library for connecting to CertStream
MIT License
427 stars 73 forks source link

Switched to using a module-specific logger #30

Closed DavidJBianco closed 4 years ago

DavidJBianco commented 4 years ago

Now code calling this module can have better control over logs.

This module uses Python's logging module for its status messages (which is a good thing). However, the way it was implemented totally ignored the logging needs of other code which call this module. Because it used the 'root' logger and called BasicConfig() directly, it wasn't possible for other code to control logging.

This version is functionally identical, except that it uses a module-specific "certstream" logger, which can coexist peacefully with logging from other modules or the main program.

I know there is another pull request outstanding that tries to also address the logging issue, but does so by just offering the ability to turn off logging entirely. However, I think that using a module-specific logger is a more general solution.

Fitblip commented 4 years ago

Hi @DavidJBianco - Thanks for the PR. I agree your PR is a more holistic solution to the problem, and I'm sorry for the oversight, hogging the root logger is quite rude!

Thanks for the PR 🎉