bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python.
https://bilby-dev.github.io/bilby/
MIT License
59 stars 69 forks source link

Logger configuration #834

Open mj-will opened 2 weeks ago

mj-will commented 2 weeks ago

Currently, the logger in bilby adds handlers by default (see here). This goes against the recommend practice:

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.

I think we should consider changing this, what do people think?

ColmTalbot commented 1 week ago

I'm in favour in principle, I think we should make it straightforward to maintain the current behaviour as I suspect people will expect it, but I think this can be done via a change in bilby_pipe, updates to the example scripts, and (as always) writing some documentation.