diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-10-26 09:38:13 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-10-26 20:41:19 +0200 |
commit | 71fd79a3f44101ef515349a24527e6c0b566f368 (patch) | |
tree | 4bd1763b0b09a5767ee5501b6df298fd12efc6d2 /tpl/lang/lang.go | |
parent | c4a530f104f2b0d1dd82211b77b603a07db7c181 (diff) |
Revise the deprecation logging
This introduces a more automatic way of increasing the log levels for deprecation log statements based on the version it was deprecated.
The thresholds are a little arbitrary, but
* We log INFO for 6 releases
* We log WARN for another 6 releases
* THen ERROR (failing the build)
This should give theme authors plenty of time to catch up without having the log filled with warnings.
Diffstat (limited to 'tpl/lang/lang.go')
-rw-r--r-- | tpl/lang/lang.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tpl/lang/lang.go b/tpl/lang/lang.go index e83f70710..92b3aa8ff 100644 --- a/tpl/lang/lang.go +++ b/tpl/lang/lang.go @@ -16,19 +16,18 @@ package lang import ( "context" + "errors" "fmt" "math" "strconv" "strings" - "errors" - "github.com/gohugoio/locales" translators "github.com/gohugoio/localescompressed" "github.com/gohugoio/hugo/common/hreflect" + "github.com/gohugoio/hugo/common/hugo" "github.com/gohugoio/hugo/deps" - "github.com/gohugoio/hugo/helpers" "github.com/spf13/cast" ) @@ -243,7 +242,7 @@ func (ns *Namespace) FormatNumberCustom(precision, number any, options ...any) ( // Deprecated: Use lang.FormatNumberCustom instead. func (ns *Namespace) NumFmt(precision, number any, options ...any) (string, error) { - helpers.Deprecated("lang.NumFmt", "Use lang.FormatNumberCustom instead.", false) + hugo.Deprecate("lang.NumFmt", "Use lang.FormatNumberCustom instead.", "v0.120.0") return ns.FormatNumberCustom(precision, number, options...) } |