Skip to content

[3.8] bpo-37469: Document usability of SimpleQueue with QueueHandler and QueueListener. (GH-14521) #14525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,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)
Expand Down Expand Up @@ -1029,11 +1031,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.
Expand Down