shamo.utils.logging.stream_to_logger¶
-
shamo.utils.logging.
stream_to_logger
(logger=None, log_level=20, pattern='')[source]¶ A context manager where everything pushed to stdout is piped to the logger.
- Parameters
- logger
logging.Logger
The logger to pipe the stream to.
- log_level
int
The logging level of the piped messages.
- pattern
str
A pattern containing a ‘level’ and a ‘text’ group.
- logger