Documentation
¶
Overview ¶
Package logger defines an interface for adding a structured logger to a context and retrieving it again. The fallback when a context doesn't have a logger is the global klog logger.
This uses the same context key as logr and thus is compatible with code that uses that interface. The difference is that the Get function here never returns nil.
Also contains an extension of klog.KObj which includes the type of the object in the log output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( KObj = klog.KObj KRef = klog.KRef )
Functions ¶
func CapacityRef ¶ added in v1.0.0
CapacityRef returns an object that pretty-prints the given number of bytes.
Types ¶
type ObjectRefWithType ¶
type ObjectRefWithType struct { klog.ObjectRef Type string `json:"type,omitempty"` }
ObjectRef references a kubernetes object
func KObjWithType ¶
func KObjWithType(obj klog.KMetadata) ObjectRefWithType
KObj returns ObjectRefWithType from ObjectMeta
func (ObjectRefWithType) String ¶
func (ref ObjectRefWithType) String() string
type Options ¶
type Options struct {
logsapi.LoggingConfiguration
}
Options is a wrapper around Options which makes it usable with flags.Var.