package jwalterweatherman
import "github.com/spf13/jwalterweatherman"
Index ¶
- Variables
- func LogCountForLevel(l Threshold) uint64
- func LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64
- func ResetLogCounters()
- func SetFlags(flags int)
- func SetLogOutput(handle io.Writer)
- func SetLogThreshold(threshold Threshold)
- func SetPrefix(prefix string)
- func SetStdoutThreshold(threshold Threshold)
- type Feedback
- func (fb *Feedback) Print(v ...interface{})
- func (fb *Feedback) Printf(format string, v ...interface{})
- func (fb *Feedback) Println(v ...interface{})
- type Notepad
- func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int) *Notepad
- func (n *Notepad) GetLogThreshold() Threshold
- func (n *Notepad) GetStdoutThreshold() Threshold
- func (n *Notepad) LogCountForLevel(l Threshold) uint64
- func (n *Notepad) LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64
- func (n *Notepad) ResetLogCounters()
- func (n *Notepad) SetFlags(flags int)
- func (n *Notepad) SetLogOutput(handle io.Writer)
- func (n *Notepad) SetLogThreshold(threshold Threshold)
- func (n *Notepad) SetPrefix(prefix string)
- func (n *Notepad) SetStdoutThreshold(threshold Threshold)
- type Threshold
Variables ¶
var ( TRACE *log.Logger DEBUG *log.Logger INFO *log.Logger WARN *log.Logger ERROR *log.Logger CRITICAL *log.Logger FATAL *log.Logger LOG *log.Logger FEEDBACK *Feedback )
Functions ¶
func LogCountForLevel ¶
LogCountForLevel returns the number of log invocations for a given threshold.
func LogCountForLevelsGreaterThanorEqualTo ¶
LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations greater than or equal to a given threshold.
func ResetLogCounters ¶
func ResetLogCounters()
ResetLogCounters resets the invocation counters for all levels.
func SetFlags ¶
func SetFlags(flags int)
SetFlags set the flags for the default logger. "log.Ldate | log.Ltime" by default.
func SetLogOutput ¶
SetLogOutput set the log output for the default notepad. Discarded by default.
func SetLogThreshold ¶
func SetLogThreshold(threshold Threshold)
SetLogThreshold set the log threshold for the default notepad. Trace by default.
func SetPrefix ¶
func SetPrefix(prefix string)
SetPrefix set the prefix for the default logger. Empty by default.
func SetStdoutThreshold ¶
func SetStdoutThreshold(threshold Threshold)
SetStdoutThreshold set the standard output threshold for the default notepad. Info by default.
Types ¶
type Feedback ¶
type Feedback struct {
// contains filtered or unexported fields
}
Feedback writes plainly to the outHandle while logging with the standard extra information (date, file, etc).
func (*Feedback) Print ¶
func (fb *Feedback) Print(v ...interface{})
func (*Feedback) Printf ¶
func (*Feedback) Println ¶
func (fb *Feedback) Println(v ...interface{})
type Notepad ¶
type Notepad struct { TRACE *log.Logger DEBUG *log.Logger INFO *log.Logger WARN *log.Logger ERROR *log.Logger CRITICAL *log.Logger FATAL *log.Logger LOG *log.Logger FEEDBACK *Feedback // contains filtered or unexported fields }
Notepad is where you leave a note!
func NewNotepad ¶
func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int) *Notepad
NewNotepad create a new notepad.
func (*Notepad) GetLogThreshold ¶
GetStdoutThreshold returns the defined Treshold for the log logger.
func (*Notepad) GetStdoutThreshold ¶
GetStdoutThreshold returns the Treshold for the stdout logger.
func (*Notepad) LogCountForLevel ¶
LogCountForLevel returns the number of log invocations for a given threshold.
func (*Notepad) LogCountForLevelsGreaterThanorEqualTo ¶
LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations greater than or equal to a given threshold.
func (*Notepad) ResetLogCounters ¶
func (n *Notepad) ResetLogCounters()
ResetLogCounters resets the invocation counters for all levels.
func (*Notepad) SetFlags ¶
SetFlags choose which flags the logger will display (after prefix and message level). See the package log for more informations on this.
func (*Notepad) SetLogOutput ¶
SetLogOutput changes the file where log messages are written.
func (*Notepad) SetLogThreshold ¶
SetLogThreshold changes the threshold above which messages are written to the log file.
func (*Notepad) SetPrefix ¶
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.
func (*Notepad) SetStdoutThreshold ¶
SetStdoutThreshold changes the threshold above which messages are written to the standard output.
type Threshold ¶
type Threshold int
const ( LevelTrace Threshold = iota LevelDebug LevelInfo LevelWarn LevelError LevelCritical LevelFatal )
func GetLogThreshold ¶
func GetLogThreshold() Threshold
GetStdoutThreshold returns the defined Treshold for the log logger.
func GetStdoutThreshold ¶
func GetStdoutThreshold() Threshold
GetStdoutThreshold returns the Treshold for the stdout logger.
func LogThreshold ¶
func LogThreshold() Threshold
Level returns the current global log threshold.
func StdoutThreshold ¶
func StdoutThreshold() Threshold
Level returns the current global output threshold.
func (Threshold) String ¶
Source Files ¶
default_notepad.go log_counter.go notepad.go
- Version
- v1.0.0
- Published
- Sep 7, 2018
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- now –
Tools for package owners.