Skip to content

Commit

Permalink
Merge pull request #1202 from vincepri/loggerfrominto
Browse files Browse the repository at this point in the history
馃尡 Add ctrl.{LoggerFrom, LoggerInto}
  • Loading branch information
k8s-ci-robot committed Oct 2, 2020
2 parents df9195b + 8a00ec4 commit e50bc83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,15 @@ var (
// get any actual logging.
Log = log.Log

// LoggerFromContext returns a logger with predefined values from a context.Context.
// LoggerFrom returns a logger with predefined values from a context.Context.
//
// This is meant to be used with the context supplied in a struct that satisfies the Reconciler interface.
LoggerFromContext = log.FromContext
LoggerFrom = log.FromContext

// LoggerInto 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.
LoggerInto = log.IntoContext

// SetLogger sets a concrete logging implementation for all deferred Loggers.
SetLogger = log.SetLogger
Expand Down

0 comments on commit e50bc83

Please sign in to comment.