]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44473: Update docstring and documentation for QueueHandler.prepar… (GH-27140)
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 15 Jul 2021 00:06:48 +0000 (01:06 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Jul 2021 00:06:48 +0000 (17:06 -0700)
…e().

Doc/library/logging.handlers.rst
Lib/logging/handlers.py

index 059ab3d3a34448d41a7ef4ef171b8bc5bc94361e..7fe9a98df82b1e61790a6c5e92a305c679b99e5f 100644 (file)
@@ -1014,8 +1014,12 @@ possible, while any potentially slow operations (such as sending an email via
       method is enqueued.
 
       The base implementation formats the record to merge the message,
-      arguments, and exception information, if present.  It also
-      removes unpickleable items from the record in-place.
+      arguments, and exception information, if present.  It also removes
+      unpickleable items from the record in-place. Specifically, it overwrites
+      the record's :attr:`msg` and :attr:`message` attributes with the merged
+      message (obtained by calling the handler's :meth:`format` method), and
+      sets the :attr:`args`, :attr:`exc_info` and :attr:`exc_text` attributes
+      to ``None``.
 
       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
index b0d5885989ea426b2870dea71ee9a08df2282480..e933f1b8f7ac8513b902c20dd5f43ae8c6d93d7d 100644 (file)
@@ -1399,12 +1399,15 @@ class QueueHandler(logging.Handler):
 
     def prepare(self, record):
         """
-        Prepares a record for queuing. The object returned by this method is
+        Prepare a record for queuing. The object returned by this method is
         enqueued.
 
-        The base implementation formats the record to merge the message
-        and arguments, and removes unpickleable items from the record
-        in-place.
+        The base implementation formats the record to merge the message and
+        arguments, and removes unpickleable items from the record in-place.
+        Specifically, it overwrites the record's `msg` and
+        `message` attributes with the merged message (obtained by
+        calling the handler's `format` method), and sets the `args`,
+        `exc_info` and `exc_text` attributes to None.
 
         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