Documentation ¶
Index ¶
- Constants
- Variables
- func ResetCurrentLog(l *Logger)
- type Field
- type Format
- type Level
- type LevelEnablerFunc
- type Logger
- func (l *Logger) DPanic(args ...interface{})
- func (l *Logger) DPanicf(template string, args ...interface{})
- func (l *Logger) DPanicw(msg string, keysAndValues ...interface{})
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(template string, args ...interface{})
- func (l *Logger) Debugw(msg string, keysAndValues ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(template string, args ...interface{})
- func (l *Logger) Errorw(msg string, keysAndValues ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(template string, args ...interface{})
- func (l *Logger) Fatalw(msg string, keysAndValues ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(template string, args ...interface{})
- func (l *Logger) Infow(msg string, keysAndValues ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(template string, args ...interface{})
- func (l *Logger) Panicw(msg string, keysAndValues ...interface{})
- func (l *Logger) Sync() error
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(template string, args ...interface{})
- func (l *Logger) Warnw(msg string, keysAndValues ...interface{})
- func (l *Logger) ZapDPanic(msg string, fields ...Field)
- func (l *Logger) ZapDebug(msg string, fields ...Field)
- func (l *Logger) ZapError(msg string, fields ...Field)
- func (l *Logger) ZapFatal(msg string, fields ...Field)
- func (l *Logger) ZapInfo(msg string, fields ...Field)
- func (l *Logger) ZapPanic(msg string, fields ...Field)
- func (l *Logger) ZapWarn(msg string, fields ...Field)
- type Option
- type TeeOption
- type TeeWithRotateOption
Constants ¶
View Source
const DefaultConsoleSeparator = " | "
Variables ¶
View Source
var ( Debug = currentLog.Debug Debugf = currentLog.Debugf Debugw = currentLog.Debugw Info = currentLog.Info Infof = currentLog.Infof Infow = currentLog.Infow Warn = currentLog.Warn Warnf = currentLog.Warnf Warnw = currentLog.Warnw Error = currentLog.Error Errorf = currentLog.Errorf Errorw = currentLog.Errorw DPanic = currentLog.DPanic DPanicf = currentLog.DPanicf DPanicw = currentLog.DPanicw Panic = currentLog.Panic Panicf = currentLog.Panicf Panicw = currentLog.Panicw Fatal = currentLog.Fatal Fatalf = currentLog.Fatalf Fatalw = currentLog.Fatalw ZapDebug = currentLog.ZapDebug ZapInfo = currentLog.ZapInfo ZapWarn = currentLog.ZapWarn ZapError = currentLog.ZapError ZapDPanic = currentLog.ZapDPanic ZapPanic = currentLog.ZapPanic ZapFatal = currentLog.ZapFatal Sync = currentLog.Sync )
View Source
var ( AddStacktrace = zap.AddStacktrace AddCaller = zap.AddCaller AddCallerSkip = zap.AddCallerSkip )
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.Int32p 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.Uintptrp 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 Any = zap.Any )
Functions ¶
func ResetCurrentLog ¶
func ResetCurrentLog(l *Logger)
Types ¶
type Level ¶
const ( DebugLevel Level = zap.DebugLevel InfoLevel Level = zap.InfoLevel WarnLevel Level = zap.WarnLevel ErrorLevel Level = zap.ErrorLevel DPanicLevel Level = zap.DPanicLevel PanicLevel Level = zap.PanicLevel FatalLevel Level = zap.FatalLevel )
func ParseLevel ¶
type LevelEnablerFunc ¶
type Logger ¶
type Logger struct { ZapLogger *zap.Logger ZapSugaredLogger *zap.SugaredLogger }
func CurrentLog ¶
func CurrentLog() *Logger
func NewTeeWithRotate ¶
func NewTeeWithRotate(tops []TeeWithRotateOption, addCaller bool, opts ...Option) *Logger
type TeeWithRotateOption ¶
type TeeWithRotateOption struct { Filename string MaxSize int // the maximum size in megabytes of the log file before it gets rotated MaxAge int // the maximum number of days to retain old log files based on the timestamp encoded in their filename MaxBackups int // the maximum number of old log files to retain Compress bool // the rotated log files should be compressed or not Lef LevelEnablerFunc F Format }
Click to show internal directories.
Click to hide internal directories.