zapimpl

package
v0.9.5-rc Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHelper

func NewHelper(logger *zap.Logger, opt ...Option) ull.Helper

func NewZapLogEntry

func NewZapLogEntry(ctx context.Context) ull.Entry

func NewZapLogger

func NewZapLogger(cfg *config.LogConfig) (logger *zap.Logger, err error)

NewZapLogger 日志配置文件 如果需要配置 options, 请使用 logger.WithOptions() 方法进行配置 zap.AddCaller() zap.AddCallerSkip(2) 添加额外的配置

Types

type Option

type Option func(c *ZapHelperBuilder)

func AddHook

func AddHook(hook ull.Hook) Option

type ZapHelperBuilder

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

type ZapLoggerEntry

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

func (*ZapLoggerEntry) AppendField

func (c *ZapLoggerEntry) AppendField(field ull.Field) (err error)

AppendField append field to fields

func (*ZapLoggerEntry) Context

func (c *ZapLoggerEntry) Context() (ctx context.Context)

Context get ctx

func (*ZapLoggerEntry) GetFields

func (c *ZapLoggerEntry) GetFields() []ull.Field

GetFields get fields

Jump to

Keyboard shortcuts

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