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

2010-11-01 Thread Olemis Lang
On Sun, Oct 31, 2010 at 9:55 AM, Vinay Sajip vinay_sa...@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

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

2010-11-01 Thread Vinay Sajip
Olemis Lang olemis at gmail.com writes: For some people, use of {} over % is more about personal taste than about the actual usage of str.format's flexibility; Thought you were talking about me, you only needed to say «he has black hair and blue eyes» ... ;o) No, it was a general

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

2010-10-31 Thread Vinay Sajip
Eric Smith eric at trueblade.com writes: I keep meaning to review this but haven't had time. One thing I want to look at specifically is the ability to put the time formatting into the str.format version of the format string. Now that the time format specifier can be included in the format

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

2010-10-31 Thread Vinay Sajip
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

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

2010-10-31 Thread R. David Murray
On Sun, 31 Oct 2010 14:55:34 -, Vinay Sajip vinay_sa...@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

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

2010-10-29 Thread Barry Warsaw
On Oct 25, 2010, at 02:28 PM, Vinay Sajip wrote: I've just checked in a change to logging into the py3k branch (r85835), including doc changes and tests, for providing slightly more flexibility in alternative format styles for logging. Basically, Formatter.__init__ gets an extra optional keyword

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

2010-10-29 Thread Olemis Lang
On Tue, Oct 26, 2010 at 6:15 AM, Nick Coghlan ncogh...@gmail.com wrote: On Tue, Oct 26, 2010 at 9:08 PM, Nick Coghlan ncogh...@gmail.com wrote: On Tue, Oct 26, 2010 at 12:28 AM, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Comments welcome. Assuming there are no strong objections asking for

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

2010-10-29 Thread Olemis Lang
On Fri, Oct 29, 2010 at 10:07 AM, Barry Warsaw ba...@python.org wrote: On Oct 25, 2010, at 02:28 PM, Vinay Sajip wrote: I've just checked in a change to logging into the py3k branch (r85835), including doc changes and tests, for providing slightly more flexibility in alternative format styles

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

2010-10-29 Thread Eric Smith
On 10/26/10 7:08 AM, Nick Coghlan wrote: On Tue, Oct 26, 2010 at 12:28 AM, Vinay Sajipvinay_sa...@yahoo.co.uk wrote: Comments welcome. Assuming there are no strong objections asking for reversion of this change, I'll publicise to the wider community in a few days. It strikes me as a solid,

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

2010-10-26 Thread Nick Coghlan
On Tue, Oct 26, 2010 at 12:28 AM, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Comments welcome. Assuming there are no strong objections asking for reversion of this change, I'll publicise to the wider community in a few days. It strikes me as a solid, pragmatic solution to a thorny problem.

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

2010-10-26 Thread Nick Coghlan
On Tue, Oct 26, 2010 at 9:08 PM, Nick Coghlan ncogh...@gmail.com wrote: On Tue, Oct 26, 2010 at 12:28 AM, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Comments welcome. Assuming there are no strong objections asking for reversion of this change, I'll publicise to the wider community in a few

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

2010-10-26 Thread Boštjan Mejak
Line 31 (in Pastebin): _STYLE_CODES = tuple(% { $.split()) Is this really necessary? Why not _STYLE_CODES = ('%', '{', '$') On Tue, Oct 26, 2010 at 1:15 PM, Nick Coghlan ncogh...@gmail.com wrote: On Tue, Oct 26, 2010 at 9:08 PM, Nick Coghlan ncogh...@gmail.com wrote: On Tue, Oct 26, 2010 at

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

2010-10-26 Thread Vinay Sajip
Nick Coghlan ncoghlan at gmail.com writes: Looking at your checkin though, I wonder if it might be worth implementing some little formatting style classes to get rid of the if/elif chains from the Formatter code. Something like: Fair comment: I did think about the messiness of that if/elif,

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

2010-10-25 Thread Vinay Sajip
I've just checked in a change to logging into the py3k branch (r85835), including doc changes and tests, for providing slightly more flexibility in alternative format styles for logging. Basically, Formatter.__init__ gets an extra optional keyword arg style=one of '%' (default), '{' or '$'. This