logging.handlers.QueueListener.prepare()

prepare(record) Prepare a record for handling. This implementation just returns the passed-in record. You may want to override this method if you need to do any custom marshalling or manipulation of the record before passing it to the handlers.

logging.handlers.QueueListener.handle()

handle(record) Handle a record. This just loops through the handlers offering them the record to handle. The actual object passed to the handlers is that which is returned from prepare().

logging.handlers.QueueListener.enqueue_sentinel()

enqueue_sentinel() Writes a sentinel to the queue to tell the listener to quit. This implementation uses put_nowait(). You may want to override this method if you want to use timeouts or work with custom queue implementations. New in version 3.3.

logging.handlers.QueueListener.dequeue()

dequeue(block) Dequeues a record and return it, optionally blocking. The base implementation uses get(). You may want to override this method if you want to use timeouts or work with custom queue implementations.

logging.handlers.QueueListener

class logging.handlers.QueueListener(queue, *handlers, respect_handler_level=False) Returns a new instance of the QueueListener class. The instance is initialized with the queue to send messages to and a list of handlers which will handle entries placed on the queue. The queue can be any queue- like object; it’s passed as-is to the dequeue() method, which needs to know how to get messages from it. If respect_handler_level is True, a handler’s level is respected (compared with the level for t

logging.handlers.QueueHandler.prepare()

prepare(record) Prepares a record for queuing. The object returned by this method is enqueued. The base implementation formats the record to merge the message and arguments, and removes unpickleable items from the record in-place. You might want to override this method if you want to convert the record to a dict or JSON string, or send a modified copy of the record while leaving the original intact.

logging.handlers.QueueHandler.enqueue()

enqueue(record) Enqueues the record on the queue using put_nowait(); you may want to override this if you want to use blocking behaviour, or a timeout, or a customized queue implementation.

logging.handlers.QueueHandler.emit()

emit(record) Enqueues the result of preparing the LogRecord.

logging.handlers.QueueHandler

class logging.handlers.QueueHandler(queue) Returns a new instance of the QueueHandler class. The instance is initialized with the queue to send messages to. The queue can be any queue- like object; it’s used as-is by the enqueue() method, which needs to know how to send messages to it. emit(record) Enqueues the result of preparing the LogRecord. prepare(record) Prepares a record for queuing. The object returned by this method is enqueued. The base implementation formats the record t

logging.handlers.NTEventLogHandler.getMessageID()

getMessageID(record) Returns the message ID for the record. If you are using your own messages, you could do this by having the msg passed to the logger being an ID rather than a format string. Then, in here, you could use a dictionary lookup to get the message ID. This version returns 1, which is the base message ID in win32service.pyd.