ctxlog

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 2 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewLogger = log.New

NewLogger function to create new log.Logger, needed for mocking in tests

Functions

func Fields added in v0.8.0

func Fields(ctx context.Context) log.Fields

Fields returns a copy of the context log fields. It can be nil

func Get

func Get(ctx context.Context) log.Logger

Get returns a logger configured with the context log Fields or the default fields

func WithLogFields

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

WithLogFields returns a context with new logger Fields added to the current ones, and a logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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