Documentation
¶
Overview ¶
Package logging sets up structured logging in a uniform way, and redirects glog statements into the structured log. Note that this module is copied from https://github.com/metallb/metallb/blob/main/internal/logging/logging.go (as of latest commit b26eb3b61e63ca81cbfdfd5a221d08ecc40d4d5c).
Index ¶
Constants ¶
View Source
const ( LevelAll = "all" LevelDebug = "debug" LevelInfo = "info" LevelWarn = "warn" LevelError = "error" LevelNone = "none" )
Variables ¶
View Source
var ( // Levels returns an array of valid log levels. Levels = levelSlice{LevelAll, LevelDebug, LevelInfo, LevelWarn, LevelError, LevelNone} )
Functions ¶
func Init ¶
Init returns a logger configured with common settings like timestamping and source code locations. Both the stdlib logger and glog are reconfigured to push logs into this logger.
Init must be called as early as possible in main(), before any application-specific flag parsing or logging occurs, because it mutates the contents of the flag package as well as os.Stderr.
Types ¶
Click to show internal directories.
Click to hide internal directories.