From e50b9d8ac1c69aa16cf45b1e4ff95b22d535adb7 Mon Sep 17 00:00:00 2001 From: spf13 Date: Mon, 31 Mar 2014 13:23:34 -0400 Subject: Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137 --- hugolib/shortcode.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'hugolib/shortcode.go') diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index bea89fe2a..92e81195e 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -15,15 +15,14 @@ package hugolib import ( "bytes" - "fmt" - "github.com/spf13/hugo/template/bundle" "html/template" "reflect" "strings" "unicode" -) -var _ = fmt.Println + "github.com/spf13/hugo/template/bundle" + jww "github.com/spf13/jwalterweatherman" +) type ShortcodeFunc func([]string) string @@ -296,8 +295,8 @@ func ShortcodeRender(tmpl *template.Template, data *ShortcodeWithPage) string { buffer := new(bytes.Buffer) err := tmpl.Execute(buffer, data) if err != nil { - fmt.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err) - fmt.Println(data) + jww.ERROR.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err) + jww.WARN.Println(data) } return buffer.String() } -- cgit v1.2.3