logger

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 2 Imported by: 47

README

logger

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiscardLogger = logr.Discard()

DiscardLogger is a logr.Logger that does nothing.

Functions

func SetLogger

func SetLogger(l Logger)

SetLogger sets a concrete logging implementation for all deferred Loggers.

func WithContext

func WithContext(ctx context.Context, log Logger) context.Context

WithContext takes a context and sets the logger as one of its keys. Use FromContext function to retrieve the logger.

Types

type Logger

type Logger = logr.Logger
var Log Logger = DiscardLogger

Log is the base logger used by kubebuilder. It delegates to another logr.Logger. You *must* call SetLogger to get any actual logging.

func FromContext

func FromContext(ctx context.Context) Logger

FromContext returns a logger with predefined values from a context.Context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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