mirror of
https://github.com/python/cpython.git
synced 2025-08-18 15:51:23 +00:00
gh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063) (GH-93151)
(cherry picked from commit 2176898308
)
This commit is contained in:
parent
f0950585a3
commit
cea65730a7
2 changed files with 13 additions and 4 deletions
|
@ -178,10 +178,11 @@ following example::
|
|||
raise ValueError('Invalid log level: %s' % loglevel)
|
||||
logging.basicConfig(level=numeric_level, ...)
|
||||
|
||||
The call to :func:`basicConfig` should come *before* any calls to :func:`debug`,
|
||||
:func:`info` etc. As it's intended as a one-off simple configuration facility,
|
||||
only the first call will actually do anything: subsequent calls are effectively
|
||||
no-ops.
|
||||
The call to :func:`basicConfig` should come *before* any calls to
|
||||
:func:`debug`, :func:`info`, etc. Otherwise, those functions will call
|
||||
:func:`basicConfig` for you with the default options. As it's intended as a
|
||||
one-off simple configuration facility, only the first call will actually do
|
||||
anything: subsequent calls are effectively no-ops.
|
||||
|
||||
If you run the above script several times, the messages from successive runs
|
||||
are appended to the file *example.log*. If you want each run to start afresh,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue