log

package module
v0.0.0-...-a4b11d7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

README

log

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Any         = zap.Any
	Bool        = zap.Bool
	BoolP       = zap.Boolp
	Int         = zap.Int
	IntP        = zap.Intp
	Int8        = zap.Int8
	Int8P       = zap.Int8p
	Int16       = zap.Int16
	Int16P      = zap.Int16p
	Int32       = zap.Int32
	Int32P      = zap.Int32p
	Int64       = zap.Int64
	Int64P      = zap.Int64p
	Uint        = zap.Uint
	UintP       = zap.Uintp
	Uintptr     = zap.Uintptr
	UintptrP    = zap.Uintptrp
	Uint8       = zap.Uint8
	Uint8P      = zap.Uint8p
	Uint16      = zap.Uint16
	Uint16P     = zap.Uint16p
	Uint32      = zap.Uint32
	Uint32P     = zap.Uint32p
	Uint64      = zap.Uint64
	Uint64P     = zap.Uint64p
	Float32     = zap.Float32
	Float32P    = zap.Float32p
	Float64     = zap.Float64
	Float64P    = zap.Float64p
	Complex64   = zap.Complex64
	Complex64P  = zap.Complex64p
	Complex128  = zap.Complex128
	Complex128P = zap.Complex128p
	String      = zap.String
	StringP     = zap.Stringp
	ByteString  = zap.ByteString
	Binary      = zap.Binary
	Reflect     = zap.Reflect
	Namespace   = zap.Namespace
	Stringer    = zap.Stringer
	Time        = zap.Time
	TimeP       = zap.Timep
	Skip        = zap.Skip
	Stack       = zap.Stack
	StackSkip   = zap.StackSkip
	Duration    = func(key string, val time.Duration) Field { return String(key, val.String()) }
	DurationP   = func(key string, val *time.Duration) Field { str := (*val).String(); return StringP(key, &str) }
	Object      = zap.Object
	Inline      = zap.Inline
	Err         = zap.Error
)

Functions

func DPanic

func DPanic(msg string, fields ...Field)

func Debug

func Debug(msg string, fields ...Field)

func Error

func Error(msg string, fields ...Field)

func Fatal

func Fatal(msg string, fields ...Field)

func Info

func Info(msg string, fields ...Field)

func Panic

func Panic(msg string, fields ...Field)

func SetLogger

func SetLogger(l *Logger)

func Warn

func Warn(msg string, fields ...Field)

Types

type CallerEncoder

type CallerEncoder = zapcore.CallerEncoder

type CheckWriteHook

type CheckWriteHook = zapcore.CheckWriteHook

type CheckedEntry

type CheckedEntry = zapcore.CheckedEntry

type Clock

type Clock = zapcore.Clock

type Config

type Config func(config *zap.Config)

func WithDevelopment

func WithDevelopment(development bool) Config

func WithDisableCaller

func WithDisableCaller(disableCaller bool) Config

func WithDisableStacktrace

func WithDisableStacktrace(disableStacktrace bool) Config

func WithEncoderCaller

func WithEncoderCaller(encoderCaller CallerEncoder) Config

func WithEncoderCallerKey

func WithEncoderCallerKey(encoderCallerKey string) Config

func WithEncoderDuration

func WithEncoderDuration(encoderDuration DurationEncoder) Config

func WithEncoderFunctionKey

func WithEncoderFunctionKey(encoderFunctionKey string) Config

func WithEncoderLevel

func WithEncoderLevel(encoderLevel LevelEncoder) Config

func WithEncoderLevelKey

func WithEncoderLevelKey(encoderLevelKey string) Config

func WithEncoderLineEnding

func WithEncoderLineEnding(encoderLineEnding string) Config

func WithEncoderMessageKey

func WithEncoderMessageKey(encoderMessageKey string) Config

func WithEncoderName

func WithEncoderName(encoderName NameEncoder) Config

func WithEncoderNameKey

func WithEncoderNameKey(encoderNameKey string) Config

func WithEncoderNewReflectedEncoder

