[Python-checkins] bpo-37470: Document more clearly the error handling for QueueHandler.emit(). (GH-14532) (GH-14533)

Vinay Sajip webhook-mailer at python.org
Mon Jul 1 15:53:43 EDT 2019


https://github.com/python/cpython/commit/91f9f098fcdb023dbb89d06c8833e89a11cbae4c
commit: 91f9f098fcdb023dbb89d06c8833e89a11cbae4c
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: 2019-07-01T20:53:39+01:00
summary:

bpo-37470: Document more clearly the error handling for QueueHandler.emit(). (GH-14532) (GH-14533)

(cherry picked from commit 0f4e8132820947d93eccf31b9e526b81c6ffa53d)

files:
M Doc/library/logging.handlers.rst

diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index d5944ec87d2d..32919c1a2e29 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -980,7 +980,12 @@ possible, while any potentially slow operations (such as sending an email via
 
    .. method:: emit(record)
 
-      Enqueues the result of preparing the LogRecord.
+      Enqueues the result of preparing the LogRecord. Should an exception
+      occur (e.g. because a bounded queue has filled up), the
+      :meth:`~logging.Handler.handleError` method is called to handle the
+      error. This can result in the record silently being dropped (if
+      :attr:`logging.raiseExceptions` is ``False``) or a message printed to
+      ``sys.stderr`` (if :attr:`logging.raiseExceptions` is ``True``).
 
    .. method:: prepare(record)
 



More information about the Python-checkins mailing list