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

**URL:** <https://discourse.pymc.io/t/display-pm-sample-s-progress-bar-in-both-a-log-file-and-notebook/8278>\
**Category:** Questions\
**Created:** [November 5, 2021, 5:15am UTC](https://discourse.pymc.io/t/display-pm-sample-s-progress-bar-in-both-a-log-file-and-notebook/8278 "2021-11-05T05:15:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avivajpeyi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/avivajpeyi/32/3179_2.png) [@avivajpeyi](https://discourse.pymc.io/u/avivajpeyi)\
**Post date:** [November 5, 2021, 5:15am UTC](https://discourse.pymc.io/t/display-pm-sample-s-progress-bar-in-both-a-log-file-and-notebook/8278/1 "2021-11-05T05:15:17Z")

</div>

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 😃

(I can make a MWE if needed)

---

<div class="post-metadata">

**Author:** ![qipengchen](https://avatars.discourse-cdn.com/v4/letter/q/65b543/32.png) [@qipengchen](https://discourse.pymc.io/u/qipengchen)\
**Post date:** [July 1, 2022, 6:11am UTC](https://discourse.pymc.io/t/display-pm-sample-s-progress-bar-in-both-a-log-file-and-notebook/8278/2 "2022-07-01T06:11:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![qipengchen](https://avatars.discourse-cdn.com/v4/letter/q/65b543/32.png) [@qipengchen](https://discourse.pymc.io/u/qipengchen)\
**Post date:** [July 1, 2022, 1:40pm UTC](https://discourse.pymc.io/t/display-pm-sample-s-progress-bar-in-both-a-log-file-and-notebook/8278/3 "2022-07-01T13:40:42Z")

</div>

It looks like it can be set

```auto
from fastprogress import fastprogress
fastprogress.printing = lambda: True

```
