[Python-Dev] Proposed change to logging.basicConfig

Antoine Pitrou solipsis at pitrou.net
Tue Mar 29 18:41:25 CEST 2011


On Tue, 29 Mar 2011 16:35:08 +0000 (UTC)
Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> I'm planning a change to logging.basicConfig to add an optional "handlers"
> keyword argument which defaults to None.
> 
> If specified, this should be an iterable of already created handlers, which will
> be added to the root logger (if it doesn't already have any handlers). Any
> handler in the iterable which does not have a formatter assigned will be
> assigned the formatter created by basicConfig.
> 
> If "handlers" is specified, the "stream", "filename" and "filemode" arguments
> will be ignored.
> 
> If any of you can see any problems with this change, or can suggest any
> improvement to the approach, please respond.

I'm not a logging expert, but the fact that your description above
mentions at least two instances of special-casing make it sound like
the API has an usability (or learnability) problem.

Regards

Antoine.




More information about the Python-Dev mailing list