Documentation
¶
Index ¶
- Variables
- func DPanic(msg string, fields ...Field)
- func DPanicf(format string, args ...any)
- func Debug(msg string, fields ...Field)
- func Debugf(format string, args ...any)
- func Error(msg string, fields ...Field)
- func Errorf(format string, args ...any)
- func Fatal(msg string, fields ...Field)
- func Fatalf(format string, args ...any)
- func Info(msg string, fields ...Field)
- func Infof(format string, args ...any)
- func Panic(msg string, fields ...Field)
- func Panicf(format string, args ...any)
- func SetLogger(log Logger)
- func Warn(msg string, fields ...Field)
- func Warnf(format string, args ...any)
- type Core
- type Encoder
- type Field
- type Level
- type LevelEnablerFunc
- func DPanicLevelPartition() LevelEnablerFunc
- func DebugLevelPartition() LevelEnablerFunc
- func ErrorLevelPartition() LevelEnablerFunc
- func FatalLevelPartition() LevelEnablerFunc
- func InfoLevelPartition() LevelEnablerFunc
- func PanicLevelPartition() LevelEnablerFunc
- func WarnLevelPartition() LevelEnablerFunc
- type Log
- func (slf *Log) DPanic(msg string, fields ...Field)
- func (slf *Log) DPanicf(format string, args ...any)
- func (slf *Log) Debug(msg string, fields ...Field)
- func (slf *Log) Debugf(format string, args ...any)
- func (slf *Log) Error(msg string, fields ...Field)
- func (slf *Log) Errorf(format string, args ...any)
- func (slf *Log) Fatal(msg string, fields ...Field)
- func (slf *Log) Fatalf(format string, args ...any)
- func (slf *Log) Info(msg string, fields ...Field)
- func (slf *Log) Infof(format string, args ...any)
- func (slf *Log) Panic(msg string, fields ...Field)
- func (slf *Log) Panicf(format string, args ...any)
- func (slf *Log) Printf(format string, args ...any)
- func (slf *Log) Warn(msg string, fields ...Field)
- func (slf *Log) Warnf(format string, args ...any)
- type Logger
- type Option
- type RunMode
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 Object = zap.Object Inline = zap.Inline Any = zap.Any Err = zap.Error )
Functions ¶
Types ¶
type Level ¶
const ( DebugLevel Level = zapcore.DebugLevel InfoLevel Level = zapcore.InfoLevel WarnLevel Level = zapcore.WarnLevel ErrorLevel Level = zapcore.ErrorLevel DPanicLevel Level = zapcore.DPanicLevel PanicLevel Level = zapcore.PanicLevel FatalLevel Level = zapcore.FatalLevel )
type LevelEnablerFunc ¶
type LevelEnablerFunc = zap.LevelEnablerFunc
func DPanicLevelPartition ¶
func DPanicLevelPartition() LevelEnablerFunc
func DebugLevelPartition ¶
func DebugLevelPartition() LevelEnablerFunc
func ErrorLevelPartition ¶
func ErrorLevelPartition() LevelEnablerFunc
func FatalLevelPartition ¶
func FatalLevelPartition() LevelEnablerFunc
func InfoLevelPartition ¶
func InfoLevelPartition() LevelEnablerFunc
func PanicLevelPartition ¶
func PanicLevelPartition() LevelEnablerFunc
func WarnLevelPartition ¶
func WarnLevelPartition() LevelEnablerFunc
type Logger ¶
type Logger interface { ants.Logger logging.Logger Debug(msg string, fields ...Field) Info(msg string, fields ...Field) Warn(msg string, fields ...Field) Error(msg string, fields ...Field) DPanic(msg string, fields ...Field) Panic(msg string, fields ...Field) Fatal(msg string, fields ...Field) Debugf(format string, args ...any) Infof(format string, args ...any) Warnf(format string, args ...any) Errorf(format string, args ...any) DPanicf(format string, args ...any) Panicf(format string, args ...any) Fatalf(format string, args ...any) }
type Option ¶
type Option func(log *Log)
func WithFilename ¶
WithFilename 设置日志文件名,默认为:{level}.log
func WithLogDir ¶
WithLogDir 设置日志存储目录,若为空则不会存储文件
func WithRotateFilename ¶
WithRotateFilename 设置日志分割文件名,默认为:{level}.%Y%m%d.log
func WithRotateOption ¶
func WithRotateOption(options ...rotatelogs.Option) Option
WithRotateOption 设置日志分割选项,默认选项为:WithMaxAge(time.Hour*24*7),WithRotationTime(time.Hour*24)
func WithRunMode ¶
WithRunMode 设置运行模式,默认为:RunModeDev
Click to show internal directories.
Click to hide internal directories.