diff -r c040f992052f -r 1c52a0eeb952 vendor/github.com/spf13/jwalterweatherman/default_notepad.go --- a/vendor/github.com/spf13/jwalterweatherman/default_notepad.go Wed Sep 18 19:17:42 2019 +0200 +++ b/vendor/github.com/spf13/jwalterweatherman/default_notepad.go Sun Feb 16 18:54:01 2020 +0100 @@ -64,6 +64,13 @@ reloadDefaultNotepad() } +// SetStdoutOutput set the stdout output for the default notepad. Default is stdout. +func SetStdoutOutput(handle io.Writer) { + defaultNotepad.outHandle = handle + defaultNotepad.init() + reloadDefaultNotepad() +} + // SetPrefix set the prefix for the default logger. Empty by default. func SetPrefix(prefix string) { defaultNotepad.SetPrefix(prefix) @@ -76,6 +83,13 @@ reloadDefaultNotepad() } +// SetLogListeners configures the default logger with one or more log listeners. +func SetLogListeners(l ...LogListener) { + defaultNotepad.logListeners = l + defaultNotepad.init() + reloadDefaultNotepad() +} + // Level returns the current global log threshold. func LogThreshold() Threshold { return defaultNotepad.logThreshold @@ -95,19 +109,3 @@ func GetStdoutThreshold() Threshold { return defaultNotepad.GetStdoutThreshold() } - -// LogCountForLevel returns the number of log invocations for a given threshold. -func LogCountForLevel(l Threshold) uint64 { - return defaultNotepad.LogCountForLevel(l) -} - -// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations -// greater than or equal to a given threshold. -func LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 { - return defaultNotepad.LogCountForLevelsGreaterThanorEqualTo(threshold) -} - -// ResetLogCounters resets the invocation counters for all levels. -func ResetLogCounters() { - defaultNotepad.ResetLogCounters() -}