klogr

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package klogr is a wrapper around logr.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 that wraps the logr.Logger.

func New

func New(logr logr.Logger, opts ...Opt) *Logger

New returns a new Logger.

func (*Logger) Level

func (l *Logger) Level() kgo.LogLevel

Level returns the log level to log at.

func (*Logger) Log

func (l *Logger) Log(level kgo.LogLevel, msg string, keyvals ...any)

Log using the underlying logr.Logger. If kgo.LogLevelError is set, keyvals will be type checked for an error, and the first one found will be used.

type Opt

type Opt interface {
	// contains filtered or unexported methods
}

Opt applies options to the logger.

func LevelToV

func LevelToV(fn func(kgo.LogLevel) int) Opt

LevelToV returns the logr V level that corresponds to the given kgo.LogLevel.

By default, the kgo.LogLevel is just doubled -- error is 2, warn is 4, info is 6, and debug is 8.

Jump to

Keyboard shortcuts

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