mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873)
This commit is contained in:
parent
2af9f5d334
commit
cf67d6a934
4 changed files with 46 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue