[Python-Dev] Change to logging Formatters: support for alternative format styles

R. David Murray rdmurray at bitdance.com
Sun Oct 31 16:54:26 CET 2010


On Sun, 31 Oct 2010 14:55:34 -0000, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Olemis Lang <olemis <at> gmail.com> writes:
> > On Fri, Oct 29, 2010 at 10:07 AM, Barry Warsaw <barry <at> python.org> wrote:
> > > I haven't played with it yet, but do you think it makes sense to add a
> > > 'style' keyword argument to basicConfig()?  That would make it pretty easy
> > > to get the formatting style you want without having to explicitly
> > > instantiate a Formatter, at least for simple logging clients.
> > >
> >
> > Since this may be considered as a little sophisticated, I'd rather
> > prefer these new classes to be added to configuration sections using
> > fileConfig (and default behavior if missing), and still leave
> > `basicConfig` unchanged (i.e. *basic*) .
> >
> 
> Actually it's no biggie to have an optional style argument for basicConfig.
> People who don't use it don't have to specify it; the style argument would only
> apply if format was specified.
> 
> For some people, use of {} over % is more about personal taste than about the
> actual usage of str.format's flexibility; we may as well accommodate that
> preference, as it encourages in a small way the use of {}-formatting.

+1

--
R. David Murray                                      www.bitdance.com


More information about the Python-Dev mailing list