log

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 10 Imported by: 0

README

log

Documentation

Index

Constants

View Source
const (
	DebugLevel  = zapcore.DebugLevel
	InfoLevel   = zapcore.InfoLevel
	WarnLevel   = zapcore.WarnLevel
	ErrorLevel  = zapcore.ErrorLevel
	DPanicLevel = zapcore.DPanicLevel
	PanicLevel  = zapcore.PanicLevel
	FatalLevel  = zapcore.FatalLevel
)

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         = any
	ProtoBuf    = protoBuf
	Error       = zap.Error

	Array       = zap.Array
	Bools       = zap.Bools
	ByteStrings = zap.ByteStrings
	Binaries    = binaries
	Complex128s = zap.Complex128s
	Complex64s  = zap.Complex64s
	Durations   = zap.Durations
	Float64s    = zap.Float64s
	Float32s    = zap.Float32s
	Ints        = zap.Ints
	Int64s      = zap.Int64s
	Int32s      = zap.Int32s
	Int16s      = zap.Int16s
	Int8s       = zap.Int8s
	Strings     = zap.Strings
	Times       = zap.Times
	Uints       = zap.Uints
	Uint64s     = zap.Uint64s
	Uint32s     = zap.Uint32s
	Uint16s     = zap.Uint16s
	Uint8s      = zap.Uint8s
	Uintptrs    = zap.Uintptrs
	Errors      = zap.Errors
)

Functions

func WithCompress

func WithCompress(compress bool) fileOption

func WithMaxAge

func WithMaxAge(age int) fileOption

func WithMaxBackups

func WithMaxBackups(backup int) fileOption

func WithMaxSize

func WithMaxSize(maxSize int) fileOption

Types

type Field

type Field = zap.Field

type Level

type Level = zapcore.Level

type LevelEnablerFunc

type LevelEnablerFunc func(Level) zap.LevelEnablerFunc

type Logger

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

func NewLogger

func NewLogger(opts ...Options) *Logger

func (*Logger) DPanic

func (l *Logger) DPanic(msg string, fields ...Field)

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...Field)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...Field)

func (*Logger) GetLevel

func (l *Logger) GetLevel() Level

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

func (*Logger) Logger

func (l *Logger) Logger() *zap.Logger

func (*Logger) Panic

func (l *Logger) Panic(msg string, fields ...Field)

func (*Logger) SetFields

func (l *Logger) SetFields(fields ...Field)

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl Level)

func (*Logger) SetOptions

func (l *Logger) SetOptions(opts ...zap.Option)

func (*Logger) Sugar

func (l *Logger) Sugar() *zap.SugaredLogger

func (*Logger) Sync

func (l *Logger) Sync() error

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...Field)

func (*Logger) With

func (l *Logger) With(fields ...Field) *Logger

func (*Logger) WithOptions

func (l *Logger) WithOptions(opts ...zap.Option) *Logger

type Option

type Option zap.Option

type Options

type Options interface {
	// contains filtered or unexported methods
}

func WithDebug

func WithDebug(debug bool) Options

func WithFile

func WithFile(file string, f LevelEnablerFunc, opts ...fileOption) Options

func WithHooks

func WithHooks(hooks []func(zapcore.Entry) error) Options

func WithLevel

func WithLevel(l Level) Options

func WithLocalTime

func WithLocalTime(localTime bool) Options

func WithOptions

func WithOptions(opts []zap.Option) Options

func WithSkip

func WithSkip(skip int) Options

func WithTraceKey

func WithTraceKey(traceKey string) Options

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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