[Python-checkins] cpython (2.7): Clarified documentation note on module-level convenience functions.

vinay.sajip python-checkins at python.org
Wed Jan 15 14:29:40 CET 2014


http://hg.python.org/cpython/rev/84cf25da86e8
changeset:   88488:84cf25da86e8
branch:      2.7
parent:      88482:74d138cfe564
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Wed Jan 15 13:27:58 2014 +0000
summary:
  Clarified documentation note on module-level convenience functions.

files:
  Doc/library/logging.rst |  17 +++++++++--------
  1 files changed, 9 insertions(+), 8 deletions(-)


diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -852,14 +852,15 @@
    Logs a message with level *level* on the root logger. The other arguments are
    interpreted as for :func:`debug`.
 
-   .. note:: The above module-level functions which delegate to the root
-      logger should *not* be used in threads, in versions of Python earlier
-      than 2.7.1 and 3.2, unless at least one handler has been added to the
-      root logger *before* the threads are started. These convenience functions
-      call :func:`basicConfig` to ensure that at least one handler is
-      available; in earlier versions of Python, this can (under rare
-      circumstances) lead to handlers being added multiple times to the root
-      logger, which can in turn lead to multiple messages for the same event.
+   .. note:: The above module-level convenience functions, which delegate to the
+      root logger, call :func:`basicConfig` to ensure that at least one handler
+      is available. Because of this, they should *not* be used in threads,
+      in versions of Python earlier than 2.7.1 and 3.2, unless at least one
+      handler has been added to the root logger *before* the threads are
+      started. In earlier versions of Python, due to a thread safety shortcoming
+      in :func:`basicConfig`, this can (under rare circumstances) lead to
+      handlers being added multiple times to the root logger, which can in turn
+      lead to multiple messages for the same event.
 
 .. function:: disable(lvl)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list