pyrolite.util.log

pyrolite.util.log.Handle(logger, handler_class=<class 'logging.StreamHandler'>, formatter='%(asctime)s %(name)s - %(levelname)s: %(message)s', level=None)[source]

Handle a logger with a standardised formatting.

Parameters
Returns

Configured logger.

Return type

logging.Logger

class pyrolite.util.log.ToLogger(logger, level=None)[source]

Output stream which will output to logger module instead of stdout.

buf = ''
logger = None
level = None
write(buf)[source]

Write string to file.

Returns the number of characters written, which is always equal to the length of the string.

flush()[source]

Flush write buffers, if applicable.

This is not implemented for read-only and non-blocking streams.

pyrolite.util.log.stream_log(logger=None, level='INFO')[source]

Stream the log from a specific package or subpackage.

Parameters
  • logger (str | logging.Logger) – Name of the logger or module to monitor logging from.

  • level (str, 'INFO') – Logging level at which to set the handler output.

Returns

Logger for the specified package with stream handler added.

Return type

logging.Logger