Skip to content

Commit

Permalink
Errors while rendering templates no longer log the generated code.
Browse files Browse the repository at this point in the history
Now that stack traces have source line info, the full code is hopefully
unnecessary (and if it is needed, this isn't the best way to get it).
Syntax errors in the generated code will still dump the whole thing
to the log.
  • Loading branch information
bdarnell committed Sep 9, 2012
1 parent ba0b9d4 commit 97d6423
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tornado/template.py
Expand Up @@ -257,12 +257,7 @@ def generate(self, **kwargs):
# we've generated a new template (mainly for this module's
# unittests, where different tests reuse the same name).
linecache.clearcache()
try:
return execute()
except Exception:
formatted_code = _format_code(self.code).rstrip()
app_log.error("%s code:\n%s", self.name, formatted_code)
raise
return execute()

def _generate_python(self, loader, compress_whitespace):
buffer = cStringIO.StringIO()
Expand Down

0 comments on commit 97d6423

Please sign in to comment.