--
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+unsubscribe@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/5cf29e82-19d7-4567-b537-21a77faf88a9%40googlegroups.com.
My general policy is that warnings should only be logged if there is a good way to silence them. A good way means:
1) fix the bug which is causing them (only applies if there is genuinely a bug or bad practice that should be fixed)
2) disable the warning in a fine tuned way i.e. you can indicate, without much work or hackiness, *this* instance generating the warning is actually fine.
Otherwise, these warnings are useless or worse - people often:
* just turn off all warnings of this type because they are too noisy (so they become useless)
* or end up turning off even more than necessary (hurting the project)
* or miss genuine issues because of the noise.
It sounds like these warnings are of the unhelpful kind.
For implementing option 2, the only thing I could think of is extending the template syntax with something that indicates you are expecting the value to be missing e.g.:
{% if foo? %}
{{ foo? }}
This would clearly be a big change though.
Luke
--
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-develop...@googlegroups.com.
To post to this group, send email to django-d...@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/a428f373-ef0c-4575-8a84-69a4beda154c%40googlegroups.com.
On Thursday 16 March 2017 12:03:07 Tim Graham wrote:
> Ticket #18773 [0] added logging of undefined template variables in
> Django 1.9 [1], however, I've seen several reports of users finding
> this logging more confusing than helpful.
With channels hitting 2.0 and the already large stack of moving parts surrounding Django you need some basic system administration skills and programming experience to work with the system. And there are quite a few examples to link to from the user's list that deal with those moving parts rather then Django itself. It is not an application that you download, install and run.
An introduction "What you need to know before starting Django" would help a lot in this respect and explaining the noisiness of some logging belongs in there.
Because it *is* useful if you defined that variable to True in your settings, and it's working in all projects but this one. It could be there's an extra piece of context middleware that uses the same name and deletes the variable from the context. It could be there's a Mixin missing in the view hierarchy. Or a typo you don't notice anymore after plowing through 20+ included template bits.
Noisy logging is exactly what you want when debugging. It should log things that may be working as designed, especially things that are ambiguous (like undefined and false).
Another thing is that logging is the ugly duckling of Django. It's not mentioned much if at all in the tutorial. It is not mentioned at all in "How to write reusable apps" and it shows in the eco system. It's like finding a diamond when an app actually has logging implemented.
But it also means that novice users touching the LOGGING configuration are exceptions and I don't think Django should cater to the exceptions.
--
Melvyn Sopacua
--
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+unsubscribe@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/80fafa13-ef3b-4b8c-9376-cc63b1776cb8%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f7636989-c87e-4e63-955c-94fb3a14bc78%40googlegroups.com.