pyprep.setup_logging#

pyprep.setup_logging(level='info', *, stream=None, fmt='%(asctime)s [%(levelname)s] %(name)s: %(message)s')[source]#

Send pyprep’s log records to a stream, at the given level.

If your application already routes logging somewhere of its own, do not call this at all. The records will reach your handlers by propagation, and pyprep.set_log_level() is there if you want the "INFO" ones too.

Parameters:
levelint | str

Level for the pyprep logger, either a name (e.g. "debug", "WARNING") or a stdlib constant such as logging.DEBUG. Names are case-insensitive, as in mne.set_log_level(). Defaults to "info".

streamfile-like | None

Destination for pyprep’s handler. None means sys.stdout.

fmtstr

Format string for the handler, in the style of logging.Formatter. Defaults to pyprep._logging.DEFAULT_FORMAT, which prefixes each record with a timestamp, its level, and the name of the logger it came from.

Returns:
loggerlogging.Logger

The configured pyprep logger.

Notes

To hand the output back afterwards, drop the handler again with logging.getLogger("pyprep").handlers.clear().

Examples using pyprep.setup_logging#

Run the full PREP

Run the full PREP

Run PREP in stages

Run PREP in stages

Run RANSAC

Run RANSAC