bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873)

This commit is contained in:
Dong-hee Na 2018-06-25 13:11:09 +09:00 committed by Vinay Sajip
parent 2af9f5d334
commit cf67d6a934
4 changed files with 46 additions and 3 deletions

View file

@ -1131,7 +1131,7 @@ functions.
if no handlers are defined for the root logger.
This function does nothing if the root logger already has handlers
configured for it.
configured, unless the keyword argument *force* is set to ``True``.
.. note:: This function should be called from the main thread
before other threads are started. In versions of Python prior to
@ -1183,6 +1183,15 @@ functions.
| | with 'filename' or 'stream' - if both are |
| | present, a ``ValueError`` is raised. |
+--------------+---------------------------------------------+
| ``force`` | If this keyword argument is specified as |
| | true, any existing handlers attached to the |
| | root logger are removed and closed, before |
| | carrying out the configuration as specified |
| | by the other arguments. |
+--------------+---------------------------------------------+
.. versionchanged:: 3.8
The ``force`` argument was added.
.. versionchanged:: 3.2
The ``style`` argument was added.