logger

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(o ...Option) logOptions

func NewLogger

func NewLogger(logBuilder LogBuilder, rawLogLevel string, verbosity int) (logr.Logger, error)

Types

type LogBuilder

type LogBuilder func(logLevel LogLevel, options ...Option) (logr.Logger, error)

type LogLevel

type LogLevel int

verbosity level

const (
	// logging is disabled
	LogOff LogLevel = iota - 1
	// logging channel for general information
	LogInfo
	// logging channel for detailed information
	LogDebug
	// logging channel for verbose information about the current state
	LogTrace
)

func ParseLogLevel

func ParseLogLevel(value string) LogLevel

ParseLogLevel convert the string representation into an instance of log level. the conversion is case insensitive. the default result is LOG_OFF

type Option

type Option func(*logOptions)

Option defines option function

func WithOutput

func WithOutput(w io.Writer) Option

WithOutput sets output to io.Writer

func WithZapOptions

func WithZapOptions(zo ...zap.Option) Option

WithZapOptions adds Zap specific options to logger

Jump to

Keyboard shortcuts

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