Documentation ¶
Overview ¶
Package logger provides runtime configuration options for logging, making it easier to consistently have the same configuration options and flags across GitOps Toolkit components.
Index ¶
Constants ¶
View Source
const ( TraceLevel = 2 DebugLevel = 1 InfoLevel = 0 )
These are for convenience when doing log.V(...) to log at a particular level. They correspond to the logr equivalents of the zap levels above.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶ added in v0.6.0
Options contains the configuration options for the runtime logger.
The struct can be used in the main.go file of your controller by binding it to the main flag set, and then utilizing the configured options later:
func main() { var ( // other controller specific configuration variables loggerOptions logger.Options ) // Bind the options to the main flag set, and parse it loggerOptions.BindFlags(flag.CommandLine) flag.Parse() // Use the values during the initialisation of the logger ctrl.SetLogger(logger.NewLogger(logOptions)) }
Click to show internal directories.
Click to hide internal directories.