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

Glenn Linderman v+python at g.nevcal.com
Fri Dec 10 09:31:23 CET 2010


On 12/10/2010 12:06 AM, Vinay Sajip wrote:
>> >  This simplistic easy usage somewhat echo's Glenn's comment on this thread
> about logging seeming way to daunting as presented today.  It needn't be.
>> >  
> Indeed, and the very first code sample in the logging documentation shows
> exactly the simplistic easy usage you're talking about. I can't see why anyone
> would be scared off by that example.

It didn't scare me off.  But it wasn't _quite_ comprehensive enough to 
keep me from being put off by the next bit of manual, (about 8%, as 
mentioned before), which had lots of discussion, but no more examples, 
so what is lacking up front is a few more examples of using the 
convenience methods as Greg apparently does, without configuration, but 
showing use in multiple modules.  After it is shown to be simple to get 
started in a multi-module code base, then all the refinements can be 
explained and added, but by then people are already using the logger, 
and learning becomes incremental.

Otherwise, people are scared off or put off by the need to learn lots of 
new terms (logger, filter, handler, formatter, and configuration) before 
they get any value out of it.

The next thing after the simple example is a rotating log 
configuration.  A handy feature, of course, but hardly the second thing 
that one needs to learn about logging.  Maybe the 4th or 5th or later.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20101210/1b4891f2/attachment.html>


More information about the Python-Dev mailing list