Re: [Python-Dev] A new way to configure logging

2009-11-02 Thread Olemis Lang
On Wed, Oct 7, 2009 at 11:26 AM, Olemis Lang wrote: > On Wed, Oct 7, 2009 at 10:49 AM, Vinay Sajip wrote: >> Olemis Lang gmail.com> writes: >> >>> This kind of problems is similar to the one mentioned in another >>> thread about modifying config options after executing commands. In >>> that case

Re: [Python-Dev] A new way to configure logging

2009-10-08 Thread Doug Hellmann
On Oct 7, 2009, at 10:49 AM, Vinay Sajip wrote: All three of the contenders for the title of "commonly found configuration mechanism" - JSON, YAML and Python code - will be expressible, in Python, as Python dicts. So it seems to make sense to add, to logging.config, a new callable bound to

Re: [Python-Dev] A new way to configure logging

2009-10-08 Thread Doug Hellmann
On Oct 8, 2009, at 10:47 AM, Vinay Sajip wrote: I've had bad experiences in the past with dictionary-based APIs. They seem "simpler" in the short run, because the user "only needs to create some dictionaries". Once the complexity of that nested dictionary grows to a certain point, thou

Re: [Python-Dev] A new way to configure logging

2009-10-08 Thread Vinay Sajip
> I've had bad experiences in the past with dictionary-based APIs. They seem > "simpler" in the short run, because the user "only needs to create some > dictionaries". Once the complexity of that nested dictionary grows to a > certain > point, though, one has to refer back to documentation c

Re: [Python-Dev] A new way to configure logging

2009-10-08 Thread Olemis Lang
On Thu, Oct 8, 2009 at 2:44 AM, Glenn Linderman wrote: > On approximately 10/7/2009 10:45 PM, came the following characters from the > keyboard of Vinay Sajip: >> >> Glenn Linderman g.nevcal.com> writes: >> >>> But DictConfigurator the name seems misleading... like you are >>> configuring how dic

Re: [Python-Dev] A new way to configure logging

2009-10-08 Thread Glenn Linderman
On approximately 10/7/2009 10:45 PM, came the following characters from the keyboard of Vinay Sajip: Glenn Linderman 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

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Vinay Sajip
Glenn Linderman 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

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Vinay Sajip
Paul Moore gmail.com> writes: > One option I would have found useful in some code I wrote would be to > extend the configuration - > > class DictConfigurator: >... >def extend(self, moreconfig): > import copy > more = copy.deepcopy(moreconfig) # Not sure if this is needed? >

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Glenn Linderman
On approximately 10/7/2009 7:49 AM, came the following characters from the keyboard of Vinay Sajip: In outline, the scheme I have in mind will look like this, in terms of the new public API: class DictConfigurator: def __init__(self, config): #config is a dict-like object (duck-typed)

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Paul Moore
2009/10/7 Vinay Sajip : > What's the general feeling here about this proposal? All comments and > suggestions will be gratefully received. +1 One option I would have found useful in some code I wrote would be to extend the configuration - class DictConfigurator: ... def extend(self, moreco

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Vinay Sajip
Paul Rudin writes: > How about the global logging configuration being available as an object > supporting the usual dictionary interface? So you could, for example, do > something like: "logging.dictconfig.update(partialconfig)" A "partial configuration" only makes sense under certain limited co

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Olemis Lang
On Wed, Oct 7, 2009 at 11:06 AM, Paul Rudin wrote: > Vinay Sajip writes: > > >> What's the general feeling here about this proposal? All comments and >> suggestions will be gratefully received. >> > > How about the global logging configuration being available as an object > supporting the usual d

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Olemis Lang
On Wed, Oct 7, 2009 at 10:49 AM, Vinay Sajip wrote: > Olemis Lang gmail.com> writes: > >> This kind of problems is similar to the one mentioned in another >> thread about modifying config options after executing commands. In >> that case I mentioned that the same dict-like interface also holds fo

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Paul Rudin
Vinay Sajip writes: > What's the general feeling here about this proposal? All comments and > suggestions will be gratefully received. > How about the global logging configuration being available as an object supporting the usual dictionary interface? So you could, for example, do something lik

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Vinay Sajip
Olemis Lang gmail.com> writes: > This kind of problems is similar to the one mentioned in another > thread about modifying config options after executing commands. In > that case I mentioned that the same dict-like interface also holds for > WinReg and so on ... > > So thinking big (yes ! I have

Re: [Python-Dev] A new way to configure logging

2009-10-07 Thread Olemis Lang
On Wed, Oct 7, 2009 at 9:49 AM, Vinay Sajip wrote: > At present, configuration of Python's logging package can be done in one of > two > ways: > > 1. Create a ConfigParser-readable configuration file and use > logging.config.fileConfig() to read and implement the configuration therein. > 2. Use t

[Python-Dev] A new way to configure logging

2009-10-07 Thread Vinay Sajip
At present, configuration of Python's logging package can be done in one of two ways: 1. Create a ConfigParser-readable configuration file and use logging.config.fileConfig() to read and implement the configuration therein. 2. Use the logging API to programmatically configure logging using getLogg