[Python-Dev] Using logging in the stdlib and its unit tests

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Dec 10 23:16:39 CET 2010


Antoine Pitrou <solipsis <at> pitrou.net> writes:

> Guido van Rossum <guido <at> python.org> wrote:
> > And yet, I have helped many people who were baffled by exactly what
> > Bill observed: logging.info() didn't do anything. Maybe the default
> > should be INFO?
> 
> Funny, because displaying only errors and silencing other messages is
> exactly what I expected logging to do by default.

The one thing I'm sure of is that it's hard to find more than a couple of
people with the same view about what the default should be. Anyone for
bikesheds? :-)

IMO as long as it's just a small amount of work to get the specific effect
that you want, it doesn't really matter too much what the default is - though
of course I'd like it to be "right", whatever that means ;-) And whatever it
is, it's going to upset *some* group of people because they have to add one
line (or so) to get it to do what they want, and they feel really strongly
that they shouldn't have to add that one line. In a way, I suppose I'm not
unhappy that this is all we're arguing about and not anything more
substantive. Some useful feedback about the documentation has emerged, too. I
would (naturally) like to see broader adoption of logging in the standard
library, and the view from Python core developers who have expressed opinions
on this thread seems to be that the present behaviour is an obstacle to that
adoption. I have my views but I'm not hidebound by them, hence the proposed
change and the posting about it on the logging blog and c.l.py, just to let
people know what's coming.

It'll be interesting to see, once this change is implemented, whether the
suggested obstacle really has been an obstacle, rather than (as I suspect)
the low level of logging adoption in the stdlib being largely being a matter
of plain inertia. But even if it helps make possible a better resolution of
#10626 (as an archetype of unraisable-exception scenarios), that would be a
good outcome.

Regards,

Vinay Sajip



More information about the Python-Dev mailing list