hugolib: Improve shortcode error message
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 9 May 2017 16:37:43 +0000 (18:37 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 9 May 2017 16:43:48 +0000 (18:43 +0200)
hugolib/shortcode.go

index 01beffe2bea214edbf2cfaf5360e8c34483cf607..b088ed61d9f46aca530fe5847a7c10f64fef4310 100644 (file)
@@ -586,8 +586,7 @@ func renderShortcodeWithPage(tmpl tpl.Template, data *ShortcodeWithPage) string
        err := tmpl.Execute(buffer, data)
        isInnerShortcodeCache.RUnlock()
        if err != nil {
-               data.Page.s.Log.ERROR.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err)
-               data.Page.s.Log.WARN.Println(data)
+               data.Page.s.Log.ERROR.Printf("error processing shortcode %q for page %q: %s", tmpl.Name(), data.Page.Path(), err)
        }
        return buffer.String()
 }