logger

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() logr.Logger

New returns a logr.Logger which is implemented by zerolog.

func NewWithOptions

func NewWithOptions(opts Options) logr.Logger

NewWithOptions returns a logr.Logger which is implemented by zerolog.

func SetGlobalOptions

func SetGlobalOptions(config GlobalConfig)

SetGlobalOptions sets the global options, like level against which all info logs will be compared. If this is greater than or equal to the "V" of the logger, the message will be logged. Concurrent-safe.

func SetVLevelByStringGlobal

func SetVLevelByStringGlobal(level string)

SetVLevelByStringGlobal does the same as SetGlobalOptions but trying to expose verbosity level as more familiar "word-based" log levels

Types

type GlobalConfig

type GlobalConfig struct {
	V int `mapstructure:"v"`
}

GlobalConfig config contains global options

type Options

type Options struct {
	// Name is an optional name of the logger
	Name       string
	TimeFormat string
	Output     io.Writer
	// Logger is an instance of zerolog, if nil a default logger is used
	Logger *zerolog.Logger
}

Options that can be passed to NewWithOptions

Jump to

Keyboard shortcuts

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