summaryrefslogtreecommitdiffstats
path: root/Doc/library/logging.handlers.rst
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2019-07-01 17:45:07 (GMT)
committerGitHub <noreply@github.com>2019-07-01 17:45:07 (GMT)
commite6b64b756f940147728ea7808fb686ffcae89176 (patch)
tree770fc29023fcc9bc26de20c6def76a6d2ced0fd3 /Doc/library/logging.handlers.rst
parent36242fd871d0f0977e720d4fae5700774bd8c09a (diff)
downloadcpython-e6b64b756f940147728ea7808fb686ffcae89176.zip
cpython-e6b64b756f940147728ea7808fb686ffcae89176.tar.gz
cpython-e6b64b756f940147728ea7808fb686ffcae89176.tar.bz2
bpo-37469: Document usability of SimpleQueue with QueueHandler and QueueListener. (GH-14521)
Diffstat (limited to 'Doc/library/logging.handlers.rst')
-rw-r--r--Doc/library/logging.handlers.rst21
1 files changed, 13 insertions, 8 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index df5bfef..592d7e5 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -992,9 +992,11 @@ possible, while any potentially slow operations (such as sending an email via
.. class:: QueueHandler(queue)
Returns a new instance of the :class:`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 :meth:`enqueue` method, which needs
- to know how to send messages to it.
+ initialized with the queue to send messages to. The *queue* can be any
+ queue-like object; it's used as-is by the :meth:`enqueue` method, which
+ needs to know how to send messages to it. The queue is not *required* to
+ have the task tracking API, which means that you can use
+ :class:`~queue.SimpleQueue` instances for *queue*.
.. method:: emit(record)
@@ -1050,11 +1052,14 @@ possible, while any potentially slow operations (such as sending an email via
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 :meth:`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 the message) when
- deciding whether to pass messages to that handler; otherwise, the behaviour
- is as in previous Python versions - to always pass each message to each
- handler.
+ to know how to get messages from it. The queue is not *required* to have the
+ task tracking API (though it's used if available), which means that you can
+ use :class:`~queue.SimpleQueue` instances for *queue*.
+
+ If ``respect_handler_level`` is ``True``, a handler's level is respected
+ (compared with the level for the message) when deciding whether to pass
+ messages to that handler; otherwise, the behaviour is as in previous Python
+ versions - to always pass each message to each handler.
.. versionchanged:: 3.5
The ``respect_handler_levels`` argument was added.