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


Add the specified handler to this logger.


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


Handle a record.

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


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 a record.

Try three times rapidly, then just drop it.


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