logger

package
v1.2.4-0...-07fe0ac Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnContext

func OnContext(ctx context.Context, logger Logger) context.Context

Types

type Logger

type Logger interface {
	Debugw(msg string, keysAndValues ...interface{})

	Infow(msg string, keysAndValues ...interface{})

	Warnw(msg string, keysAndValues ...interface{})

	Errorw(msg string, keysAndValues ...interface{})

	Fatal(args ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})

	Sync() error
}

Logger defines the smallest interface we use of go-uber/zap's sugared logger Defining this interface makes it easier for us to control what functions we use, and to pass the logger around to various packages

func FromContext

func FromContext(ctx context.Context) Logger

func New

func New(logLevel zap.AtomicLevel, logDevelopment bool) Logger

func NewNoop

func NewNoop() Logger

func NewTest

func NewTest() Logger

type NoopLogger

type NoopLogger struct {
}

func (*NoopLogger) Debugw

func (l *NoopLogger) Debugw(msg string, keysAndValues ...interface{})

func (*NoopLogger) Errorw

func (l *NoopLogger) Errorw(msg string, keysAndValues ...interface{})

func (*NoopLogger) Fatal

func (l *NoopLogger) Fatal(args ...interface{})

func (*NoopLogger) Fatalw

func (l *NoopLogger) Fatalw(msg string, keysAndValues ...interface{})

func (*NoopLogger) Infow

func (l *NoopLogger) Infow(msg string, keysAndValues ...interface{})

func (*NoopLogger) Sync

func (l *NoopLogger) Sync() error

func (*NoopLogger) Warnw

func (l *NoopLogger) Warnw(msg string, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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