logging

package
v0.0.0-...-ea5f367 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discard

func Discard() logr.Logger

Discard returns a logr.Logger that discards all messages logged to it.

func FromContext

func FromContext(ctx context.Context) logr.Logger

FromContext returns the global logr.Logger or the one stored by a prior call to NewContext.

func Logrus

func Logrus(out io.Writer, version string, debug, verbosity int) logr.LogSink

Logrus creates a sink that writes to out using a logrus format. Log entries are emitted when their level is at or below verbosity. (Only the most important entries are emitted when verbosity is zero.) Error entries get a logrus.ErrorLevel, Info entries with verbosity less than debug get a logrus.InfoLevel, and Info entries with verbosity of debug or more get a logrus.DebugLevel.

func NewContext

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

NewContext returns a copy of ctx containing logger. Retrieve it using FromContext.

func SetLogSink

func SetLogSink(sink logr.LogSink)

SetLogSink replaces the global logr.Logger with sink. Before this is called, the global logr.Logger is a no-op.

Types

This section is empty.

Jump to

Keyboard shortcuts

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