From 7c9fada778e91976d4ba1cbe942235a9bbeaf5cb Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Fri, 16 Jun 2023 08:17:42 +0200 Subject: Replace the old log setup, with structured logging etc. Fixes #11124 --- parser/metadecoders/decoder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'parser') 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) -- cgit v1.2.3