Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelInfo  = "info"
	LogLevelWarn  = "warn"
	LogLevelError = "error"
	LogLevelDebug = "debug"
)

Variables

View Source
var (
	DefaultLogLevel        = "INFO"
	DefaultLogLevelKey     = "level"
	DefaultLogLevelEncoder = "capitalcolor"
)

Functions

func FromContext added in v0.17.0

func FromContext(ctx context.Context) *zap.SugaredLogger

func IntoContext added in v0.17.0

func IntoContext(ctx context.Context, log *zap.SugaredLogger) context.Context

func Named added in v0.17.0

func Named(name string) *zap.SugaredLogger

func NewContext added in v0.17.0

func NewContext(ctx context.Context, logger *zap.SugaredLogger) context.Context

func SetupLogger

func SetupLogger(logLevel string, logLevelKey string, logLevelEncoder string) error

Types

type ProviderLogWrapper added in v0.15.0

type ProviderLogWrapper struct {
	ZP *zap.SugaredLogger
}

func (*ProviderLogWrapper) Debug added in v0.15.0

func (l *ProviderLogWrapper) Debug(msg string)

func (*ProviderLogWrapper) Error added in v0.15.0

func (l *ProviderLogWrapper) Error(err error, msg string)

func (*ProviderLogWrapper) Info added in v0.15.0

func (l *ProviderLogWrapper) Info(msg string)

Jump to

Keyboard shortcuts

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