mne.use_log_level#

class mne.use_log_level(verbose, *, add_frames=None)[source]#

Context manager for logging level.

Parameters
verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

add_framesint | None

If int, enable (>=1) or disable (0) the printing of stack frame information using formatting. Default (None) does not change the formatting. This can add overhead so is meant only for debugging.

See also

mne.verbose

Notes

See the logging documentation for details.

Examples

>>> from mne import use_log_level
>>> from mne.utils import logger
>>> with use_log_level(False):
...     # Most MNE logger messages are "info" level, False makes them not
...     # print:
...     logger.info('This message will not be printed')
>>> with use_log_level(True):
...     # Using verbose=True in functions, methods, or this context manager
...     # will ensure they are printed
...     logger.info('This message will be printed!')
This message will be printed!

Examples using mne.use_log_level#

Configuring MNE-Python

Configuring MNE-Python

Configuring MNE-Python