disable_logging

jwst.lib.basic_utils.disable_logging(level=50)[source]

Disable logging within a context.

Parameters:
levelint, optional

Logging level. At this level and below, all logging is disabled. Defaults to logging.CRITICAL, which disables logging at all levels.

Examples

The context manager is used as:

with disable_logging(level=logging.ERROR):
    # code containing logging to ignore, other than CRITICAL messages
    ...