Documentation ¶
Overview ¶
Package log provides log utilities for the topology package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KObj ¶
KObj return a reference to a Kubernetes object in the same format used by kubectl commands (kind/name). Note: We're intentionally not using klog.KObj as we want the kind/name format instead of namespace/name.
type KRef ¶
type KRef struct {
Ref *corev1.ObjectReference
}
KRef return a reference to a Kubernetes object in the same format used by kubectl commands (kind/name).
type Logger ¶
type Logger interface { // WithObject adds to the logger information about the object being modified by reconcile, which in most case it is // a resources being part of the Cluster by reconciled. WithObject(obj client.Object) Logger // WithRef adds to the logger information about the object ref being modified by reconcile, which in most case it is // a resources being part of the Cluster by reconciled. WithRef(ref *corev1.ObjectReference) Logger // WithMachineDeployment adds to the logger information about the MachineDeployment object being processed. WithMachineDeployment(md *clusterv1.MachineDeployment) Logger // WithMachinePool adds to the logger information about the MachinePool object being processed. WithMachinePool(mp *expv1.MachinePool) Logger // WithValues adds key-value pairs of context to a logger. WithValues(keysAndValues ...interface{}) Logger // V returns a logger value for a specific verbosity level, relative to // this logger. V(level int) Logger // Infof logs to the INFO log. // Arguments are handled in the manner of fmt.Printf. Infof(msg string, a ...interface{}) // Into takes a context and sets the logger as one of its keys. // // This is meant to be used in reconcilers to enrich the logger within a context with additional values. Into(ctx context.Context) (context.Context, Logger) }
Logger provides a wrapper to log.Logger to be used for topology reconciler.
func LoggerFrom ¶
LoggerFrom returns a logger with predefined values from a context.Context. The logger, when used with controllers, can be expected to contain basic information about the object that's being reconciled like: - `reconciler group` and `reconciler kind` coming from the For(...) object passed in when building a controller. - `name` and `namespace` injected from the reconciliation request.
This is meant to be used with the context supplied in a struct that satisfies the Reconciler interface.