mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137
This commit is contained in:
parent
2fa3761ec9
commit
e50b9d8ac1
15 changed files with 140 additions and 111 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue