Documentation
¶
Index ¶
- func Debugf(msg string, args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Infof(msg string, args ...interface{})
- func InitLog(std bool, level string, cfgs ...Config) error
- func InitLogCore(std bool, level string, cfgs ...Config) (*zap.SugaredLogger, error)
- func Log() *zap.SugaredLogger
- func Panicf(msg string, args ...interface{})
- func Warnf(msg string, args ...interface{})
- type Config
- type LevelOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogCore ¶
func Log ¶
func Log() *zap.SugaredLogger
Types ¶
type Config ¶
type Config struct {
Enable bool `json:"enable" mapstructure:"enable"`
Filename string `json:"filename" mapstructure:"filename"` // 日志文件名
Level string `json:"level" mapstructure:"level"` // 日志等级
LevelOp LevelOp `json:"level_op" mapstructure:"level_op"`
MaxSize int `json:"max_size" mapstructure:"max_size"` // 日志切割大小,m为单位
MaxBackups int `json:"max_backups" mapstructure:"max_backups"` // 日志最大保留个数
MaxAge int `json:"max_age" mapstructure:"max_age"` // 日志最大保留天数
}
Config 日志文件配置
Click to show internal directories.
Click to hide internal directories.