logger

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package logger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a concrete logger using logr underneath.

func FromContext

func FromContext(ctx context.Context) *Logger

FromContext retrieves the logr implementation from Context and uses it as underlying logger.

func NewLogger

func NewLogger(log logr.Logger) *Logger

NewLogger creates a logger with a passed in logr.Logger implementation directly.

func (*Logger) Debug

func (c *Logger) Debug(msg string, keysAndValues ...any)

func (*Logger) Error

func (c *Logger) Error(err error, msg string, keysAndValues ...any)

func (*Logger) GetLogger

func (c *Logger) GetLogger() logr.Logger

func (*Logger) Info

func (c *Logger) Info(msg string, keysAndValues ...any)

func (*Logger) Trace

func (c *Logger) Trace(msg string, keysAndValues ...any)

func (*Logger) Warn

func (c *Logger) Warn(msg string, keysAndValues ...any)

func (*Logger) WithName

func (c *Logger) WithName(name string) *Logger

func (*Logger) WithValues

func (c *Logger) WithValues(keysAndValues ...any) *Logger

type Wrapper

type Wrapper interface {
	Info(msg string, keysAndValues ...any)
	Debug(msg string, keysAndValues ...any)
	Warn(msg string, keysAndValues ...any)
	Trace(msg string, keysAndValues ...any)
	Error(err error, msg string, keysAndValues ...any)
	WithValues(keysAndValues ...any) *Logger
	WithName(name string) *Logger
	GetLogger() logr.Logger
}

Wrapper defines a convenient interface to use to log things.

Jump to

Keyboard shortcuts

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