[issue33897] Add a restart option to logging.basicConfig()

Raymond Hettinger report at bugs.python.org
Mon Jun 18 16:39:17 EDT 2018


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

Once a logger or basicConfig() has been called, later calls to basicConfig() are silent ignored.  The makes it very difficult to experiment with or teach the various options at the interactive prompt or in a Jupyter notebook.

What we have:

    >>> import logging
    >>> logging.warning('Too much data')
    WARNING:root:Too much data
    >>> logging.info('Volume is at 80%')
    >>> logging.basicConfig(level=logging.INFO)
    >>> logging.info('Volume is at 80%')
    >>> # Note, no output was created

What we need:

    >>> import logging
    >>> logging.warning('Too much data')
    WARNING:root:Too much data
    >>> logging.info('Volume is at 80%')
    >>> logging.basicConfig(level=logging.INFO, restart=True)
    >>> logging.info('Volume is at 80%')
    INFO:rootVolume is at 80%

----------
assignee: vinay.sajip
components: Library (Lib)
messages: 319911
nosy: rhettinger, vinay.sajip
priority: normal
severity: normal
status: open
title: Add a restart option to logging.basicConfig()
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33897>
_______________________________________


More information about the Python-bugs-list mailing list