Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137

This commit is contained in:
spf13 2014-03-31 13:23:34 -04:00
parent 2fa3761ec9
commit e50b9d8ac1
15 changed files with 140 additions and 111 deletions

View file

@ -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()
}