Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildForKlog ¶
BuildForKlog returns a zap.Logger built from given config, made to work well with klog. The FlagSet should be the same one klog is bound to. Usually the given config should be created from `ZapFlags.GetConfig()`.
func SyncWithGlogFlags ¶
SyncWithGlogFlags copies the values of all the flags on the command line with the given FlagSet. It is intended to help workaround problems with interoperability between glog and klog. See https://github.com/kubernetes/klog/blob/v2.40.1/examples/coexist_glog/coexist_glog.go#L18
Types ¶
type ZapFlags ¶
type ZapFlags struct { // LevelName is the name of the flag to use for the zap level. Defaults to "zap-log-level". LevelName string // EncoderName is the name of the flag to use for the zap encoding. Defaults to "zap-encoder". EncoderName string // contains filtered or unexported fields }
ZapFlags allows for easier configuration of the command flags to use for zap configuration.
func NewZapFlags ¶
func NewZapFlags() ZapFlags
NewZapFlags returns a ZapFlags with the default names of the flags
func (*ZapFlags) BuildForCtrl ¶
BuildForCtrl returns a zap.Logger built to work well with the controller-runtime.