On Tue, Dec 28, 2010 at 1:29 AM, Vinay Sajip <vinay_sa...@yahoo.co.uk> wrote:
>     However, it would be good to have some consistency of naming stdlib 
> loggers
> - perhaps using __name__ as is recommended practice for library and 
> application
> developers, but with a prefix such as "py." to indicate that it's a part of 
> the
> stdlib. This would make the disabling logic change easier as it could just 
> check
> the "py." prefix rather than have an internal list of logger names, which 
> would
> need more maintenance and be more error-prone.

Unfortunately, the "py" package already claimed that namespace, so it
isn't really free for us to use in the standard library (even the
current "py.warnings" for redirected warnings may be misleading, as it
may give users the impression that package is involved somewhere along
the line). It is probably best just to go with the "__name__"
convention and not worry about being able to draw a clean distinction
between "standard library" and "third party" (that distinction doesn't
exist in the module heirarchy, so it isn't really reasonable to expect
it to exist in the logging heirarchy).

However, rather than a manually maintained list of low level loggers,
it may be feasible to just have a flag we can set on loggers that
makes them immune to the default implicit disabling. Then the config
calls can support three levels of logger disabling:
- leave all existing loggers enabled (existing option)
- leave only flagged loggers enabled (new default behaviour)
- disable all loggers not mentioned explicitly (new option)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to