package jwalterweatherman

Import Path
	github.com/spf13/jwalterweatherman (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package


Package-Level Type Names (total 5, all are exported)
/* sort exporteds by: | */
Counter is an io.Writer that increments a counter on Write. Count returns the current count. Reset resets the counter. (*T) Write(p []byte) (n int, err error) *T : io.Writer func LogCounter(counter *Counter, t1 Threshold) LogListener
Feedback writes plainly to the outHandle while logging with the standard extra information (date, file, etc). (*T) Print(v ...interface{}) (*T) Printf(format string, v ...interface{}) (*T) Println(v ...interface{}) var FEEDBACK *Feedback
A LogListener can ble supplied to a Notepad to listen on log writes for a given threshold. This can be used to capture log events in unit tests and similar. Note that this function will be invoked once for each log threshold. If the given threshold is not of interest to you, return nil. Note that these listeners will receive log events for a given threshold, even if the current configuration says not to log it. That way you can count ERRORs even if you don't print them to the console. func LogCounter(counter *Counter, t1 Threshold) LogListener func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int, logListeners ...LogListener) *Notepad func SetLogListeners(l ...LogListener)
Notepad is where you leave a note! CRITICAL *log.Logger DEBUG *log.Logger ERROR *log.Logger FATAL *log.Logger FEEDBACK *Feedback INFO *log.Logger LOG *log.Logger TRACE *log.Logger WARN *log.Logger GetStdoutThreshold returns the defined Treshold for the log logger. GetStdoutThreshold returns the Treshold for the stdout logger. SetFlags choose which flags the logger will display (after prefix and message level). See the package log for more informations on this. SetLogOutput changes the file where log messages are written. SetLogThreshold changes the threshold above which messages are written to the log file. SetPrefix changes the prefix used by the notepad. Prefixes are displayed between brackets at the beginning of the line. An empty prefix won't be displayed at all. SetStdoutThreshold changes the threshold above which messages are written to the standard output. func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int, logListeners ...LogListener) *Notepad
( T) String() string T : fmt.Stringer func GetLogThreshold() Threshold func GetStdoutThreshold() Threshold func LogThreshold() Threshold func StdoutThreshold() Threshold func (*Notepad).GetLogThreshold() Threshold func (*Notepad).GetStdoutThreshold() Threshold func LogCounter(counter *Counter, t1 Threshold) LogListener func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int, logListeners ...LogListener) *Notepad func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int, logListeners ...LogListener) *Notepad func SetLogThreshold(threshold Threshold) func SetStdoutThreshold(threshold Threshold) func (*Notepad).SetLogThreshold(threshold Threshold) func (*Notepad).SetStdoutThreshold(threshold Threshold) const LevelCritical const LevelDebug const LevelError const LevelFatal const LevelInfo const LevelTrace const LevelWarn
Package-Level Functions (total 15, in which 13 are exported)
GetStdoutThreshold returns the defined Treshold for the log logger.
GetStdoutThreshold returns the Treshold for the stdout logger.
LogCounter creates a LogListener that counts log statements >= the given threshold.
Level returns the current global log threshold.
NewNotepad creates a new Notepad.
SetFlags set the flags for the default logger. "log.Ldate | log.Ltime" by default.
SetLogListeners configures the default logger with one or more log listeners.
SetLogOutput set the log output for the default notepad. Discarded by default.
SetLogThreshold set the log threshold for the default notepad. Trace by default.
SetPrefix set the prefix for the default logger. Empty by default.
SetStdoutOutput set the stdout output for the default notepad. Default is stdout.
SetStdoutThreshold set the standard output threshold for the default notepad. Info by default.
Level returns the current global output threshold.
Package-Level Variables (total 11, in which 9 are exported)
var LOG *log.Logger
Package-Level Constants (total 7, all are exported)
const LevelInfo Threshold = 2
const LevelWarn Threshold = 3