log

package
v0.0.0-...-dc61bab Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *zap.Logger) context.Context

ContextWithLogger adds logger to context

func LoggerFromContext

func LoggerFromContext(ctx context.Context) *zap.Logger

LoggerFromContext returns logger from context

func NewLogger

func NewLogger(options ...Option) (*zap.Logger, error)

Types

type Config

type Config struct {
	Level    string `mapstructure:"level"`
	Encoding string `mapstructure:"encoding"`
	Mode     string `mapstructure:"mode"`
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a logger.

func Preset

func Preset(options ...Option) Option

Preset turns a list of Option instances into an Option

func SetConfig

func SetConfig(cfg Config) Option

func SetEncoding

func SetEncoding(encoding string) Option

func SetLevel

func SetLevel(level string) Option

func SetMode

func SetMode(mode string) Option

Jump to

Keyboard shortcuts

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