zap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Logger is global logger with default configuration

Functions

func NewLogger

func NewLogger(cfg Config, serviceName string) logger.Logger

NewLogger creates sugared zap logger with common config. It logs into writer from params.

Types

type Config

type Config struct {
	Targets []string `yaml:"targets" env:"TARGETS" env-default:"" env-description:"Targets(addresses) to which the logger sends logs"`
	Dir     string   `yaml:"dir" env:"DIR" env-default:"logs" env-description:"Directory to store logs"`
	Debug   bool     `yaml:"debug" env:"DEBUG" env-default:"false" env-description:"Debug mode"`
}

Config is struct to configure logger

Jump to

Keyboard shortcuts

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