robfig / soy

Go implementation for Soy templates (Google Closure templates)
MIT License
172 stars 41 forks source link

{log} causes panic() if no logger installed #50

Closed mhupman closed 7 years ago

mhupman commented 7 years ago

Using the log statement will cause a render error if soyhtml.Logger isn't set to a non-nil value. Since logging might be runtime/environment specific, would it make sense to swallow the result of a log block evaluation?

{log}{[][0]}{/log}

The above would still crash to avoid issues "lurking" inside dormant log blocks.

robfig commented 7 years ago

Sounds good to me