zap

package
v1.273.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabled added in v1.143.2

func IsEnabled(cfg *Config) bool

IsEnabled for zap.

func LogWithFunc added in v1.163.2

func LogWithFunc(msg string, err error, fn LogFunc, fields ...zapcore.Field)

LogWithFunc for zap.

func LogWithLogger added in v1.163.2

func LogWithLogger(msg string, err error, logger *zap.Logger, fields ...zapcore.Field)

LogWithLogger for zap.

func Meta added in v1.160.0

func Meta(ctx context.Context) []zapcore.Field

Meta for zap.

func NewConfig

func NewConfig(env env.Environment, config *Config) (*zap.Config, error)

NewConfig for zap. If disabled returns nil and ignored by logger.

func NewLogger

func NewLogger(params LoggerParams) (*zap.Logger, error)

NewLogger using zap.

Types

type Config added in v1.97.0

type Config struct {
	Level string `yaml:"level,omitempty" json:"level,omitempty" toml:"level,omitempty"`
}

Config for zap.

type LogFunc added in v1.163.2

type LogFunc func(msg string, fields ...zapcore.Field)

LogFunc for zap.

type LoggerParams

type LoggerParams struct {
	fx.In

	Lifecycle   fx.Lifecycle
	Config      *Config
	Logger      *zap.Config
	Environment env.Environment
	Version     env.Version
	Name        env.Name
}

LoggerParams for zap.

Jump to

Keyboard shortcuts

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