mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
0d7b05be4c
commit
bc70f2bf12
1 changed files with 11 additions and 4 deletions
|
@ -283,6 +283,13 @@ type DistinctLogger struct {
|
||||||
m map[string]bool
|
m map[string]bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *DistinctLogger) Reset() {
|
||||||
|
l.Lock()
|
||||||
|
defer l.Unlock()
|
||||||
|
|
||||||
|
l.m = make(map[string]bool)
|
||||||
|
}
|
||||||
|
|
||||||
// Println will log the string returned from fmt.Sprintln given the arguments,
|
// Println will log the string returned from fmt.Sprintln given the arguments,
|
||||||
// but not if it has been logged before.
|
// but not if it has been logged before.
|
||||||
func (l *DistinctLogger) Println(v ...interface{}) {
|
func (l *DistinctLogger) Println(v ...interface{}) {
|
||||||
|
@ -347,11 +354,11 @@ var (
|
||||||
DistinctFeedbackLog = NewDistinctFeedbackLogger()
|
DistinctFeedbackLog = NewDistinctFeedbackLogger()
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitLoggers sets up the global distinct loggers.
|
// InitLoggers resets the global distinct loggers.
|
||||||
func InitLoggers() {
|
func InitLoggers() {
|
||||||
DistinctErrorLog = NewDistinctErrorLogger()
|
DistinctErrorLog.Reset()
|
||||||
DistinctWarnLog = NewDistinctWarnLogger()
|
DistinctWarnLog.Reset()
|
||||||
DistinctFeedbackLog = NewDistinctFeedbackLogger()
|
DistinctFeedbackLog.Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated informs about a deprecation, but only once for a given set of arguments' values.
|
// Deprecated informs about a deprecation, but only once for a given set of arguments' values.
|
||||||
|
|
Loading…
Reference in a new issue