Documentation
¶
Index ¶
- func NewZapLog(attrs ...ZapLogAttr) (*zap.Logger, error)
- type ZapLog
- func (zapLog *ZapLog) GetCompress() bool
- func (zapLog *ZapLog) GetFilename() string
- func (zapLog *ZapLog) GetInConsole() bool
- func (zapLog *ZapLog) GetLevel() zapcore.Level
- func (zapLog *ZapLog) GetMaxBackup() int
- func (zapLog *ZapLog) GetMaxDay() int
- func (zapLog *ZapLog) GetMaxSize() int
- func (my *ZapLog) SetAttrs(attrs ...ZapLogAttr) (err error)
- func (zapLog *ZapLog) SetCompress(compress bool) (err error)
- func (zapLog *ZapLog) SetEncoderType(encoderType ZapLogEncoderType) (err error)
- func (zapLog *ZapLog) SetFilename(filename string) (err error)
- func (zapLog *ZapLog) SetInConsole(inConsole bool) (err error)
- func (zapLog *ZapLog) SetLevel(level zapcore.Level) (err error)
- func (zapLog *ZapLog) SetMaxBackup(maxBackup int) (err error)
- func (zapLog *ZapLog) SetMaxDay(maxDay int) (err error)
- func (zapLog *ZapLog) SetMaxSize(maxSize int) (err error)
- type ZapLogAttr
- func Compress(compress bool) ZapLogAttr
- func EncoderType(encoderType ZapLogEncoderType) ZapLogAttr
- func Filename(filename string) ZapLogAttr
- func InConsole(inConsole bool) ZapLogAttr
- func Level(level zapcore.Level) ZapLogAttr
- func MaxBackup(maxBackup int) ZapLogAttr
- func MaxDay(maxDay int) ZapLogAttr
- func MaxSize(maxSize int) ZapLogAttr
- type ZapLogEncoderType
- type ZapLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ZapLog ¶
type ZapLog struct {
Level zapcore.Level
Filename string
MaxSize int
MaxBackup int
MaxDay int
Compress bool
InConsole bool
// Extension string
EncoderType ZapLogEncoderType
}
ZapProvider Zap日志服务提供者
func (*ZapLog) GetCompress ¶
func (*ZapLog) GetFilename ¶
func (*ZapLog) GetInConsole ¶
func (*ZapLog) GetMaxBackup ¶
func (*ZapLog) GetMaxSize ¶
func (*ZapLog) SetAttrs ¶
func (my *ZapLog) SetAttrs(attrs ...ZapLogAttr) (err error)
func (*ZapLog) SetCompress ¶
func (*ZapLog) SetEncoderType ¶
func (zapLog *ZapLog) SetEncoderType(encoderType ZapLogEncoderType) (err error)
func (zapLog *ZapLog) SetExtension(extension string) (err error) {
zapLog.Extension = extension
return nil
}
func (*ZapLog) SetFilename ¶
func (*ZapLog) SetInConsole ¶
func (*ZapLog) SetMaxBackup ¶
func (*ZapLog) SetMaxSize ¶
type ZapLogAttr ¶
func Compress ¶
func Compress(compress bool) ZapLogAttr
func EncoderType ¶
func EncoderType(encoderType ZapLogEncoderType) ZapLogAttr
func Filename ¶
func Filename(filename string) ZapLogAttr
func InConsole ¶
func InConsole(inConsole bool) ZapLogAttr
func Level ¶
func Level(level zapcore.Level) ZapLogAttr
func MaxBackup ¶
func MaxBackup(maxBackup int) ZapLogAttr
func MaxDay ¶
func MaxDay(maxDay int) ZapLogAttr
func MaxSize ¶
func MaxSize(maxSize int) ZapLogAttr
type ZapLogEncoderType ¶
type ZapLogEncoderType string
ZapProvider Zap日志服务提供者
const ( EncoderTypeConsole ZapLogEncoderType = "CONSOLE" EncoderTypeJson ZapLogEncoderType = "JSON" )
type ZapLogger ¶
type ZapLogger interface {
SetLevel(level zapcore.Level) (err error)
SetFilename(path string) (err error)
SetMaxSize(maxSize int) (err error)
SetMaxBackup(maxBackup int) (err error)
SetMaxDay(maxDay int) (err error)
SetCompress(compress bool) (err error)
SetInConsole(inConsole bool) (err error)
SetEncoderType(encoderType ZapLogEncoderType) (err error)
GetLevel() zapcore.Level
GetFilename() string
GetMaxSize() int
GetMaxBackup() int
GetMaxDay() int
GetCompress() bool
GetInConsole() bool
SetAttrs(attrs ...ZapLogAttr) (err error)
}
ZapProvider Zap日志服务提供者
Click to show internal directories.
Click to hide internal directories.