logger

package
v0.0.0-...-ea7d51e Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLevel      = zapcore.InfoLevel
	DefaultTimeLayout = time.RFC3339
)

Variables

This section is empty.

Functions

func NewJsonLogger

func NewJsonLogger(opts ...Option) (*zap.Logger, error)

func WrapMeta

func WrapMeta(err error, metas ...Meta) (fields []zap.Field)

Types

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})

	Info(v ...interface{})
	Infof(format string, v ...interface{})

	Warn(v ...interface{})
	Warnf(format string, v ...interface{})

	Error(v ...interface{})
	Errorf(format string, v ...interface{})

	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})

	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
}

type Meta

type Meta interface {
	Key() string
	Value() any
	// contains filtered or unexported methods
}

func NewMeta

func NewMeta(key string, value any) Meta

type Option

type Option func(*option)

func WithDisableConsole

func WithDisableConsole() Option

func WithDriver

func WithDriver(driver io.Writer) Option

func WithField

func WithField(key string, value any) Option

func WithFilePath

func WithFilePath(file string) Option

func WithFileRotation

func WithFileRotation(file string) Option

func WithLevel

func WithLevel(level zapcore.Level) Option

func WithTimeLayout

func WithTimeLayout(layout string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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