fastprogress icon indicating copy to clipboard operation
fastprogress copied to clipboard

How to disable or turn-off progress bar globally

Open JakeSummers opened this issue 1 year ago • 1 comments

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 avatar Feb 02 '24 22:02 JakeSummers

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

JakeSummers avatar Feb 12 '24 21:02 JakeSummers