Documentation
¶
Index ¶
- func Build(op *Option) *zap.Logger
- func ContextWithLogger(ctx context.Context, log *zap.Logger) context.Context
- func GetContextLogger(ctx context.Context) *zap.Logger
- func GetLogger(ctx context.Context) *zap.Logger
- func GetLoggerWithContext(ctx context.Context, l *zap.Logger) *zap.Logger
- func Logger() *zap.Logger
- func NewGormLogger(logger *zap.Logger) *myGormLogger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithLogger ¶
func GetLoggerWithContext ¶
func NewGormLogger ¶
Types ¶
type Option ¶
type Option struct {
Path string `mapstructure:"path" json:"path" yaml:"path" ` // 日志路径
MaxAge int `mapstructure:"max-age" json:"max-age" yaml:"max-age" ` // 日志最大保存的天数
MaxSize int64 `mapstructure:"max-size" json:"max-size" yaml:"max-size" ` // 日志切割体积
Level string `mapstructure:"level" json:"level" yaml:"level" ` // 记录的起始等级
LogInConsole bool `mapstructure:"log-in-console" json:"log-in-console" yaml:"log-in-console" ` // 是否在控制台输出
Format string `mapstructure:"format" json:"format" yaml:"format" `
LevelEncode string `mapstructure:"level-encode" json:"level-encode" yaml:"level-encode" `
}
Click to show internal directories.
Click to hide internal directories.