log

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = iota - 1
	InfoLevel
	WarnLevel
	ErrorLevel

	RotateMaxSize    = 300
	RotateMaxAge     = 7
	RotateMaxBackups = 15
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Debugf

func Debugf(msg string, args ...interface{})

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Error

func Error(msg string)

func Errorf

func Errorf(msg string, args ...interface{})

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(template string, args ...interface{})

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Info

func Info(msg string)

func Infof

func Infof(msg string, args ...interface{})

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init(config *Config)

func NewLogger

func NewLogger(conf *Config) *zap.Logger

func NewSugaredLogger

func NewSugaredLogger(conf *Config) *zap.SugaredLogger

func NewkvEncoder

func NewkvEncoder(cfg zapcore.EncoderConfig) *kvEncoder

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(template string, args ...interface{})

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func Warn

func Warn(msg string)

func Warnf

func Warnf(msg string, args ...interface{})

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Types

type CommonEncoder added in v1.0.4

type CommonEncoder struct {
	// contains filtered or unexported fields
}

func NewCommonEncoder added in v1.0.4

func NewCommonEncoder(cfg zapcore.EncoderConfig) *CommonEncoder

func (CommonEncoder) AddArray added in v1.0.4

func (enc CommonEncoder) AddArray(key string, arr zapcore.ArrayMarshaler) error

func (CommonEncoder) AddBinary added in v1.0.4

func (enc CommonEncoder) AddBinary(key string, val []byte)

func (CommonEncoder) AddBool added in v1.0.4

func (enc CommonEncoder) AddBool(key string, val bool)

func (CommonEncoder) AddByteString added in v1.0.4

func (enc CommonEncoder) AddByteString(key string, val []byte)

func (CommonEncoder) AddComplex128 added in v1.0.4

func (enc CommonEncoder) AddComplex128(k string, v complex128)

func (CommonEncoder) AddComplex64 added in v1.0.4

func (enc CommonEncoder) AddComplex64(k string, v complex64)

func (CommonEncoder) AddDuration added in v1.0.4

func (enc CommonEncoder) AddDuration(key string, val time.Duration)

func (CommonEncoder) AddFloat32 added in v1.0.4

func (enc CommonEncoder) AddFloat32(key string, val float32)

func (CommonEncoder) AddFloat64 added in v1.0.4

func (enc CommonEncoder) AddFloat64(key string, val float64)

func (CommonEncoder) AddInt added in v1.0.4

func (enc CommonEncoder) AddInt(k string, v int)

func (CommonEncoder) AddInt16 added in v1.0.4

func (enc CommonEncoder) AddInt16(k string, v int16)

func (CommonEncoder) AddInt32 added in v1.0.4

func (enc CommonEncoder) AddInt32(k string, v int32)

func (CommonEncoder) AddInt64 added in v1.0.4

func (enc CommonEncoder) AddInt64(key string, val int64)

func (CommonEncoder) AddInt8 added in v1.0.4

func (enc CommonEncoder) AddInt8(k string, v int8)

func (CommonEncoder) AddObject added in v1.0.4

func (enc CommonEncoder) AddObject(key string, obj zapcore.ObjectMarshaler) error

func (CommonEncoder) AddReflected added in v1.0.4

func (enc CommonEncoder) AddReflected(key string, obj interface{}) error

func (CommonEncoder) AddString added in v1.0.4

func (enc CommonEncoder) AddString(key, val string)

func (CommonEncoder) AddTime added in v1.0.4

func (enc CommonEncoder) AddTime(key string, val time.Time)

func (CommonEncoder) AddUint added in v1.0.4

func (enc CommonEncoder) AddUint(k string, v uint)

func (CommonEncoder) AddUint16 added in v1.0.4

func (enc CommonEncoder) AddUint16(k string, v uint16)

func (CommonEncoder) AddUint32 added in v1.0.4

func (enc CommonEncoder) AddUint32(k string, v uint32)

func (CommonEncoder) AddUint64 added in v1.0.4

func (enc CommonEncoder) AddUint64(key string, val uint64)

