ctxlog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, v ...interface{})

Debug returns an DEBUG level log from an specified context

func Error

func Error(ctx context.Context, err error, msg string, v ...interface{})

Error returns an ERROR level log from an specified context

func ExtractLogger

func ExtractLogger(ctx context.Context) logr.Logger

ExtractLogger returns a logger based on the loggerKey This function retrieves from an existing context the value, which in this case is an instance of our logger

func Info

func Info(ctx context.Context, msg string, v ...interface{})

Info returns an INFO level log from an specified context

func NewContext

func NewContext(ctx context.Context, name string) context.Context

NewContext returns a new child context based on our logger key(loggerKey). This function is useful for spawning children context with a particular logging name for each controller

func NewLogger

func NewLogger(name string) logr.Logger

NewLogger returns a new Logger instance by using the operator-sdk log/zap logging implementation

func NewParentContext

func NewParentContext(log logr.Logger) context.Context

NewParentContext returns a new context from the parent context.Background one. This new context stores our logger implementation

Types

This section is empty.

Jump to

Keyboard shortcuts

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