zap_module

package
v0.0.0-...-53c1a21 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = wrappedCfg{
	Log: Config{
		Driver: "development",
		Level:  "debug",
	},
}

Functions

func CheckConfig

func CheckConfig(cfg Config) error

func FXZap

func FXZap() fx.Option

func Module

func Module() fx.Option

func NewLogger

func NewLogger(lvl zapcore.Level, driver string, opts ...zapx.Option) (logger *zap.Logger, err error)

func ReplaceGlobalLogger

func ReplaceGlobalLogger(l *zap.Logger)

func WithOptions

func WithOptions(opts ...zapx.Option) fx.Option

Types

type Config

type Config struct {
	Driver       string `mapstructure:"driver"` // development, stackdriver
	Level        string `mapstructure:"level"`  // debug, info, warn, error, panic, fatal
	SlackWebhook string `mapstructure:"slack-webhook" validate:"omitempty,url"`
}

func ReadConfig

func ReadConfig(v *viper.Viper) (Config, error)

Jump to

Keyboard shortcuts

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