zaplogr

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package zaplogr provides a way to use zap.Logger with controller-runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *zap.Logger

FromContext returns the underlying zap.Logger from a context.

func New

func New(zapLog *zap.Logger) logr.Logger

New returns a new logr.Logger that's backed by a zap.Logger.

Types

type FilteringSink

type FilteringSink struct {
	logr.LogSink
}

FilteringSink is a logr.LogSink that replaces klog.ObjectRef with its string representation.

func (*FilteringSink) Error

func (f *FilteringSink) Error(err error, msg string, keysAndValues ...any)

func (*FilteringSink) GetUnderlying

func (f *FilteringSink) GetUnderlying() *zap.Logger

func (*FilteringSink) Info

func (f *FilteringSink) Info(level int, msg string, keysAndValues ...any)

func (*FilteringSink) WithName

func (f *FilteringSink) WithName(name string) logr.LogSink

func (*FilteringSink) WithValues

func (f *FilteringSink) WithValues(keysAndValues ...any) logr.LogSink

Jump to

Keyboard shortcuts

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