diff options
author | Nicolas Haller <nicolas@haller.im> | 2022-05-23 19:18:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 19:18:43 (GMT) |
commit | 2176898308acafedf87a48d33f29645e79b9af86 (patch) | |
tree | c5873337dde572226777a1e48e57b73e57f3e717 /Doc/howto | |
parent | c1f5c903a7e4ed27190488f4e33b00d3c3d952e5 (diff) | |
download | cpython-2176898308acafedf87a48d33f29645e79b9af86.zip cpython-2176898308acafedf87a48d33f29645e79b9af86.tar.gz cpython-2176898308acafedf87a48d33f29645e79b9af86.tar.bz2 |
gh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063)
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/logging.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index 4d76c27..9340062 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -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, |