Global.Quiet

Global.Quiet#

Global.Quiet.py

Context manager for suppressing verbose output from legacy code.

suppress_if_quiet(debug=False)#

Context manager that suppresses stdout, stderr, and warnings when quiet mode is on.

Usage:

from molass.Global.Quiet import suppress_if_quiet

with suppress_if_quiet():
    # legacy code that prints noise
    ...

When set_molass_options(quiet=True) is active and debug is False, all output inside the with block is discarded. When quiet=False (default) or debug is True, the block executes normally.

Parameters:

debug (bool, optional) – If True, never suppress — even when quiet mode is on.