func WithEncoderNewReflectedEncoder(encoderNewReflectedEncoder func(io.Writer) ReflectedEncoder) Config

func WithEncoderStacktraceKey

func WithEncoderStacktraceKey(encoderStacktraceKey string) Config

func WithEncoderTime

func WithEncoderTime(encoderTime TimeEncoder) Config

func WithEncoderTimeKey

func WithEncoderTimeKey(encoderTimeKey string) Config

func WithEncoding

func WithEncoding(encoding Encoding) Config

func WithErrorOutputPaths

func WithErrorOutputPaths(errorOutputPaths ...string) Config

func WithInitialFields

func WithInitialFields(initialFields map[string]interface{}) Config

func WithLevel

func WithLevel(level Level) Config

func WithOutputPaths

func WithOutputPaths(outputPaths ...string) Config

func WithSampling

func WithSampling(sampling *SamplingConfig) Config

type Core

type Core = zapcore.Core

type DurationEncoder

type DurationEncoder = zapcore.DurationEncoder

type Encoder

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

func New

func New(cfg ...Config) *Encoder

func (*Encoder) Build

func (slf *Encoder) Build(options ...Option) (*Logger, error)

func (*Encoder) Extend

func (slf *Encoder) Extend(writer io.Writer, lvlEnabler ...LevelEnabler) *Encoder

type Encoding

type Encoding = string
const (
	JsonEncoding    Encoding = "json"
	ConsoleEncoding Encoding = "console"
)

type Entry

type Entry = zapcore.Entry

type Field

type Field = zap.Field

type Level

type Level = zapcore.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 LevelEnabler

type LevelEnabler = zapcore.LevelEnabler

type LevelEnablerFunc

type LevelEnablerFunc = zap.LevelEnablerFunc

type LevelEncoder

type LevelEncoder = zapcore.LevelEncoder

type Logger

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

func GetLogger

func GetLogger() *Logger

func (*Logger) DPanic

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

func (*Logger) Debug

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

func (*Logger) Error

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

func (*Logger) Fatal

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

func (*Logger) Info

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

func (*Logger) Named

func (slf *Logger) Named(name string) *Logger

func (*Logger) Panic

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

func (*Logger) Warn

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

func (*Logger) With

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

func (*Logger) WithLazy

func (slf *Logger) WithLazy(fields ...Field) *Logger

func (*Logger) WithOptions

func (slf *Logger) WithOptions(opts ...Option) *Logger

type NameEncoder

type NameEncoder = zapcore.NameEncoder

type Option

type Option = zap.Option

func BuildWithAddCaller

func BuildWithAddCaller() Option

func BuildWithAddCallerSkip

func BuildWithAddCallerSkip(skip int) Option

func BuildWithAddStacktrace

func BuildWithAddStacktrace(lvl LevelEnabler) Option

func BuildWithCaller

func BuildWithCaller(enabled bool) Option

func BuildWithClock

func BuildWithClock(clock Clock) Option

func BuildWithDevelopment

func BuildWithDevelopment() Option

func BuildWithErrorOutput

func BuildWithErrorOutput(w WriteSyncer) Option

func BuildWithFatalHook

func BuildWithFatalHook(hook CheckWriteHook) Option

func BuildWithFields

func BuildWithFields(fs ...Field) Option

func BuildWithHooks

func BuildWithHooks(hooks ...func(entry Entry) error) Option

func BuildWithIncreaseLevel

func BuildWithIncreaseLevel(lvl Level) Option

func BuildWithWrapCore

func BuildWithWrapCore(fn func(Core) Core) Option

type ReflectedEncoder

type ReflectedEncoder = zapcore.ReflectedEncoder

type SamplingConfig

type SamplingConfig = zap.SamplingConfig

type TimeEncoder

type TimeEncoder = zapcore.TimeEncoder

type WriteSyncer

type WriteSyncer = zapcore.WriteSyncer

func NewWriteSyncer

func NewWriteSyncer(ws ...io.Writer) WriteSyncer

func StdoutWriteSyncer

func StdoutWriteSyncer() WriteSyncer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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