Documentation ¶
Overview ¶
Package logging supplies common constants to ensure consistent use of structured logs.
Index ¶
- Constants
- func From(obj Object) []interface{}
- func FromPrefix(prefix string, obj Object) []interface{}
- func FromUser(u user.Info) []interface{}
- func FromUserPrefix(u user.Info, prefix string) []interface{}
- func WithCluster(logger logr.Logger, cluster *request.Cluster) logr.Logger
- func WithObject(logger logr.Logger, obj Object) logr.Logger
- func WithQueueKey(logger logr.Logger, key string) logr.Logger
- func WithReconciler(logger logr.Logger, reconciler string) logr.Logger
- func WithUser(logger logr.Logger, u user.Info) logr.Logger
- type Object
Constants ¶
const ( // ReconcilerKey is used to identify a reconciler. ReconcilerKey = "reconciler" // QueueKeyKey is used to expose the workqueue key being processed. QueueKeyKey = "key" // WorkspaceKey is used to specify a workspace when a log is related to an object. WorkspaceKey = "workspace" // NamespaceKey is used to specify a namespace when a log is related to an object. NamespaceKey = "namespace" // NameKey is used to specify a name when a log is related to an object. NameKey = "name" // APIVersionKey is used to specify an API version when a log is related to an object. APIVersionKey = "apiVersion" )
Variables ¶
This section is empty.
Functions ¶
func From ¶
func From(obj Object) []interface{}
From provides the structured logging fields that identify an object, prefixing with the resource name.
func FromPrefix ¶ added in v0.8.0
FromPrefix provides the structured logging fields that identify an object, allowing any prefix.
func FromUser ¶ added in v0.8.0
FromUser provides the structured logging fields that identify a user, prefixing with 'user'.
func FromUserPrefix ¶ added in v0.8.0
FromUserPrefix provides the structured logging fields that identify a user, allowing any prefix.
func WithCluster ¶ added in v0.8.0
WithCluster adds requested cluster identifiers to the logger.
func WithObject ¶
WithObject adds object identifiers to the logger.
func WithQueueKey ¶
WithQueueKey adds the queue key to the logger.
func WithReconciler ¶
WithReconciler adds the reconciler name to the logger.