Documentation ¶
Index ¶
- Variables
- func Sync() error
- type EncoderType
- type Field
- type Level
- type Option
- type Rotate
- type RotateOption
- type ZapLogger
- func (z *ZapLogger) DPanic(msg string, fields ...Field)
- func (z *ZapLogger) DPanicf(format string, v ...interface{})
- func (z *ZapLogger) Debug(msg string, fields ...Field)
- func (z *ZapLogger) Debugf(format string, v ...interface{})
- func (z *ZapLogger) Error(msg string, fields ...Field)
- func (z *ZapLogger) Errorf(format string, v ...interface{})
- func (z *ZapLogger) Fatal(msg string, fields ...Field)
- func (z *ZapLogger) Fatalf(format string, v ...interface{})
- func (z *ZapLogger) Info(msg string, fields ...Field)
- func (z *ZapLogger) Infof(format string, v ...interface{})
- func (z *ZapLogger) Panic(msg string, fields ...Field)
- func (z *ZapLogger) Panicf(format string, v ...interface{})
- func (z *ZapLogger) Sync() error
- func (z *ZapLogger) Warn(msg string, fields ...Field)
- func (z *ZapLogger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
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 )
View Source
var Default = New(WithLevelAt(DebugLevel))
Functions ¶
Types ¶
type EncoderType ¶
type EncoderType string
const ( ConsoleEncoder EncoderType = "console" JSONEncoder EncoderType = "json" )
type Level ¶
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel Level = zapcore.DebugLevel // InfoLevel is the default logging priority. InfoLevel Level = zapcore.InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel Level = zapcore.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel Level = zapcore.ErrorLevel // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel Level = zapcore.DPanicLevel // PanicLevel logs a message, then panics. PanicLevel Level = zapcore.PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel Level = zapcore.FatalLevel )
type RotateOption ¶
type RotateOption func(*Rotate)
func WithCompress ¶
func WithCompress(isCompress bool) RotateOption
WithCompress set log file backup is compress.
default false.
func WithFileName ¶
func WithFileName(filename string) RotateOption
WithFileName set log file name.
default zap.log.
func WithLocalTime ¶
func WithLocalTime(isLocalTime bool) RotateOption
WithLocalTime set log file name suffix.
default false.
func WithMaxAge ¶
func WithMaxAge(maxAge int) RotateOption
WithMaxAge set log file max age.
default 7 day.
func WithMaxBackups ¶
func WithMaxBackups(maxBackups int) RotateOption
WithMaxBackups set log file max backups.
default 10.
func WithMaxSize ¶
func WithMaxSize(maxSize int) RotateOption
WithMaxSize set log file max size unit M.
default 500M.
Click to show internal directories.
Click to hide internal directories.