Documentation ¶
Index ¶
- func Debug(template string, fields ...zap.Field)
- func Debugf(template string, args ...interface{})
- func Error(template string, fields ...zap.Field)
- func Errorf(template string, args ...interface{})
- func Fatal(template string, fields ...zap.Field)
- func Fatalf(template string, args ...interface{})
- func Info(template string, fields ...zap.Field)
- func Infof(template string, args ...interface{})
- func Init(cfg *Config)
- func InitDefault(env string)
- func New(cfg *Config) (*zap.Logger, error)
- func Panic(template string, fields ...zap.Field)
- func Panicf(template string, args ...interface{})
- func Warn(template string, fields ...zap.Field)
- func Warnf(template string, args ...interface{})
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Level string `yaml:"level" json:"level" default:"info"` Encoding string `yaml:"encoding" json:"encoding" default:"console"` EncodeTime string `yaml:"encode_time" json:"encode_time" default:"2006-01-02T15:04:05.000Z0700"` UseStdout bool `yaml:"use_stdout" json:"use_stdout" default:"true"` Filename string `yaml:"filename" json:"filename" default:"./logs/service.clog"` MaxAge int `yaml:"max_age" json:"max_age" default:"15"` // days MaxSize int `yaml:"max_size" json:"max_size" default:"500"` // MB MaxBackups int `yaml:"max_backups" json:"max_backups" default:"15"` Compress bool `yaml:"compress" json:"compress" default:"true"` }
Click to show internal directories.
Click to hide internal directories.