ctxlog

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerKey ctxLogger = 0

LoggerKey is the key that holds logger in a context.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context) log.Logger

Get returns logger from context or DefaultLogger if there is no logger in context

func Set

func Set(ctx context.Context, logger log.Logger) context.Context

Set puts logger into context and returns new context

func WithLogFields

func WithLogFields(ctx context.Context, f log.Fields) (context.Context, log.Logger)

WithLogFields returns context with new logger and the logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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