logger

package
v0.0.0-...-e8da0a6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger func() logr.Logger = func() logr.Logger {
	return NewZapr(
		func(config *ZaprConfig) { config.Verbose = 0 },
		func(config *ZaprConfig) { config.DisableCaller = true },
		func(config *ZaprConfig) { config.DisableStacktrace = true },
	)
}

Functions

func Error

func Error(err error, msg string, keysAndValues ...interface{})

func Info

func Info(msg string, keysAndValues ...interface{})

func NewZapr

func NewZapr(opts ...OpZaprConfig) logr.Logger

func NewZerologr

func NewZerologr(opts ...OpZerologConfig) logr.Logger

func V

func V(level int) logr.Logger

func WithName

func WithName(name string) logr.Logger

func WithValues

func WithValues(keysAndValues ...interface{}) logr.Logger

Types

type OpZaprConfig

type OpZaprConfig func(cfg *ZaprConfig)

type OpZerologConfig

type OpZerologConfig func(cfg *ZerologConfig)

type ZaprConfig

type ZaprConfig struct {
	Verbose           int  `yaml:"verbose"` // enum(-1: only error, 0: info, 1: debug, 2: trace, n>2: further more)
	DisableCaller     bool `yaml:"disableCaller"`
	DisableStacktrace bool `yaml:"disableStacktrace"`
}

type ZerologConfig

type ZerologConfig struct {
	Verbose       int       `env:"LOG_VERBOSE"        yaml:"verbose"` // enum(-1: only error, 0: info, 1: debug, 2: trace, n>2: further more)
	DisableCaller bool      `env:"LOG_CALLER_DISABLE" yaml:"callerDisable"`
	Writer        io.Writer `json:"_"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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