zapctx

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 2 Imported by: 14

README

zapctx

Simple abstraction of zap logger with attached context

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, fields ...zap.Field) context.Context

Types

type DynamicFields

type DynamicFields func(ctx context.Context) []zap.Field

type FieldLogger

type FieldLogger struct {
	Logger *Logger
}

func (*FieldLogger) Log

func (f *FieldLogger) Log(keyvals ...interface{})

type Logger

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

func New

func New(root *zap.Logger) *Logger

func (*Logger) Debug

func (l *Logger) Debug(ctx context.Context, msg string, fields ...zap.Field)

func (*Logger) DynamicFields

func (l *Logger) DynamicFields(dynamicFields ...DynamicFields) *Logger

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, fields ...zap.Field)

func (*Logger) IfErr

func (l *Logger) IfErr(err error) *Logger

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, fields ...zap.Field)

func (*Logger) Panic

func (l *Logger) Panic(ctx context.Context, msg string, fields ...zap.Field)

func (*Logger) Unwrap added in v0.0.2

func (l *Logger) Unwrap(ctx context.Context) *zap.Logger

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, msg string, fields ...zap.Field)

func (*Logger) With

func (l *Logger) With(fields ...zap.Field) *Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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