logger

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultZapConfig

func GetDefaultZapConfig() zap.Config

Types

type Config

type Config struct {
	Mode     string `env:"LOG_MODE" envDefault:"development"`
	Level    string `env:"LOG_LEVEL" envDefault:"DEBUG"`
	Encoding string `env:"LOG_ENCODING" envDefault:"console"`
}

func NewConfig

func NewConfig() (*Config, error)

func (*Config) ToZapConfig

func (c *Config) ToZapConfig() zap.Config

type Logger

type Logger struct {
	*zap.SugaredLogger
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger(name string, options ...zap.Option) *Logger

func GetLoggerWithConfig

func GetLoggerWithConfig(name string, logConfig zap.Config, options ...zap.Option) *Logger

func (*Logger) LogLevel

func (log *Logger) LogLevel(newLevel zapcore.Level)

func (*Logger) With

func (log *Logger) With(args ...interface{})

Jump to

Keyboard shortcuts

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