logrusr

package
v0.0.0-...-99e2fb8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const FieldKeyLogger = "logger"

FieldKeyLogger is the name of the field used to store the logr logger name.

Variables

This section is empty.

Functions

func New

func New(l logrus.FieldLogger, opts ...Option) logr.Logger

New will return a new logr.Logger created from a logrus.FieldLogger.

Types

type FormatFunc

type FormatFunc func(interface{}) string

FormatFunc is the function to format log values with for non primitive data. By default, this is empty and the data will be JSON marshaled.

type Option

type Option func(l *logrusr)

Option is options to give when construction a logrusr logger.

func WithFormatter

func WithFormatter(f FormatFunc) Option

WithFormatter will set the FormatFunc to use.

func WithName

func WithName(name ...string) Option

WithName will set an initial name instead of having to call `WithName` on the logger itself after constructing it.

func WithReportCaller

func WithReportCaller() Option

WithReportCaller will enable reporting of the caller.

Jump to

Keyboard shortcuts

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