Hi Ivan,

> On Sep 8, 2016, at 9:00 PM, Ivan Sagalaev <man...@softwaremaniacs.org> wrote:
> 
> Actually… I'm failing to imagine a scenario where such a change would lead to 
> any bad things:

You may be right, but it's hard to evaluate that without knowing precisely what 
change you are envisioning. Can you be more specific about exactly what change 
you propose?

It sounds like you are maybe proposing to decide whether to pre-initialize 
logging with the built-in default config or not based on whether the user's 
LOGGING setting has disable_existing_loggers set to True or False? I think that 
would have the backwards-compatibility properties you outline below, but it 
doesn't seem to me that it arrives at a very satisfying end result; the system 
becomes if anything more complex and harder to explain than it is now. 

I think the best end result would be one where LOGGING simply defines the full 
config and it is always applied (by Django) exactly once, and the defaults we 
want are set as the global default for LOGGING, and just documented so that 
people who want to set LOGGING themselves can easily copy them as a starting 
point. But we'll need some kind of deprecation path to get there, at least for 
people who currently have disable_existing_loggers=False, in order to prevent 
them from suddenly losing the default config. 

Carl

> - If `disable_existing_loggers` is True, the incompatibility would manifest 
> itself in Django loggers not being silenced, provided the user has defined a 
> root logger. Which is probably the intended behavior, and I'm having a hard 
> time imagining someone actually relying on it. Most probably users currently 
> work around it either by doing their own config from scratch, or by 
> redefining Django loggers, both of which will continue working after the 
> change.
> 
> - If `disable_existing_loggers` is explicitly set to False, then we could 
> initialize them as we do now.
> 
> How does that sound?
> 
>> On Tuesday, September 6, 2016 at 5:44:37 PM UTC-7, Carl Meyer wrote:
>> On 09/06/2016 04:57 PM, Ivan Sagalaev wrote: 
>> > I'm 
>> > talking about this function: 
>> > https://github.com/django/django/blob/master/django/utils/log.py#L66 
>> > 
>> > When `LOGGING_CONFIG` isn't explicitly disabled it first unconditionally 
>> > initializes logging with the hard-coded configuration and then applies a 
>> > user one, if present. And the latter can't really neutralize the effect 
>> > of the former. 
>> 
>> FWIW I agree that the current behavior here is broken and should be 
>> fixed. The design seems to be based in an assumption that 
>> `disable_existing_loggers=True` can "undo" the effects of the previous 
>> config, when it can't, and in fact it does something much nastier -- it 
>> silences all previously-created loggers. 
>> 
>> I clearly recall outlining this issue in a Trac ticket at some point 
>> quite a while ago, but I can't seem to find that ticket now. 
>> 
>> Fixing this in a way that doesn't change logging behavior for projects 
>> upgrading from a previous Django version may be tricky, unless we gate 
>> the effect of the change on (yet another) setting. 
>> 
>> Carl
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/78325f82-badf-4e75-9206-be244a8e9cfc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/F00ABFF1-803D-429C-A0B5-0E5E4164D937%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to