[Python-Dev] PEP 282 Implementation

Guido van Rossum guido@python.org
Mon, 23 Sep 2002 21:12:34 -0400


> > I would feel much less strongly about this if several of the
> > additional things could be moved to separate files without making it a
> > package.
> >
> [stuff snipped]
> 
> > This is an example of something that I'd like to see relegated to a
> > separate file.  It really looks like fileConfig(), listen() and
> > stopListening() are a separate feature bundle that looks like it is
> > a specific example application rather than a core feature of the
> > logging module.  It certainly doesn't appear in PEP 282.  Maybe the
> > socket handler classes belong in the same category.
> >
> > Of course, the same can be said about all Handler subclasses except
> > StreamHandler.  Only StreamHandler is referenced by basicConfig().
> > Perhaps these should all (except StreamHandler) be moved to separate
> > files?  This sounds like a reason to make it a package.  The main
> > logging code could be in the __init__.py file -- there's no rule that
> > says __init__.py should be empty or short!
> 
> How about this suggestion? We could leave the core code in the
> existing module, "logging". This would include a minimal set of
> handlers, and all the Filters, and I think StreamHandler and
> FileHandler should be in here. All other handlers would live in
> "logging.handlers". As for configuration - basicConfig() could live
> in "logging" and any other configuration code in "logging.config".

Sounds good to me.  I hope that whoever felt strongly about this
(Martin von Loewis?) agrees.

> If the above seems a good idea, please let me know and I'll refactor
> accordingly - then the next release will (hopefully) be in the next
> 2-3 weeks.
> 
> > PS. In your comments you seem fond of the word "needful".  I've rarely
> > heard that word -- perhaps it is archaic or common only in India?
> 
> I only found 2 uses of "needful" - in BufferingHandler and
> ConfigStreamHandler. It's the whole phrase "do the needful", which I
> think  is  peculiar to England but  has  its share  of  users on the
> subcontinent :-)

Oh well.  Shows how Americanized I am, despite my thoroughly European
upbringing, after 7 years here. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)