Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger configuration #834

Open
mj-will opened this issue Oct 21, 2024 · 2 comments
Open

Logger configuration #834

mj-will opened this issue Oct 21, 2024 · 2 comments
Labels

Comments

@mj-will
Copy link
Collaborator

mj-will commented Oct 21, 2024

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
Copy link
Collaborator

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.

@mj-will mj-will added the good first issue Good for newcomers label Nov 14, 2024
@mick-wright
Copy link

As a developer of a downstream pipeline, it would be handy for this to be the case. Currently, to get around it, I have my own logging functions hijack the bilby/bilby_pipe loggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants