Skip to content

Commit 6f4928e

Browse files
vsajiplisroach
authored andcommitted
bpo-37469: Document usability of SimpleQueue with QueueHandler and QueueListener. (pythonGH-14521)
1 parent 26f6929 commit 6f4928e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Doc/library/logging.handlers.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,11 @@ possible, while any potentially slow operations (such as sending an email via
992992
.. class:: QueueHandler(queue)
993993

994994
Returns a new instance of the :class:`QueueHandler` class. The instance is
995-
initialized with the queue to send messages to. The queue can be any
996-
queue-like object; it's used as-is by the :meth:`enqueue` method, which needs
997-
to know how to send messages to it.
995+
initialized with the queue to send messages to. The *queue* can be any
996+
queue-like object; it's used as-is by the :meth:`enqueue` method, which
997+
needs to know how to send messages to it. The queue is not *required* to
998+
have the task tracking API, which means that you can use
999+
:class:`~queue.SimpleQueue` instances for *queue*.
9981000

9991001

10001002
.. method:: emit(record)
@@ -1050,11 +1052,14 @@ possible, while any potentially slow operations (such as sending an email via
10501052
initialized with the queue to send messages to and a list of handlers which
10511053
will handle entries placed on the queue. The queue can be any queue-like
10521054
object; it's passed as-is to the :meth:`dequeue` method, which needs
1053-
to know how to get messages from it. If ``respect_handler_level`` is ``True``,
1054-
a handler's level is respected (compared with the level for the message) when
1055-
deciding whether to pass messages to that handler; otherwise, the behaviour
1056-
is as in previous Python versions - to always pass each message to each
1057-
handler.
1055+
to know how to get messages from it. The queue is not *required* to have the
1056+
task tracking API (though it's used if available), which means that you can
1057+
use :class:`~queue.SimpleQueue` instances for *queue*.
1058+
1059+
If ``respect_handler_level`` is ``True``, a handler's level is respected
1060+
(compared with the level for the message) when deciding whether to pass
1061+
messages to that handler; otherwise, the behaviour is as in previous Python
1062+
versions - to always pass each message to each handler.
10581063

10591064
.. versionchanged:: 3.5
10601065
The ``respect_handler_levels`` argument was added.

0 commit comments

Comments
 (0)