podi_logging Module

This module contains all routines to configure and start the multi-processing safe logging. All log output is queued, and handled in sequence by a separate logging process.

class podi_logging.QueueHandler(queue)[source]

Bases: logging.Handler

This is a logging handler which sends events to a multiprocessing queue.

emit(record)[source]

Emit a record.

Writes the LogRecord to the queue.

flush()[source]
podi_logging.log_master(queue, options)[source]

This is the main process that handles all log output.

Each log-entry is received via the queue that’s being fed by all sub-processes, and then forwarded to other log-handlers.

podi_logging.log_master_setup()[source]
podi_logging.log_slave_setup(queue)[source]
podi_logging.podi_log_master_quit(log_master_info)[source]

Shutdown the logging process

podi_logging.podi_log_master_start(options)[source]

This function creates the logging sub-process that handles all log output.

This function also prepares the necessary information so we can activate the multiprocessing-safe logging in all sub-processes

podi_logging.podi_logger_setup(setup)[source]

This function re-directs all logging output to the logging queue that feeds the logging subprocess.

podi_logging.random() → x in the interval [0, 1).
podi_logging.test_worker_process(log_setup)[source]