Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var L *zap.Logger
Functions ¶
func NewEncoderConfig ¶
func NewEncoderConfig() zapcore.EncoderConfig
NewEncoderConfig creates logger config for debug mode
func ParseLevel ¶
ParseLevel parses string to zap level
func TimeEncoder ¶
func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type Config ¶
type Config struct { Path string `yaml:"path" json:"path"` Level string `yaml:"level" json:"level" default:"info" validate:"regexp=^(info|debug|warn|error)$"` Encoding string `yaml:"encoding" json:"encoding" default:"json" validate:"regexp=^(json|console)$"` Format string `yaml:"format" json:"format" default:"text" validate:"regexp=^(text|json)$"` MaxAge int `yaml:"maxAge" json:"maxAge" default:"15" validate:"min=1"` // days MaxSize int `yaml:"maxSize" json:"maxSize" default:"50" validate:"min=1"` // MB MaxBackups int `yaml:"maxBackups" json:"maxBackups" default:"15" validate:"min=1"` }
LogConfig for logging
Click to show internal directories.
Click to hide internal directories.