ssato / python-anyconfig

Python library provides common APIs to load and dump configuration files in various formats
MIT License
279 stars 31 forks source link

anyconfig should not attach its own logging hanlers #11

Closed traut closed 9 years ago

traut commented 9 years ago

The library should not attach a new handler to a logger implicitly. Anyconfig does that during import which is very nasty:

https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library

Note It is strongly advised that you do not add any handlers other than NullHandler to your library’s loggers. This is because the configuration of handlers is the prerogative of the application developer who uses your library. The application developer knows their target audience and what handlers are most appropriate for their application: if you add handlers ‘under the hood’, you might well interfere with their ability to carry out unit tests and deliver logs which suit their requirements.