diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-02-20 17:41:03 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-02-20 17:41:03 +0000 |
commit | aacf9ed52e654eb68717d1a1a971956829751a59 (patch) | |
tree | 5f73358b73d8df1bdbb791c00e00c09ee471170e /logutils/queue.py | |
parent | 469b1d89217b4b1307c71c92f88688cb2f2600aa (diff) | |
download | logutils-aacf9ed52e654eb68717d1a1a971956829751a59.tar.gz |
Changes for 0.3.4.
Diffstat (limited to 'logutils/queue.py')
-rw-r--r-- | logutils/queue.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/logutils/queue.py b/logutils/queue.py index cced8c5..fea91d8 100644 --- a/logutils/queue.py +++ b/logutils/queue.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details. +# Copyright (C) 2010-2017 Vinay Sajip. See LICENSE.txt for details. # """ This module contains classes which help you work with queues. A typical @@ -32,7 +32,7 @@ class QueueHandler(logging.Handler): with a multiprocessing Queue to centralise logging to file in one process (in a multi-process application), so as to avoid file write contention between processes. - + :param queue: The queue to send `LogRecords` to. """ @@ -50,7 +50,7 @@ class QueueHandler(logging.Handler): The base implementation uses :meth:`~queue.Queue.put_nowait`. You may want to override this method if you want to use blocking, timeouts or custom queue implementations. - + :param record: The record to enqueue. """ self.queue.put_nowait(record) @@ -67,7 +67,7 @@ class QueueHandler(logging.Handler): 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. - + :param record: The record to prepare. """ # The format operation gets traceback text into record.exc_text @@ -87,7 +87,7 @@ class QueueHandler(logging.Handler): Emit a record. Writes the LogRecord to the queue, preparing it for pickling first. - + :param record: The record to emit. """ try: @@ -102,7 +102,7 @@ class QueueListener(object): This class implements an internal threaded listener which watches for LogRecords being added to a queue, removes them and passes them to a list of handlers for processing. - + :param record: The queue to listen to. :param handlers: The handlers to invoke on everything received from the queue. @@ -126,7 +126,7 @@ class QueueListener(object): The base implementation uses :meth:`~queue.Queue.get`. You may want to override this method if you want to use timeouts or work with custom queue implementations. - + :param block: Whether to block if the queue is empty. If `False` and the queue is empty, an :class:`~queue.Empty` exception will be thrown. @@ -151,7 +151,7 @@ class QueueListener(object): This method 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. - + :param record: The record to prepare. """ return record @@ -222,4 +222,3 @@ class QueueListener(object): self.enqueue_sentinel() self._thread.join() self._thread = None - |