logger

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log logr.Logger
)

Functions

func InitFlags

func InitFlags(flagset *flag.FlagSet)

func Logf

func Logf(logFunc func(msg string, keysAndValues ...interface{}), format string, a ...interface{})

func New

func New(config *Config) (logr.Logger, error)

func NewCliLogger

func NewCliLogger() (logr.Logger, error)

NewCliLogger creates a new logger for cli usage. CLI usage means that by default: - the default dev config - encoding is console - timestamps are disabled (can be still activated by the cli flag) - level are color encoded

func SetLogger

func SetLogger(log logr.Logger)

Types

type Config

type Config struct {
	Development       bool
	Cli               bool
	Verbosity         int
	DisableStacktrace bool
	DisableCaller     bool
	DisableTimestamp  bool
	// contains filtered or unexported fields
}

func (*Config) SetDisableCaller

func (c *Config) SetDisableCaller(zapCfg *zap.Config)

SetDisableCaller dis- or enables the caller according to the provided flag if the flag was provided

func (*Config) SetDisableStacktrace

func (c *Config) SetDisableStacktrace(zapCfg *zap.Config)

SetDisableStacktrace dis- or enables the stackstrace according to the provided flag if the flag was provided

func (*Config) SetTimestamp

func (c *Config) SetTimestamp(zapCfg *zap.Config)

SetTimestamp dis- or enables the logging of timestamps according to the provided flag if the flag was provided

Jump to

Keyboard shortcuts

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