[Python-Dev] A new way to configure logging

Olemis Lang olemis at gmail.com
Thu Oct 8 16:26:17 CEST 2009

On Thu, Oct 8, 2009 at 2:44 AM, Glenn Linderman <v+python at g.nevcal.com> wrote:
> On approximately 10/7/2009 10:45 PM, came the following characters from the
> keyboard of Vinay Sajip:
>> Glenn Linderman <v+python <at> g.nevcal.com> writes:
>>> But DictConfigurator the name seems misleading... like you are
>>> configuring how dicts work, rather than how logs work.  Maybe with more
>>> context this is not a problem, but if it is a standalone class, it is
>>> confusing what it does, by name alone.
>> Of course the fully qualified name would be
>> logging.config.DictConfigurator
>> which does provide the requisite context, but if I think of/someone
>> suggests a
>> better name I'll certainly use it.
> In thinking more about this, I guess I would have the same comment about the
> existing fileConfig() API also... it isn't file that is being configured,
> but the logs.  readConfigFromFile would have been more descriptive (and lots
> longer :( ).

cfgFromIni | cfgFromFile ? I prefer the former because YAML, shelves,
JSON & Co can also be stored in a file , so at least I get a better
understanding of the format in use. Otherwise I'd had to read the docs
or figure out which one

> Had fileConfig been called "bulkConfig" or "configAll" (these names attempt
> to contrast the function of this API versus the individual APIs that
> configure one thing at a time) taking a file parameter, then it could just
> simply/suddenly also allow a dict parameter, and no new API would have to be
> created.  Too late for this, however, and with the new API, it would be
> possible to deprecate the fileConfig API, and tell the user to use the
> ConfigParser (or JSON or YAML or whatever) to create the dict, and then pass
> that to DictConfigurator (or bulkConfig or whatever).

similar and consistent with what I mentioned before but IMO fileConfig
should remain for backwards compatibility

Objections ?



Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Looking for a technique to create flexible, graphical dashboards ...
- http://feedproxy.google.com/~r/TracGViz-full/~3/71kRhT34BgU/43789

More information about the Python-Dev mailing list