func (CommonEncoder) AddUint8 added in v1.0.4

func (enc CommonEncoder) AddUint8(k string, v uint8)

func (CommonEncoder) AddUintptr added in v1.0.4

func (enc CommonEncoder) AddUintptr(k string, v uintptr)

func (CommonEncoder) AppendArray added in v1.0.4

func (enc CommonEncoder) AppendArray(arr zapcore.ArrayMarshaler) error

func (CommonEncoder) AppendBool added in v1.0.4

func (enc CommonEncoder) AppendBool(val bool)

func (CommonEncoder) AppendByteString added in v1.0.4

func (enc CommonEncoder) AppendByteString(val []byte)

func (CommonEncoder) AppendComplex128 added in v1.0.4

func (enc CommonEncoder) AppendComplex128(v complex128)

func (CommonEncoder) AppendComplex64 added in v1.0.4

func (enc CommonEncoder) AppendComplex64(v complex64)

func (CommonEncoder) AppendDuration added in v1.0.4

func (enc CommonEncoder) AppendDuration(val time.Duration)

func (CommonEncoder) AppendFloat32 added in v1.0.4

func (enc CommonEncoder) AppendFloat32(v float32)

func (CommonEncoder) AppendFloat64 added in v1.0.4

func (enc CommonEncoder) AppendFloat64(v float64)

func (CommonEncoder) AppendInt added in v1.0.4

func (enc CommonEncoder) AppendInt(v int)

func (CommonEncoder) AppendInt16 added in v1.0.4

func (enc CommonEncoder) AppendInt16(v int16)

func (CommonEncoder) AppendInt32 added in v1.0.4

func (enc CommonEncoder) AppendInt32(v int32)

func (CommonEncoder) AppendInt64 added in v1.0.4

func (enc CommonEncoder) AppendInt64(val int64)

func (CommonEncoder) AppendInt8 added in v1.0.4

func (enc CommonEncoder) AppendInt8(v int8)

func (CommonEncoder) AppendObject added in v1.0.4

func (enc CommonEncoder) AppendObject(obj zapcore.ObjectMarshaler) error

func (CommonEncoder) AppendReflected added in v1.0.4

func (enc CommonEncoder) AppendReflected(val interface{}) error

func (CommonEncoder) AppendString added in v1.0.4

func (enc CommonEncoder) AppendString(val string)

func (CommonEncoder) AppendTime added in v1.0.4

func (enc CommonEncoder) AppendTime(val time.Time)

func (CommonEncoder) AppendUint added in v1.0.4

func (enc CommonEncoder) AppendUint(v uint)

func (CommonEncoder) AppendUint16 added in v1.0.4

func (enc CommonEncoder) AppendUint16(v uint16)

func (CommonEncoder) AppendUint32 added in v1.0.4

func (enc CommonEncoder) AppendUint32(v uint32)

func (CommonEncoder) AppendUint64 added in v1.0.4

func (enc CommonEncoder) AppendUint64(val uint64)

func (CommonEncoder) AppendUint8 added in v1.0.4

func (enc CommonEncoder) AppendUint8(v uint8)

func (CommonEncoder) AppendUintptr added in v1.0.4

func (enc CommonEncoder) AppendUintptr(v uintptr)

func (CommonEncoder) Clone added in v1.0.4

func (enc CommonEncoder) Clone() zapcore.Encoder

func (CommonEncoder) EncodeEntry added in v1.0.4

func (c CommonEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

func (CommonEncoder) OpenNamespace added in v1.0.4

func (enc CommonEncoder) OpenNamespace(key string)

type Config

type Config struct {
	Format   string
	Level    string
	FilePath string
	Rotate   RotateConfig
}

type RotateConfig

type RotateConfig struct {
	Compress   bool
	MaxSize    int
	MaxAge     int
	MaxBackups int
}

Directories

Path Synopsis
Package bufferpool houses zap's shared internal buffer pool.
Package bufferpool houses zap's shared internal buffer pool.
Package pool provides internal pool utilities.
Package pool provides internal pool utilities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL