Add missing template error logging
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 25 Oct 2016 20:56:44 +0000 (22:56 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 25 Oct 2016 20:56:44 +0000 (22:56 +0200)
hugolib/hugo_sites_test.go
hugolib/site_test.go
tpl/template.go

index 66c818acf23c30c6f23ecb8fedc78e0d07dc63b0..e14a04cb6aa789c5541381a08073ccb3f5575d5f 100644 (file)
@@ -17,7 +17,6 @@ import (
        "github.com/spf13/hugo/helpers"
        "github.com/spf13/hugo/hugofs"
        "github.com/spf13/hugo/source"
-       jww "github.com/spf13/jwalterweatherman"
        "github.com/spf13/viper"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
@@ -29,7 +28,6 @@ type testSiteConfig struct {
 
 func init() {
        testCommonResetState()
-       jww.SetStdoutThreshold(jww.LevelCritical)
 }
 
 func testCommonResetState() {
index 22c61582847f95fe678a3b9440b6e6b0894837a6..bc43fca0f8cd57151808ec0947ceffc4b8200057 100644 (file)
@@ -33,11 +33,6 @@ import (
        "github.com/stretchr/testify/require"
 )
 
-func init() {
-       //There are expected ERROR logging in tests that produces a lot of noise.
-       jww.SetStdoutThreshold(jww.LevelCritical)
-}
-
 const (
        pageSimpleTitle = `---
 title: simple template
index 0f78fa00fa886515f7110b786e35eea628b55787..a1568b911720e617fdc0c75e1e43e320587ae787 100644 (file)
@@ -460,7 +460,9 @@ func (t *GoHTMLTemplate) loadTemplates(absPath string, prefix string) {
                                }
                        }
 
-                       t.AddTemplateFile(tplName, baseTemplatePath, path)
+                       if err := t.AddTemplateFile(tplName, baseTemplatePath, path); err != nil {
+                               jww.ERROR.Printf("Failed to add template %s: %s", tplName, err)
+                       }
 
                }
                return nil