fastai / fastprogress

Simple and flexible progress bar for Jupyter Notebook and console
Apache License 2.0
1.08k stars 105 forks source link

How to disable or turn-off progress bar globally #105

Open JakeSummers opened 7 months ago

JakeSummers commented 7 months ago

My backend service is using several libraries that are using this tooling.

Currently we are running a backend service, so we don't need a progress bar that prints to stdout. The progress bar is also corrupting some of our logs that occur on either side of the progres bar.

Is there a way to disable the progress bar globally, possibly by setting something like an environment variable?

JakeSummers commented 6 months ago

It looks like this is possible like this:

import fastprogress.fastprogress
fastprogress.fastprogress.NO_BAR = True

If you also want to disable the output from master_bar.write, you can do this:

def do_nothing(*args):
    pass

fastprogress.fastprogress.WRITER_FN = do_nothing