mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
@@ -331,12 +331,14 @@ func (l *DistinctLogger) Warnf(format string, v ...interface{}) {
|
||||
l.Logger.Warnf(format, v...)
|
||||
})
|
||||
}
|
||||
|
||||
func (l *DistinctLogger) Warnln(v ...interface{}) {
|
||||
logStatement := fmt.Sprint(v...)
|
||||
l.printIfNotPrinted("warnln", logStatement, func() {
|
||||
l.Logger.Warnln(v...)
|
||||
})
|
||||
}
|
||||
|
||||
func (l *DistinctLogger) Errorf(format string, v ...interface{}) {
|
||||
logStatement := fmt.Sprint(v...)
|
||||
l.printIfNotPrinted("errorf", logStatement, func() {
|
||||
@@ -396,7 +398,6 @@ var (
|
||||
func InitLoggers() {
|
||||
DistinctErrorLog.Reset()
|
||||
DistinctWarnLog.Reset()
|
||||
|
||||
}
|
||||
|
||||
// Deprecated informs about a deprecation, but only once for a given set of arguments' values.
|
||||
@@ -408,7 +409,11 @@ func Deprecated(item, alternative string, err bool) {
|
||||
if err {
|
||||
DistinctErrorLog.Errorf("%s is deprecated and will be removed in Hugo %s. %s", item, hugo.CurrentVersion.Next().ReleaseVersion(), alternative)
|
||||
} else {
|
||||
DistinctWarnLog.Warnf("%s is deprecated and will be removed in a future release. %s", item, alternative)
|
||||
var warnPanicMessage string
|
||||
if !loggers.PanicOnWarning {
|
||||
warnPanicMessage = "\n\nRe-run Hugo with the flag --panicOnWarning to get a better error message."
|
||||
}
|
||||
DistinctWarnLog.Warnf("%s is deprecated and will be removed in a future release. %s%s", item, alternative, warnPanicMessage)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user