all: Refactor to non-global logger

Note that this looks like overkill for just the logger, and that is correct,
but this will make sense once we start with the template handling etc.

Updates #2701
This commit is contained in:
Bjørn Erik Pedersen
2017-01-03 17:28:51 +01:00
parent 24a286791f
commit 45e3ed517a
42 changed files with 410 additions and 320 deletions

View File

@@ -33,7 +33,7 @@ import (
// TODO(bep) remove
func pageFromString(in, filename string) (*Page, error) {
return NewPageFrom(strings.NewReader(in), filename)
return pageTestSite.NewPageFrom(strings.NewReader(in), filename)
}
func CheckShortCodeMatch(t *testing.T, input, expected string, withTemplate func(templ tpl.Template) error) {
@@ -83,7 +83,7 @@ title: "Title"
}
func TestShortcodeGoFuzzReports(t *testing.T) {
tem := tpl.New()
tem := tpl.New(logger)
tem.AddInternalShortcode("sc.html", `foo`)
p, _ := pageFromString(simplePage, "simple.md")
@@ -304,7 +304,7 @@ func TestHighlight(t *testing.T) {
viper.Set("pygmentsStyle", "bw")
viper.Set("pygmentsUseClasses", false)
templ := tpl.New()
templ := tpl.New(logger)
code := `
{{< highlight java >}}
@@ -380,7 +380,7 @@ func TestExtractShortcodes(t *testing.T) {
} {
p, _ := pageFromString(simplePage, "simple.md")
tem := tpl.New()
tem := tpl.New(logger)
tem.AddInternalShortcode("tag.html", `tag`)
tem.AddInternalShortcode("sc1.html", `sc1`)
tem.AddInternalShortcode("sc2.html", `sc2`)
@@ -578,7 +578,7 @@ tags:
}
sites, err := newHugoSites(s)
sites, err := newHugoSites(DepsCfg{}, s)
if err != nil {
t.Fatalf("Failed to build site: %s", err)