log

package
v0.0.0-...-272f778 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.Logger
}

func NewLogger

func NewLogger(cfg *config.Config) *Logger

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *Logger

WithContext Returns a zap instance from the specified context WithContext 从 context.Context 中获取存储的 zap 日志记录器。

func (*Logger) WithValue

func (l *Logger) WithValue(ctx context.Context, fields ...zapcore.Field) context.Context

WithValue Adds a field to the specified context WithValue withValue会创建一个新的zapLogger上下文,并添加一些字段,然后存储在context.Context中。 将 zap 日志记录器及其附加的字段存储在 context.Context 中,以便在后续的处理中使用。

Jump to

Keyboard shortcuts

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