[New-bugs-announce] [issue16110] Provide logging.config.configParserConfig

thbach report at bugs.python.org
Tue Oct 2 17:27:11 CEST 2012


New submission from thbach:

Currently logging.config provides a fileConfig function which reads a ini-style file via configparser.ConfigParser. I would like to have a function e.g. configParserConfig which accepts a ConfigParser instance and configures logging directly from the settings found in there. The main reasons for this are:

1) I think it is rather common for an application that provides an interface to configure its logging via an ini file to use this ini file also for further application configuration. With the current implementation the file is read twice and ConfigParser is initialized two times.

2) Currently it is not idiomatic how to alter an ini-file configuration e.g. by options passed in via command-line. The new function provides a clear solution: create a ConfigParser instance, parse the ini file, alter the configuration and pass it on to logging.config.configParserConfig.

In fact, the new functionality is easy to achieve by refactoring logging.config a bit (see attached patch).

----------
components: Library (Lib)
files: configParserConfig.patch
keywords: patch
messages: 171812
nosy: thbach
priority: normal
severity: normal
status: open
title: Provide logging.config.configParserConfig
Added file: http://bugs.python.org/file27386/configParserConfig.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16110>
_______________________________________


More information about the New-bugs-announce mailing list