mplog - Mplog - Parallel process logging

class vdrp.mplog.MultiProcessingHandler(name, sub_handler=None)[source]

Bases: logging.Handler

_format_record(record)[source]
_receive()[source]
close()[source]

Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods.

emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

send(s)[source]
setFormatter(fmt)[source]

Set the formatter for this handler.

vdrp.mplog.install_mp_handler(logger=None)[source]

Wraps the handlers in the given Logger with an MultiProcessingHandler. :param logger: whose handlers to wrap. By default, the root logger.

vdrp.mplog.setup_mp_logging(logfile, loglevel)[source]

Setup the logging and prepare it for use with multiprocessing