Documentation
¶
Overview ¶
"Logging extensions" - https://joonas.fi/2018/12/04/an-idea-to-fix-gos-logging-mess/
Index ¶
- Variables
- func Filter(filter *regexp.Regexp, matches *log.Logger) *log.Logger
- func NonNil(ref *log.Logger) *log.Logger
- func OutputToAnotherLog(another *log.Logger) io.Writer
- func Prefix(prefix string, parent *log.Logger) *log.Logger
- func RedirectGlobalStdLog(to *log.Logger)
- func StandardLogger() *log.Logger
- func StandardLoggerTo(sink io.Writer) *log.Logger
- type Leveled
Constants ¶
This section is empty.
Variables ¶
View Source
var Discard = log.New(ioutil.Discard, "", 0)
a logger that discards its output
Functions ¶
func Filter ¶
pipes Logger's output (io.Writer) into another Logger, but only if entry matches regex
func NonNil ¶
helper for libraries in getting an alwas non-nil logger. if a logger given to you was nil, you get a Discard logger back, which you can call safely - it doesn't write anywhere
func OutputToAnotherLog ¶
pipes Logger's output (io.Writer) into another Logger
func RedirectGlobalStdLog ¶
func StandardLogger ¶
centralized place for creating "standard" stderr logger in a way that supports suppressing log timestamps if a mechanism around it (Docker/systemd) would add one anyway
Types ¶
Click to show internal directories.
Click to hide internal directories.