diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-06-16 08:17:42 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-06-18 13:03:04 +0200 |
commit | 7c9fada778e91976d4ba1cbe942235a9bbeaf5cb (patch) | |
tree | a717f6e0a5915777ae6859564acd13385213bbab /parser | |
parent | 0e7944658660b5658b7640dce3cb346d7198d8c9 (diff) | |
download | hugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.tar.gz hugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.zip |
Replace the old log setup, with structured logging etc.
Fixes #11124
Diffstat (limited to 'parser')
-rw-r--r-- | parser/metadecoders/decoder.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parser/metadecoders/decoder.go b/parser/metadecoders/decoder.go index a65731ae4..93eb32e47 100644 --- a/parser/metadecoders/decoder.go +++ b/parser/metadecoders/decoder.go @@ -18,6 +18,7 @@ import ( "encoding/csv" "encoding/json" "fmt" + "log" "regexp" "strings" @@ -28,7 +29,6 @@ import ( toml "github.com/pelletier/go-toml/v2" "github.com/spf13/afero" "github.com/spf13/cast" - jww "github.com/spf13/jwalterweatherman" yaml "gopkg.in/yaml.v2" ) @@ -231,7 +231,7 @@ func parseORGDate(s string) string { func (d Decoder) unmarshalORG(data []byte, v any) error { config := org.New() - config.Log = jww.WARN + config.Log = log.Default() // TODO(bep) document := config.Parse(bytes.NewReader(data), "") if document.Error != nil { return document.Error @@ -242,7 +242,7 @@ func (d Decoder) unmarshalORG(data []byte, v any) error { if strings.HasSuffix(k, "[]") { frontMatter[k[:len(k)-2]] = strings.Fields(v) } else if k == "tags" || k == "categories" || k == "aliases" { - jww.WARN.Printf("Please use '#+%s[]:' notation, automatic conversion is deprecated.", k) + log.Printf("warn: Please use '#+%s[]:' notation, automatic conversion is deprecated.", k) frontMatter[k] = strings.Fields(v) } else if k == "date" || k == "lastmod" || k == "publishdate" || k == "expirydate" { frontMatter[k] = parseORGDate(v) |