logger

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ControlPlaneNamespace is the namespace where slice operator is running
	ControlPlaneNamespace = "kubeslice-system"
	// Name of the cluster
	ClusterName = os.Getenv("CLUSTER_NAME")
)

Functions

func FromContext

func FromContext(ctx context.Context) logr.Logger

FromContext returns a logger from the context.

func NewLogger

func NewLogger() *uzap.SugaredLogger

NewLogger Creates a new SugaredLogger instance with predefined standard fields SugaredLogger makes it easy to use structured logging with logging levels and additional fields

func NewWrappedLogger

func NewWrappedLogger() logr.Logger

Creates a new zap logger, wraps it to logr.Logger using zapr Required for controller-runtime logging

func WithLogger

func WithLogger(ctx context.Context, logger logr.Logger) context.Context

WithLogger takes in a context and returns a context with key as loggerKey{} and value as loggger(of type logr.Logger) passed

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL