openneuro-py icon indicating copy to clipboard operation
openneuro-py copied to clipboard

Log info messages

Open cbrnr opened this issue 4 months ago • 2 comments

Currently, all info messages are printed to stdout via tqdm.write(). This is very useful for the CLI. However, I think it would be nice to log these messages to info (instead of printing) when using the Python interface.

One way to implement this is to do logger.info() by default and add a new parameter to download() (e.g. redirect_logging=False), which the CLI would set to True.

Since there are a couple of other functions that produce messages, we'd need to add the parameter there as well (a bit cumbersome). It would be nice to have some global option, but I couldn't think of a nice way to implement that so far (ideas welcome).

Finally, I think when logging messages, these should not get too long, so maybe these could be modified to at least not contain line breaks.

cbrnr avatar Feb 08 '24 08:02 cbrnr