Display `pm.sample`'s progress bar in both a log file and notebook

I have a ipynb that I am trying to pre-process with nbformat.preprocessors.
In the notebook, I have set up a logger with both a file-handler and stream-handler (the logs are printed both inside the notebook and separately in a log file).

pm.sample's progress bar shows up in the ipynb, but not in the log file (this is probably expected as I haven’t provided the logger’s information to the progress bar)

Does anyone know how I might be able to have the pm.sample progress-bar show up in both the ipynb and the log file?

Thanks :smiley:

(I can make a MWE if needed)

Hi, I’m having the same issue. Is there any solution for this problem?

It looks like it can be set

from fastprogress import fastprogress
fastprogress.printing = lambda: True