aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-06-16 08:17:42 +0200
committerBjørn Erik Pedersen <[email protected]>2023-06-18 13:03:04 +0200
commit7c9fada778e91976d4ba1cbe942235a9bbeaf5cb (patch)
treea717f6e0a5915777ae6859564acd13385213bbab /markup
parent0e7944658660b5658b7640dce3cb346d7198d8c9 (diff)
downloadhugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.tar.gz
hugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.zip
Replace the old log setup, with structured logging etc.
Fixes #11124
Diffstat (limited to 'markup')
-rw-r--r--markup/asciidocext/convert_test.go18
-rw-r--r--markup/goldmark/convert_test.go4
-rw-r--r--markup/goldmark/toc_test.go9
-rw-r--r--markup/org/convert.go3
-rw-r--r--markup/org/convert_test.go2
-rw-r--r--markup/pandoc/convert_test.go2
-rw-r--r--markup/rst/convert_test.go2
7 files changed, 20 insertions, 20 deletions
diff --git a/markup/asciidocext/convert_test.go b/markup/asciidocext/convert_test.go
index cdc981263..459686139 100644
--- a/markup/asciidocext/convert_test.go
+++ b/markup/asciidocext/convert_test.go
@@ -44,7 +44,7 @@ func TestAsciidoctorDefaultArgs(t *testing.T) {
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -76,7 +76,7 @@ func TestAsciidoctorNonDefaultArgs(t *testing.T) {
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -106,7 +106,7 @@ func TestAsciidoctorDisallowedArgs(t *testing.T) {
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -130,7 +130,7 @@ func TestAsciidoctorArbitraryExtension(t *testing.T) {
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -164,7 +164,7 @@ func TestAsciidoctorDisallowedExtension(t *testing.T) {
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -195,7 +195,7 @@ trace = false
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -232,7 +232,7 @@ extensions = ["asciidoctor-html5s", "asciidoctor-diagram"]
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -272,7 +272,7 @@ my-attribute-name = "my value"
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
},
)
c.Assert(err, qt.IsNil)
@@ -311,7 +311,7 @@ allow = ['asciidoctor']
p, err := asciidocext.Provider.New(
converter.ProviderConfig{
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
Conf: conf,
Exec: hexec.New(securityConfig),
},
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go
index 666529877..a2f7b9597 100644
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -46,7 +46,7 @@ noclasses=false
func convert(c *qt.C, conf config.AllProvider, content string) converter.ResultRender {
pconf := converter.ProviderConfig{
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
Conf: conf,
}
@@ -442,7 +442,7 @@ LINE5
conf := testconfig.GetTestConfig(nil, cfg)
pcfg := converter.ProviderConfig{
Conf: conf,
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
}
p, err := goldmark.Provider.New(
pcfg,
diff --git a/markup/goldmark/toc_test.go b/markup/goldmark/toc_test.go
index 78811cfb4..f7f7bb7a0 100644
--- a/markup/goldmark/toc_test.go
+++ b/markup/goldmark/toc_test.go
@@ -17,12 +17,11 @@ import (
"strings"
"testing"
+ "github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/config/testconfig"
"github.com/gohugoio/hugo/markup/converter/hooks"
"github.com/gohugoio/hugo/markup/goldmark"
- "github.com/gohugoio/hugo/common/loggers"
-
"github.com/gohugoio/hugo/markup/converter"
qt "github.com/frankban/quicktest"
@@ -56,7 +55,7 @@ And then some.
p, err := goldmark.Provider.New(
converter.ProviderConfig{
Conf: testconfig.GetTestConfig(nil, nil),
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
})
c.Assert(err, qt.IsNil)
conv, err := p.New(converter.DocumentContext{})
@@ -86,12 +85,12 @@ func TestEscapeToc(t *testing.T) {
safeP, _ := goldmark.Provider.New(
converter.ProviderConfig{
Conf: safeConf(),
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
})
unsafeP, _ := goldmark.Provider.New(
converter.ProviderConfig{
Conf: unsafeConf(),
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
})
safeConv, _ := safeP.New(converter.DocumentContext{})
unsafeConv, _ := unsafeP.New(converter.DocumentContext{})
diff --git a/markup/org/convert.go b/markup/org/convert.go
index 802b9aa5a..141269f1d 100644
--- a/markup/org/convert.go
+++ b/markup/org/convert.go
@@ -16,6 +16,7 @@ package org
import (
"bytes"
+ "log"
"github.com/gohugoio/hugo/identity"
@@ -46,7 +47,7 @@ type orgConverter struct {
func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.ResultRender, error) {
logger := c.cfg.Logger
config := org.New()
- config.Log = logger.Warn()
+ config.Log = log.Default() // TODO(bep)
config.ReadFile = func(filename string) ([]byte, error) {
return afero.ReadFile(c.cfg.ContentFs, filename)
}
diff --git a/markup/org/convert_test.go b/markup/org/convert_test.go
index 08841b2d7..1422585af 100644
--- a/markup/org/convert_test.go
+++ b/markup/org/convert_test.go
@@ -29,7 +29,7 @@ import (
func TestConvert(t *testing.T) {
c := qt.New(t)
p, err := org.Provider.New(converter.ProviderConfig{
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
Conf: testconfig.GetTestConfig(afero.NewMemMapFs(), nil),
})
c.Assert(err, qt.IsNil)
diff --git a/markup/pandoc/convert_test.go b/markup/pandoc/convert_test.go
index f549d5f4f..6a1535946 100644
--- a/markup/pandoc/convert_test.go
+++ b/markup/pandoc/convert_test.go
@@ -32,7 +32,7 @@ func TestConvert(t *testing.T) {
c := qt.New(t)
sc := security.DefaultConfig
sc.Exec.Allow = security.NewWhitelist("pandoc")
- p, err := Provider.New(converter.ProviderConfig{Exec: hexec.New(sc), Logger: loggers.NewErrorLogger()})
+ p, err := Provider.New(converter.ProviderConfig{Exec: hexec.New(sc), Logger: loggers.NewDefault()})
c.Assert(err, qt.IsNil)
conv, err := p.New(converter.DocumentContext{})
c.Assert(err, qt.IsNil)
diff --git a/markup/rst/convert_test.go b/markup/rst/convert_test.go
index 5d2882de1..9e98d0405 100644
--- a/markup/rst/convert_test.go
+++ b/markup/rst/convert_test.go
@@ -35,7 +35,7 @@ func TestConvert(t *testing.T) {
p, err := Provider.New(
converter.ProviderConfig{
- Logger: loggers.NewErrorLogger(),
+ Logger: loggers.NewDefault(),
Exec: hexec.New(sc),
})
c.Assert(err, qt.IsNil)