dhcpkit.ipv6.server.queue_logger module

Adapt the QueueListener so that it respects the log levels of the handlers. Based on the Python 3.5 implementation.

class dhcpkit.ipv6.server.queue_logger.QueueLevelListener(queue, *handlers, respect_handler_level=False)[source]

Bases: logging.handlers.QueueListener

QueueListener that respects log levels

addHandler(handler)[source]

Add the specified handler to this logger.

dequeue(block)[source]

Dequeue a record and return it, optionally blocking. Return the sentinel on EOF because otherwise there are strange errors after a reload.

handle(record)[source]

Handle a record.

This just loops through the handlers offering them the record to handle.

removeHandler(handler)[source]

Remove the specified handler from this logger.

class dhcpkit.ipv6.server.queue_logger.WorkerQueueHandler(queue: multiprocessing.queues.Queue)[source]

Bases: logging.handlers.QueueHandler

A logging handler that queues messages and doesn’t cause exceptions when the queue is full.

enqueue(record)[source]

Enqueue a record.

Try three times rapidly, then just drop it.

prepare(record)[source]

Prepares a record for queuing. The object returned by this method is enqueued. This implementation adds the log_id if it is set.