﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18773	Enable optional logging of invalid variable lookups	wrigley	Caroline Simpson	"Adding something like
{{{
# django/template/base.py
if getattr(settings,'TEMPLATE_LOG_IF_INVALID', False):
    logging.getLogger(settings.TEMPLATE_LOG_IF_INVALID).debug(
        ""Failed lookup for key in [%s] in %r"" %(bit,current))
}}} 
around line 763, or whenever the silent_variable_failure is tested or something, would be awesome! That way there would be an easy way to check for invalid variables in the templates without compromising neither adminpages, layout or page reliability.

Then you could use something like:
{{{
# settings.py
TEMPLATE_LOG_IF_INVALID = 'invalid_log'

LOGGING = {
    'version': 1,
    'handlers': {
        'console': {
            'class': 'logger.StreamHandler',
            'level': 'DEBUG'
        }
    },
    'loggers': {
        'invalid_log': {
            'handlers': 'console',
            'level': 'DEBUG'
        }
    }
}
}}}
a loglevel of WARNING might be more appropriate, but I'll leave that decision up to you guys, seeing as I am new to django and don't know neither the code base nor the conventions too well yet.

Cheers,
/J"	New feature	closed	Template system	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
