shamo.utils.logging.subprocess_to_logger

shamo.utils.logging.subprocess_to_logger(process, logger=None, log_level=20, pattern='')[source]

A context manager to pipe the output of a subprocess to the logger.

Parameters
loggerlogging.Logger

The logger to pipe the stream to.

log_levelint

The logging level of the piped messages.

patternstr

A pattern containing a ‘level’ and a ‘text’ group.