shithub: hugo

Download patch

ref: 0406be3d547749b93dd4fd13e142982915b6ca1f
parent: 89e31256649aeddec945a2d6dc73478f9a1ce0b8
author: Bjørn Erik Pedersen <[email protected]>
date: Tue Oct 25 18:56:44 EDT 2016

Add missing template error logging

--- a/hugolib/hugo_sites_test.go
+++ b/hugolib/hugo_sites_test.go
@@ -17,7 +17,6 @@
 	"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 @@
 
 func init() {
 	testCommonResetState()
-	jww.SetStdoutThreshold(jww.LevelCritical)
 }
 
 func testCommonResetState() {
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -33,11 +33,6 @@
 	"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
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -460,7 +460,9 @@
 				}
 			}
 
-			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