mne-bids-pipeline icon indicating copy to clipboard operation
mne-bids-pipeline copied to clipboard

implement expandable logging system

Open SophieHerbst opened this issue 1 year ago • 1 comments

Follow-up from #914 Aim: Provide more information from MNE's logging (currently set to 'error' by default) in the pipeline's log: implement a logging system via rich where the user can expand and collapse entire log sections -- in a separate file?

SophieHerbst avatar Apr 02 '24 15:04 SophieHerbst

In principle Python's logging system, which is used by mne, can have arbitrary handlers attached. So one way to do this would be to

  1. Set the logging level to info or whatever
  2. Remove all existing handlers
  3. Add a custom message handler that took whatever message was logged and hook it into our rich logging system

I think in principle this shouldn't be too bad to do. Could be fun for someone interested in experimenting with rich.

Maybe we could start with trying the rich-collapsible support first, and see if that's enough. Then maybe we don't need a file at all (or | tee <whatever> in the terminal could be good enough for logging mne_bids_pipeline calls).

larsoner avatar Apr 02 '24 16:04 larsoner