Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WithCaller = zap.WithCaller AddStacktrace = zap.AddStacktrace AddCallerSkip = zap.AddCallerSkip // 打印文件skip,多个skip则相加 )
View Source
var ( Skip = zap.Skip Binary = zap.Binary Bool = zap.Bool Boolp = zap.Boolp ByteString = zap.ByteString Complex128 = zap.Complex128 Complex128p = zap.Complex128p Complex64 = zap.Complex64 Complex64p = zap.Complex64p Float64 = zap.Float64 Float64p = zap.Float64p Float32 = zap.Float32 Float32p = zap.Float32p Int = zap.Int Intp = zap.Intp Int64 = zap.Int64 Int64p = zap.Int64p Int32 = zap.Int32 Int32p = zap.Int32 Int16 = zap.Int16 Int16p = zap.Int16p Int8 = zap.Int8 Int8p = zap.Int8p String = zap.String Stringp = zap.Stringp Uint = zap.Uint Uintp = zap.Uintp Uint64 = zap.Uint64 Uint64p = zap.Uint64p Uint32 = zap.Uint32 Uint32p = zap.Uint32p Uint16 = zap.Uint16 Uint16p = zap.Uint16p Uint8 = zap.Uint8 Uint8p = zap.Uint8p Uintptr = zap.Uintptr Uintptrp = zap.Uintptr Reflect = zap.Reflect Namespace = zap.Namespace Stringer = zap.Stringer Time = zap.Time Timep = zap.Timep Stack = zap.Stack StackSkip = zap.StackSkip Duration = zap.Duration Durationp = zap.Durationp Object = zap.Object Inline = zap.Inline Any = zap.Any )
View Source
var ( Info = std.l.Info Warn = std.l.Warn Error = std.l.Error DPanic = std.l.DPanic Panic = std.l.Panic Fatal = std.l.Fatal Debug = std.l.Debug SugarDebug = sugarStd.Debug SugarInfo = sugarStd.Info SugarWarn = sugarStd.Warn SugarError = sugarStd.Error SugarDPanic = sugarStd.DPanic SugarPanic = sugarStd.Panic SugarFatal = sugarStd.Fatal SugarDebugf = sugarStd.Debugf SugarInfof = sugarStd.Infof SugarWarnf = sugarStd.Warnf SugarErrorf = sugarStd.Errorf SugarDPanicf = sugarStd.DPanicf SugarPanicf = sugarStd.Panicf SugarFatalf = sugarStd.Fatalf SugarDebugw = sugarStd.Debugw SugarInfow = sugarStd.Infow SugarWarnw = sugarStd.Warnw SugarErrorw = sugarStd.Errorw SugarDPanicw = sugarStd.DPanicw SugarPanicw = sugarStd.Panicw SugarFatalw = sugarStd.Fatalw )
Functions ¶
func ResetDefault ¶
func ResetDefault(l *Logger)
Types ¶
type Level ¶
const ( InfoLevel Level = zap.InfoLevel WarnLevel Level = zap.WarnLevel ErrorLevel Level = zap.ErrorLevel DPanicLevel Level = zap.DPanicLevel PanicLevel Level = zap.PanicLevel // log msg, then panic FatalLevel Level = zap.FatalLevel // log msg, then calls os.Exit(1) DebugLevel Level = zap.DebugLevel )
type LevelEnableFunc ¶
type LogConfig ¶
type LogConfig struct { Path string `mapstructure:"path" yaml:"path"` ConsoleLevel string `mapstructure:"console-level" yaml:"console-level"` AccessOption *RotateOption `mapstructure:"access-option" yaml:"access-option"` ErrorOption *RotateOption `mapstructure:"error-option" yaml:"error-option"` }
LogConfig 日志参数
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewTeeWithRotate ¶
type RotateOption ¶
type RotateOption struct { MaxSize int `mapstructure:"max-size" yaml:"max-size"` MaxAge int `mapstructure:"max-age" yaml:"max-age"` MaxBackups int `mapstructure:"max-backups" yaml:"max-backups"` Compress bool `mapstructure:"compress" yaml:"compress"` Level string `mapstructure:"level" yaml:"level"` }
type TeeOption ¶
type TeeOption struct { Filename string Lef LevelEnableFunc Ropt RotateOption }
Click to show internal directories.
Click to hide internal directories.