Skip to content
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

gh-89087: Update logging.QueueHandler documentation to clarify record… (GH-96527) #96527

Merged
merged 1 commit into from
Sep 3, 2022
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
14 changes: 14 additions & 0 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,20 @@ possible, while any potentially slow operations (such as sending an email via
the record to a dict or JSON string, or send a modified copy
of the record while leaving the original intact.

.. note:: The base implementation formats the message with arguments, sets
the ``message`` and ``msg`` attributes to the formatted message and
sets the ``args`` and ``exc_text`` attributes to ``None`` to allow
pickling and to prevent further attempts at formatting. This means
that a handler on the :class:`QueueListener` side won't have the
information to do custom formatting, e.g. of exceptions. You may wish
to subclass ``QueueHandler`` and override this method to e.g. avoid
setting ``exc_text`` to ``None``. Note that the ``message`` / ``msg``
/ ``args`` changes are related to ensuring the record is pickleable,
and you might or might not be able to avoid doing that depending on
whether your ``args`` are pickleable. (Note that you may have to
consider not only your own code but also code in any libraries that
you use.)

.. method:: enqueue(record)

Enqueues the record on the queue using ``put_nowait()``; you may
Expand Down