algolia / algoliasearch-django

Seamless integration of Algolia into your Django project.
https://www.algolia.com
MIT License
173 stars 65 forks source link

Fix/default log handler #248

Closed PLNech closed 6 years ago

PLNech commented 6 years ago

Following a Support ticket:

When we are attempting to reindex our account, we are receiving this response (using Algolia' django project) No handlers could be found for logger "algoliasearch_django.models"

Indeed, we didn't follow the recommended way to Configure logging for a library:

In addition to documenting how a library uses logging, a good way to configure library logging so that it does not cause a spurious message is to add a handler which does nothing.

This PR implements such a NullHandler. I'm not using the NullHandler class as it's only available with python > 3.1.