xzap

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonFormat = "json"
	TextFormat = "console"
)

Variables

This section is empty.

Functions

func Log

func Log() *log.Logger

func NewZap

func NewZap(cfg *LogConfig) (log *zap.Logger, err error)

func TimeEncoder

func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

Types

type EsConfig

type EsConfig struct {
	Open      bool
	IndexName string
	Level     zapcore.Level
	Conn      *elastic.Client
}

type EsZapCore

type EsZapCore struct {
	zapcore.LevelEnabler
	// contains filtered or unexported fields
}

func (*EsZapCore) Check

func (*EsZapCore) Enabled

func (c *EsZapCore) Enabled(lvl zapcore.Level) bool

func (*EsZapCore) Sync

func (c *EsZapCore) Sync() error

func (*EsZapCore) With

func (c *EsZapCore) With(fields []zapcore.Field) zapcore.Core

func (*EsZapCore) Write

func (c *EsZapCore) Write(ent zapcore.Entry, fields []zapcore.Field) error

type LogConfig

type LogConfig struct {
	Level       int32
	OutputPaths []string
	Dev         bool
	Format      string
	ErrPaths    []string
	ExtFields   map[string]interface{}
	EsConfig    *EsConfig
}

Jump to

Keyboard shortcuts

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