zapx

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathExists

func PathExists(path string) (bool, error)

Types

type FileRotateOption

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

type FileRotatelogs

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

func NewFileRotateLogs

func NewFileRotateLogs(director string, opts ...OptionFunc) (*FileRotatelogs, error)

func (*FileRotatelogs) GetWriteSyncer

func (f *FileRotatelogs) GetWriteSyncer(level string) (zapcore.WriteSyncer, error)

type OptionFunc

type OptionFunc func(opt *FileRotateOption) error

func SetConsole

func SetConsole(console bool) OptionFunc

func SetFileWriter

func SetFileWriter(fileWriter bool) OptionFunc

func SetLevelPath

func SetLevelPath(f func(level string) string) OptionFunc

func SetLogExt

func SetLogExt(logExt string) OptionFunc

func SetMaxAge

func SetMaxAge(maxAge time.Duration) OptionFunc

func SetPrefix

func SetPrefix(prefix string) OptionFunc

type Zap

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

func NewZap

func NewZap(prefix, format, stacktraceKey string,
	level zapcore.Level, encoder zapcore.LevelEncoder,
	writeSyncer func(level string) (zapcore.WriteSyncer, error)) *Zap

func (*Zap) CustomTimeEncoder

func (z *Zap) CustomTimeEncoder(t time.Time, encoder zapcore.PrimitiveArrayEncoder)

func (*Zap) GetEncoder

func (z *Zap) GetEncoder() zapcore.Encoder

func (*Zap) GetEncoderConfig

func (z *Zap) GetEncoderConfig() zapcore.EncoderConfig

func (*Zap) GetEncoderCore

func (z *Zap) GetEncoderCore(l zapcore.Level, level zap.LevelEnablerFunc) zapcore.Core

func (*Zap) GetLevelPriority

func (z *Zap) GetLevelPriority(level zapcore.Level) zap.LevelEnablerFunc

func (*Zap) GetZapCores

func (z *Zap) GetZapCores() []zapcore.Core

Jump to

Keyboard shortcuts

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