dingo-gw / dingo

Dingo: Deep inference for gravitational-wave observations
MIT License
55 stars 18 forks source link

Improved logging #152

Open stephengreen opened 1 year ago

stephengreen commented 1 year ago

We should use the logging package rather than print statements throughout the code, issuing either warnings or info depending on circumstances. This will require setting up the logger and changing all print statements. Although this could be automated, there will be some work involved in choosing between warning and info for each one.

For dingo_pipe we do use a logger, but this is the logger created for bilby_pipe, so everything says "BILBY_PIPE". This should be changed as well.

mpuerrer commented 1 year ago

I remember adding the bilby logger a long time ago, https://github.com/dingo-gw/dingo-devel/blob/cf615f0ef1fbe92a7616a278da25b71600387562/dingo/gw/prior.py#L17 but it has not been used. I think there was a good reason to import the logger from bilby and reuse it, but I don't remember why.

stephengreen commented 1 year ago

Right, I think at the time I didn't totally understand how it worked, and also we didn't want it labelling everything "Bilby". For dingo_pipe I used the bilby_pipe logger and it has this issue.

nihargupte-ph commented 1 year ago

I can take a stab at this if its ok?

stephengreen commented 1 year ago

Please do!