This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients vinay.sajip, wdoekes
Date 2014-12-08.23:20:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418080850.64.0.869398799215.issue23010@psf.upfronthosting.co.za>
In-reply-to
Content
The delay= is not really a workaround for this particular circumstance, it's mainly there to avoid leaving empty files around and allocating resources that might never be used (which is analogous to this issue, but delay was not implemented to work around this specific scenario).

The handlers are AFAIK referenced - if you peek at logging._handlerList or logging._handlers you should see them in there.

A config dictionary is not judged as being illegal just because it contains unused handlers - you just happen to allocate resource that you never use. You could just leave out the handlers, since you're never using them; it's not logging's job to be overly restrictive about this sort of thing. Python doesn't warn you for allocating a dictionary that you never populate, or if you populate a dictionary that you then never interrogate. The type of unnecessary allocation of resources you're talking about happens a lot in programs - in fact, it also applies to loggers, since you might never use them in a specific program run, because of which code gets run based on command-line arguments, or with handlers that are "used" (in the sens you mean here, because they are linked to loggers), but never *actually* used because the levels in the configuration are set to CRITICAL, and there are no .critical() calls encountered during a program run. I'm not sure a line can usefully be drawn regarding "useless" allocations.
History
Date User Action Args
2014-12-08 23:20:50vinay.sajipsetrecipients: + vinay.sajip, wdoekes
2014-12-08 23:20:50vinay.sajipsetmessageid: <1418080850.64.0.869398799215.issue23010@psf.upfronthosting.co.za>
2014-12-08 23:20:50vinay.sajiplinkissue23010 messages
2014-12-08 23:20:50vinay.sajipcreate