zap

package
v1.172.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabled added in v1.143.2

func IsEnabled(c *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.

func NewLogger

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

NewLogger using zap.

Types

type Config added in v1.97.0

type Config struct {
	Enabled bool   `yaml:"enabled,omitempty" json:"enabled,omitempty" toml:"enabled,omitempty"`
	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
	ZapConfig   zap.Config
	Environment env.Environment
	Version     version.Version
}

LoggerParams for zap.

Jump to

Keyboard shortcuts

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