Context manager for logging level.
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.
int
| 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
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!
mne.use_log_level
#