logging

package
v2.7.1-0...-d77f34b Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 Logger with sink. Before this is called, the global Logger is a no-op.

Types

type Logger

type Logger = logr.Logger

Logger is an interface to an abstract logging implementation.

func Discard

func Discard() Logger

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

func FromContext

func FromContext(ctx context.Context) Logger

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

Jump to

Keyboard shortcuts

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